File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/content/docs/d1/build-with-d1 Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ D1 client API supports prepared and static statements. Best practice is to use p
1414Below is an example of a prepared statement:
1515
1616``` js
17- const stmt = db .prepare (" SELECT * FROM users WHERE name = ?1" ).bind (" Joe" );
17+ const stmt = db .prepare (` SELECT * FROM users WHERE name = ?1` ).bind (" Joe" );
1818```
1919
2020However, if you still choose to use a static statement you can use the following as an example:
@@ -30,7 +30,7 @@ You can pass multiple queries through `db.prepare()`.
3030You can pass multiple queries into a single ` .prepare() ` statement. Simply delineate each query with a semi-colon.
3131
3232``` js
33- const stmt = db .prepare (" SELECT * FROM users WHERE name = " Anthony" ; SELECT * FROM users WHERE name = ?1" ).bind (" Joe" )
33+ const stmt = db .prepare (` SELECT * FROM users WHERE name = "Anthony"; SELECT * FROM users WHERE name = ?1` ).bind (" Joe" )
3434```
3535
3636Note the following restrictions when passing multiple queries:
You can’t perform that action at this time.
0 commit comments