db/db_test.js

20 lines
539 B
JavaScript

import db from 'apigo.cc/gojs/db'
function main(testUserName) {
db.setDefault('sqlite://test.db')
db.make(`
User // {api} {select:isValid=1}
id i AI
name v100 // [i]
password v100 // [p] {-}
age i // [n]
sex v10 // [s:Female,Male]
memo t // [t]
isValid b // [c]
version ubi //
`)
db.insert('User', { name: testUserName })
let user = db.query1('SELECT * FROM User').result
return user
}