title: Is it possible to add sqlite scripts in sqlite console without overhead of creating c/c++ loadable extension
body: <p>Curious to know if it is possible in a reasonable manner to "avoid" creating a loadable c sqlite extension and directly create a "script" inside the console to do some transformations for me . For example sqlite documentation has a site devoted to some core functions <a href="https://www.sqlite.org/lang_corefunc.html" rel="nofollow noreferrer">https://www.sqlite.org/lang_corefunc.html</a> like <code>"ABS"</code> or <code>"random"</code> but it would be convenient to create client side scripts in TCL / JavaScript or what ever language to do other manipulations. For instance:</p>
  
  <pre><code># User script
  proc reversedResult(result) {
    return [string reverse $a]
  }
  
  
  select reversedResult(db.name) from users where id=1
  </code></pre>
  
  <hr>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The data base is loaded directly from a CSV file using a SQLite shell script as follows:</p>
  
  <pre><code>-- created at 2017-10-17 10:43:42.430129
  -- script path /tmp/popDb/cmd1508226222.txt
  
  CREATE TABLE 'hash_gen' ( 
                          'key' TEXT PRIMARY KEY NOT NULL,
                          'hash' INT NOT NULL &lt;&lt;&lt;&lt;&lt;&lt; HERE I WANT TO USE A HASHING FUNCTION
                      );
  CREATE INDEX hash_gen_index ON hash_gen (hash);
  
  CREATE TABLE 'info' (
                          key TEXT PRIMARY KEY NOT NULL,
                          value   TEXT NOT NULL
                      );
  
  INSERT INTO 'info' VALUES('primary_table','products');
  
  INSERT INTO 'info' VALUES('primary_key','sku');
  
  INSERT INTO 'info' VALUES('db_version','1.0.0');
  
  CREATE TABLE products (
  sku TEXT PRIMARY KEY NOT NULL,
  ...many more columns...
  );
  CREATE TRIGGER hash_gen_trigger
      AFTER INSERT
      ON 'products'
      BEGIN
          INSERT INTO hash_gen(key,hash) VALUES(new.sku,MY_CUSTOM_HASH_FUNCTION(new.sku,...all other fields,....));
  END;
  .mode csv
  .import /tmp/inputCSV/1503331189113.csv products
  ....
  
  &lt;&lt;&lt;&lt; MY_CUSTOM_HASH_FUNCTION(input) {return custom_hash_on_(input)...}
  </code></pre>
  
  <p>and then finally the db is created as part of a separate flow (in a different tool in a different programming language (scala)):</p>
  
  <pre><code>sqlite3 /output/path/db.db &lt; /tmp/popDb/cmd1508226222.txt
  </code></pre>