feat: add forum Nim client improvements and SQLite adaptor
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import baradb_sqlite
|
||||
|
||||
var db = open("127.0.0.1:9472", "", "", "default")
|
||||
|
||||
db.exec(sql"CREATE TABLE test_adapter (id INT PRIMARY KEY, name STRING)")
|
||||
db.exec(sql"INSERT INTO test_adapter (id, name) VALUES (1, 'hello')")
|
||||
db.exec(sql"INSERT INTO test_adapter (id, name) VALUES (2, 'world')")
|
||||
|
||||
let rows = db.getAllRows(sql"SELECT * FROM test_adapter")
|
||||
echo "All rows: ", rows
|
||||
|
||||
let row = db.getRow(sql"SELECT * FROM test_adapter WHERE id = 1")
|
||||
echo "Row 1: ", row
|
||||
|
||||
let val = db.getValue(sql"SELECT name FROM test_adapter WHERE id = 2")
|
||||
echo "Value: ", val
|
||||
|
||||
let cnt = db.getValue(sql"SELECT count(*) FROM test_adapter")
|
||||
echo "Count: ", cnt
|
||||
|
||||
db.close()
|
||||
Reference in New Issue
Block a user