docs: better example

This commit is contained in:
2020-01-26 16:06:06 +01:00
parent f23d4ed496
commit e239ac2b7f
2 changed files with 6 additions and 4 deletions

View File

@@ -43,8 +43,9 @@ databases.</p>
; ignore that
(let-do [db (Result.unsafe-from-success (SQLite3.open &quot;db&quot;))]
; we can prepare statements
(println* &amp;(SQLite3.query &amp;db &quot;INSERT INTO mytable VALUES (?1, ?2);&quot;
&amp;[(to-sqlite3 @&quot;hello&quot;) (to-sqlite3 100)]))
(ignore
(SQLite3.query &amp;db &quot;INSERT INTO mytable VALUES (?1, ?2);&quot;
&amp;[(to-sqlite3 @&quot;hello&quot;) (to-sqlite3 100)]))
; and query things
(println* &amp;(SQLite3.query &amp;db &quot;SELECT * from mytable;&quot; &amp;[]))
(SQLite3.close db)

View File

@@ -22,8 +22,9 @@ databases.
; ignore that
(let-do [db (Result.unsafe-from-success (SQLite3.open \"db\"))]
; we can prepare statements
(println* &(SQLite3.query &db \"INSERT INTO mytable VALUES (?1, ?2);\"
&[(to-sqlite3 @\"hello\") (to-sqlite3 100)]))
(ignore
(SQLite3.query &db \"INSERT INTO mytable VALUES (?1, ?2);\"
&[(to-sqlite3 @\"hello\") (to-sqlite3 100)]))
; and query things
(println* &(SQLite3.query &db \"SELECT * from mytable;\" &[]))
(SQLite3.close db)