You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
D1 client API supports prepared and static statements. The best practice is to use prepared statements (which are precompiled objects used by the database) to run the SQL. Prepared statements lead to faster overall execution and prevent SQL injection attacks.
13
-
14
-
Below is an example of a prepared statement:
15
-
16
-
```js
17
-
conststmt=db.prepare("SELECT * FROM users WHERE name = ?1").bind("Joe");
18
-
```
19
-
20
-
However, if you still choose to use a static statement you can use the following as an example:
21
-
22
-
```js
23
-
conststmt=db.prepare('SELECT * FROM users WHERE name = "John Doe"');
24
-
```
25
-
26
-
You can subsequently combine the statements with the methods listed below.
12
+
You can manipulate the query results which has been obtained after executing a `.db()` method.
D1 client API supports both prepared and static statements. The best practice is to use prepared statements (which are precompiled objects used by the database) to run the SQL. Prepared statements lead to faster overall execution and prevent SQL injection attacks.
13
+
14
+
Below is an example of a prepared statement:
15
+
16
+
```js
17
+
conststmt=db.prepare("SELECT * FROM users WHERE name = ?1").bind("Joe");
18
+
```
19
+
20
+
However, if you still choose to use a static statement you can use the following as an example:
21
+
22
+
```js
23
+
conststmt=db.prepare('SELECT * FROM users WHERE name = "John Doe"');
0 commit comments