Skip to content

Commit

Permalink
doc: add prepare example.
Browse files Browse the repository at this point in the history
  • Loading branch information
smeghead committed Apr 24, 2024
1 parent 87f46e9 commit 73e6eb9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ phel-lang pdo wrapper library.
This is an example of connecting to a file database, creating a table, inserting records, and searching on repl.

```
iphel:1> (require smeghead\pdo)
phel:1> (require smeghead\pdo)
smeghead\pdo
phel:2> (require smeghead\pdo\statement)
smeghead\pdo\statement
Expand All @@ -23,6 +23,12 @@ phel:7> (def stmt (pdo/query conn "select * from t1 where id = 1"))
1
phel:8> (statement/fetch stmt)
{:id 1 :name phel}
phel:8> (def stmt (pdo/prepare conn "select * from t1 where id = :id"))
1
phel:9> (def stmt (statement/execute stmt {:id 1}))
1
phel:10> (statement/fetch stmt)
{:id 1 :name phel}
```


Expand Down

0 comments on commit 73e6eb9

Please sign in to comment.