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

View File

@@ -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;\" &[]))