Database
List D1 Databases
Get D1 Database
Create D1 Database
Update D1 Database
Update D1 Database partially
Delete D1 Database
Query D1 Database
Raw D1 Database query
Export D1 Database as SQL
Import SQL into your D1 Database
ModelsExpand Collapse
QueryResult { meta, results, success }
meta: optional { changed_db, changes, duration, 8 more }
Denotes if the database has been altered in some way, like deleting rows.
Rough indication of how many rows were modified by the query, as provided by SQLite’s sqlite3_total_changes().
The duration of the SQL query execution inside the database. Does not include any network communication.
The row ID of the last inserted row in a table with an INTEGER PRIMARY KEY as provided by SQLite. Tables created with WITHOUT ROWID do not populate this.
Number of rows read during the SQL query execution, including indices (not all rows are necessarily returned).
Number of rows written during the SQL query execution, including indices.
Denotes if the query has been handled by the database primary instance.
DatabaseListResponse { created_at, jurisdiction, name, 2 more }
DatabaseRawResponse { meta, results, success }
meta: optional { changed_db, changes, duration, 8 more }
Denotes if the database has been altered in some way, like deleting rows.
Rough indication of how many rows were modified by the query, as provided by SQLite’s sqlite3_total_changes().
The duration of the SQL query execution inside the database. Does not include any network communication.
The row ID of the last inserted row in a table with an INTEGER PRIMARY KEY as provided by SQLite. Tables created with WITHOUT ROWID do not populate this.
Number of rows read during the SQL query execution, including indices (not all rows are necessarily returned).
Number of rows written during the SQL query execution, including indices.
Denotes if the query has been handled by the database primary instance.
DatabaseImportResponse { at_bookmark, error, filename, 6 more }
The current time-travel bookmark for your D1, used to poll for updates. Will not change for the duration of the import. Only returned if an import process is currently running or recently finished.
Only present when status = ‘error’. Contains the error message that prevented the import from succeeding.
Derived from the database ID and etag, to use in avoiding repeated uploads. Only returned when for the ‘init’ action.
result: optional { final_bookmark, meta, num_queries } Only present when status = ‘complete’
Only present when status = ‘complete’
The time-travel bookmark if you need restore your D1 to directly after the import succeeded.
meta: optional { changed_db, changes, duration, 8 more }
Denotes if the database has been altered in some way, like deleting rows.
Rough indication of how many rows were modified by the query, as provided by SQLite’s sqlite3_total_changes().
The duration of the SQL query execution inside the database. Does not include any network communication.
The row ID of the last inserted row in a table with an INTEGER PRIMARY KEY as provided by SQLite. Tables created with WITHOUT ROWID do not populate this.
Number of rows read during the SQL query execution, including indices (not all rows are necessarily returned).
Number of rows written during the SQL query execution, including indices.
Denotes if the query has been handled by the database primary instance.