Skip to content

Commit

Permalink
Merge pull request #2722 from cloudflare/kenton/no-prepared
Browse files Browse the repository at this point in the history
Un-ship SQL prepared statements.
  • Loading branch information
kentonv authored Sep 17, 2024
2 parents d1a7d6e + f1a25eb commit c70a208
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/workerd/api/sql-test.wd-test
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const config :Workerd.Config = (
const mainWorker :Workerd.Worker = (
compatibilityDate = "2024-03-04",

# "experimental" flag is needed to test `sql.ingest()`
# "experimental" flag is needed to test `sql.ingest()` and `sql.prepare()`.
compatibilityFlags = ["experimental", "nodejs_compat"],

modules = [
Expand Down
7 changes: 6 additions & 1 deletion src/workerd/api/sql.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ class SqlStorage final: public jsg::Object, private SqliteDatabase::Regulator {

JSG_RESOURCE_TYPE(SqlStorage, CompatibilityFlags::Reader flags) {
JSG_METHOD(exec);
JSG_METHOD(prepare);

// Prepared statement API is experimental-only and deprecated. exec() will automatically
// handle caching prepared statements, so apps don't need to worry about it.
if (flags.getWorkerdExperimental()) {
JSG_METHOD(prepare);
}

// Make sure that the 'ingest' function is still experimental-only if and when
// the SQL API becomes publicly available.
Expand Down

0 comments on commit c70a208

Please sign in to comment.