4.4.1 • Published 2 years ago
dbdts.db v4.4.1
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) // Insert the data into a row in the database.
db.set("users", {
json: {
set: {
bool: true
}
}
}, {
column: 'id',
equals: '1'
}) // Set json value
console.log(
db.get("users", '1')
) // Get data back
})
db.connect()
4.4.1
2 years ago
4.4.0
2 years ago
4.3.0
2 years ago
4.1.0
2 years ago
4.0.1
2 years ago
4.0.0
2 years ago
4.2.0
2 years ago
3.7.0
3 years ago
3.5.0
3 years ago
3.4.0
3 years ago
3.4.1
3 years ago
3.3.2
3 years ago
3.3.1
3 years ago
3.3.0
3 years ago
3.2.6
3 years ago
3.2.5
3 years ago
3.2.0
3 years ago
3.0.3
3 years ago
3.0.2
3 years ago
3.1.0
3 years ago
3.0.1
3 years ago
3.0.0
3 years ago
2.0.2
3 years ago
1.0.0
3 years ago
2.0.1
3 years ago
7.0.0
3 years ago