Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit 6126b55

Browse files
committed
update all examples to show the ?NNN form of paramter binding
1 parent c8952e4 commit 6126b55

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Pass the `bind` option to bind parameterized queries.
3838
Sqlitex.with_db('test/fixtures/golfscores.sqlite3', fn(db) ->
3939
Sqlitex.query(
4040
db,
41-
"INSERT INTO players (name, created_at, updated_at) VALUES ($1, $2, $3, $4)",
41+
"INSERT INTO players (name, created_at, updated_at) VALUES (?1, ?2, ?3, ?4)",
4242
bind: ['Mikey', '2012-10-14 05:46:28.318107', '2013-09-06 22:29:36.610911'])
4343
end)
4444
# => [[id: 1, name: "Mikey", created_at: {{2012,10,14},{05,46,28}}, updated_at: {{2013,09,06},{22,29,36}}, type: nil]]
@@ -52,13 +52,13 @@ children = [
5252
# Start the endpoint when the application starts
5353
worker(Golf.Endpoint, []),
5454

55-
worker(Sqlitex.Server, ['golf.sqlite3', [name: Sqlitex.Server]])
55+
worker(Sqlitex.Server, ['golf.sqlite3', [name: Golf.DB]])
5656
]
5757
```
5858

5959
Now that the GenServer is running you can make queries via
6060
```elixir
61-
Sqlitex.Server.query(Sqlitex.Server,
61+
Sqlitex.Server.query(Golf.DB,
6262
"SELECT g.id, g.course_id, g.played_at, c.name AS course
6363
FROM games AS g
6464
INNER JOIN courses AS c ON g.course_id = c.id

0 commit comments

Comments
 (0)