Skip to content

Commit

Permalink
prepare -> query
Browse files Browse the repository at this point in the history
  • Loading branch information
nikeee committed Feb 27, 2024
1 parent e38b4b3 commit 0a6bfee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/api/sqlite.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ db.defineFunction(
(name, age) => "Me" + "o".repeat(name.length) + "w".repeat(age),
);

db.prepare("SELECT getMeow(name, age) AS sound FROM cats");
db.query("SELECT getMeow(name, age) AS sound FROM cats");
```

If the function is deterministic (which means that the function always returns the same result on the same inputs), you can tell SQLite about that. This enables SQLite to perform additional optimizations in some cases:
Expand All @@ -423,9 +423,9 @@ db.defineFunction(
},
(...args) => args.join(","),
);
db.prepare("SELECT joinWithComma(name) AS sound FROM cats");
db.prepare("SELECT joinWithComma(name, age) AS sound FROM cats");
db.prepare("SELECT joinWithComma(id, name, age) AS sound FROM cats");
db.query("SELECT joinWithComma(name) AS sound FROM cats");
db.query("SELECT joinWithComma(name, age) AS sound FROM cats");
db.query("SELECT joinWithComma(id, name, age) AS sound FROM cats");
```

## Reference
Expand Down

0 comments on commit 0a6bfee

Please sign in to comment.