<commit_before>require! {express, optimist, plv8x}
conString = process.argv.2 or process.env.PGRESTCONN or process.env.TESTDBNAME
port = 3000
app = express!

plx <- (require \./).new conString

rows <- plx.query """
  SELECT t.table_name tbl FROM INFORMATION_SCHEMA.TABLES t WHERE t.table_schema = 'public';
"""
cols = for {tbl} in rows => mount-model tbl

app.get '/collections', (req, res) ->
  res.setHeader 'Content-Type', 'application/json; charset=UTF-8'
  res.end JSON.stringify cols<commit_msg>* Expose all non-system, non-plv8x schemas.<commit_after>require! {express, optimist, plv8x}
conString = process.argv.2 or process.env.PGRESTCONN or process.env.TESTDBNAME
port = 3000
app = express!

plx <- (require \./).new conString

rows <- plx.query """
  SELECT t.table_name tbl FROM INFORMATION_SCHEMA.TABLES t WHERE t.table_schema NOT IN (
    'information_schema', 'pg_catalog', 'plv8x'
  );
"""
cols = for {tbl} in rows => mount-model tbl

app.get '/collections', (req, res) ->
  res.setHeader 'Content-Type', 'application/json; charset=UTF-8'
  res.end JSON.stringify cols
{'fraction_non_alphanumeric': 0.14206642066420663, 'fraction_numerical': 0.014760147601476014, 'mean_word_length': 4.318627450980392, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6011515', 'n_tokens_mistral': 402, 'n_tokens_neox': 377, 'n_words': 102}