Skip to content

Instantly share code, notes, and snippets.

@mrjjwright
Created April 11, 2010 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mrjjwright/363142 to your computer and use it in GitHub Desktop.
Save mrjjwright/363142 to your computer and use it in GitHub Desktop.
An example of a data migration in NoSQLite
require "nosqlite"
require "Math.uuid"
convert_callback: (row) ->
if not row.guid?
row.guid: Math.uuidFast();
return row;
db_file: "my_db.sqlite"
db: nosqlite.connect db_file, ->
db.migrate_table "log_source", convert_callback, (err, res) ->
debug err
debug res
db.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment