Closed moonrailgun closed 6 years ago
sample test js script
var orm = require('orm'); var path = require('path'); // orm.connect("sqlite://" + path.resolve(process.cwd(), './database.db?timezone=+08:00'), function(err, db) { orm.connect("sqlite://" + path.resolve(process.cwd(), './database.db'), function(err, db) { if (err) throw err; var Person = db.define("person", { uuid: {type: 'text', required: false}, date: {type: 'date',time: true}, }); console.log('current date:', new Date()); console.log('------'); db.sync(function() { Person.create({ uuid: 1, date: new Date() }, (err, p) => { console.log(JSON.stringify(p));// data from memory console.log('------'); Person.get(p.id, function(err, d) { console.log(JSON.stringify(d));// data from sqlite file }) }) }) })
Looks good, can you please add a test?
Test suit have been added, thanks for review
Thanks. I've published 4.0.2 with the fix.
4.0.2
Welcome
sample test js script