dbdts.db
import { Column, ColumnDataType, Database, Table } from "..";
const db = new Database()
const table = new Table("users")
.addColumns(
[
new Column()
.setName('id')
.setPrimary(true)
.setType(ColumnDataType.TEXT),
new Column()
.setName('swords')
.setType(ColumnDataType.INTEGER)
.setDefault(0),
new Column()
.setName('json')
.setType(ColumnDataType.JSON)
]
)
db.addTable(table)
db.once("ready", () => {
const data = {
id: '1',
swords: 5
}
db.insert("users", data)
db.set("users", {
json: {
set: {
bool: true
}
}
}, {
column: 'id',
equals: '1'
})
console.log(
db.get("users", '1')
)
})
db.connect()