Sites: add an owner-authorized SQL import path for managed D1 bindings
Summary
Sites can provision and bind a managed D1 database to an existing private site, but the current Sites connector exposes only bounded read operations for that database. There is no supported connector operation to execute approved SQL or import an SQL file into the managed D1 binding.
Reproduction
- Use an existing private Sites project with a D1 binding declared in
.openai/hosting.json. - Confirm the site and D1 binding can be read through the Sites connector.
- Attempt to seed a production-ready lexical index from a generated SQL artifact (about 45 MB).
- The available connector actions permit database overview and bounded row reads, but provide no remote SQL execution or SQL-file import action.
Expected behavior
Provide a safe, explicit, owner-authorized path to import an SQL file into a Sites-managed D1 binding, with progress/status reporting and a read-only verification path afterward.
Actual behavior
The only practical alternatives appear to be migrating the application to a separately self-managed Cloudflare account/database or modifying application source to perform a one-off seed. Both are disproportionate for an otherwise managed Sites deployment and make an exact release deployment harder to preserve.
Why this matters
Managed D1 is useful for applications with prebuilt indexes, reference data, or other substantial static datasets. A bounded import capability would allow these apps to remain on Sites without exposing credentials or adding a temporary runtime backdoor.
Requested capability
A connector/API action such as import_d1_sql(project_id, binding_name, file), limited to authorized project owners, plus deployment-safe read-only count/query verification.