docs: better example
This commit is contained in:
@@ -43,7 +43,8 @@ databases.</p>
|
|||||||
; ignore that
|
; ignore that
|
||||||
(let-do [db (Result.unsafe-from-success (SQLite3.open "db"))]
|
(let-do [db (Result.unsafe-from-success (SQLite3.open "db"))]
|
||||||
; we can prepare statements
|
; we can prepare statements
|
||||||
(println* &(SQLite3.query &db "INSERT INTO mytable VALUES (?1, ?2);"
|
(ignore
|
||||||
|
(SQLite3.query &db "INSERT INTO mytable VALUES (?1, ?2);"
|
||||||
&[(to-sqlite3 @"hello") (to-sqlite3 100)]))
|
&[(to-sqlite3 @"hello") (to-sqlite3 100)]))
|
||||||
; and query things
|
; and query things
|
||||||
(println* &(SQLite3.query &db "SELECT * from mytable;" &[]))
|
(println* &(SQLite3.query &db "SELECT * from mytable;" &[]))
|
||||||
|
@@ -22,7 +22,8 @@ databases.
|
|||||||
; ignore that
|
; ignore that
|
||||||
(let-do [db (Result.unsafe-from-success (SQLite3.open \"db\"))]
|
(let-do [db (Result.unsafe-from-success (SQLite3.open \"db\"))]
|
||||||
; we can prepare statements
|
; we can prepare statements
|
||||||
(println* &(SQLite3.query &db \"INSERT INTO mytable VALUES (?1, ?2);\"
|
(ignore
|
||||||
|
(SQLite3.query &db \"INSERT INTO mytable VALUES (?1, ?2);\"
|
||||||
&[(to-sqlite3 @\"hello\") (to-sqlite3 100)]))
|
&[(to-sqlite3 @\"hello\") (to-sqlite3 100)]))
|
||||||
; and query things
|
; and query things
|
||||||
(println* &(SQLite3.query &db \"SELECT * from mytable;\" &[]))
|
(println* &(SQLite3.query &db \"SELECT * from mytable;\" &[]))
|
||||||
|
Reference in New Issue
Block a user