diff --git a/.stats.yml b/.stats.yml index cbcb9c2720..e6c6af12af 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1707 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-be6e76cbd3107968355eb2201def84211f0db684c96538904a871f8da9d0f992.yml -openapi_spec_hash: b96b6fb0e5b4dcfeacff17e803b1088d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3e03f71406670e2384aa5c3bf2bea707a896e4957b4ec5f9427182fbaa0f85b4.yml +openapi_spec_hash: 40d67d20dcbb7925f96d686d41ad2916 config_hash: e30b863eac83985d5919f958f3cd8993 diff --git a/src/resources/d1/d1.ts b/src/resources/d1/d1.ts index 536a62b2eb..9f8cd46d42 100644 --- a/src/resources/d1/d1.ts +++ b/src/resources/d1/d1.ts @@ -27,6 +27,9 @@ export class D1Resource extends APIResource { database: DatabaseAPI.Database = new DatabaseAPI.Database(this._client); } +/** + * The details of the D1 database. + */ export interface D1 { /** * Specifies the timestamp the resource was created as an ISO8601 string. @@ -45,6 +48,11 @@ export interface D1 { num_tables?: number; + /** + * Configuration for D1 read replication. + */ + read_replication?: D1.ReadReplication; + /** * D1 database identifier (UUID). */ @@ -53,6 +61,20 @@ export interface D1 { version?: string; } +export namespace D1 { + /** + * Configuration for D1 read replication. + */ + export interface ReadReplication { + /** + * The read replication mode for the database. Use 'auto' to create replicas and + * allow D1 automatically place them around the world, or 'disabled' to not use any + * database replicas (it can take a few hours for all replicas to be deleted). + */ + mode: 'auto' | 'disabled'; + } +} + D1Resource.Database = Database; D1Resource.DatabaseListResponsesV4PagePaginationArray = DatabaseListResponsesV4PagePaginationArray; D1Resource.QueryResultsSinglePage = QueryResultsSinglePage; diff --git a/src/resources/d1/database.ts b/src/resources/d1/database.ts index 2cfce2c038..8d19c54530 100644 --- a/src/resources/d1/database.ts +++ b/src/resources/d1/database.ts @@ -154,19 +154,72 @@ export interface QueryResult { export namespace QueryResult { export interface Meta { + /** + * Denotes if the database has been altered in some way, like deleting rows. + */ changed_db?: boolean; + /** + * Rough indication of how many rows were modified by the query, as provided by + * SQLite's `sqlite3_total_changes()`. + */ changes?: number; + /** + * The duration of the SQL query execution inside the database. Does not include + * any network communication. + */ duration?: number; + /** + * 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. + */ last_row_id?: number; + /** + * Number of rows read during the SQL query execution, including indices (not all + * rows are necessarily returned). + */ rows_read?: number; + /** + * Number of rows written during the SQL query execution, including indices. + */ rows_written?: number; + /** + * Denotes if the query has been handled by the database primary instance. + */ + served_by_primary?: boolean; + + /** + * Region location hint of the database instance that handled the query. + */ + served_by_region?: 'WNAM' | 'ENAM' | 'WEUR' | 'EEUR' | 'APAC' | 'OC'; + + /** + * Size of the database after the query committed, in bytes. + */ size_after?: number; + + /** + * Various durations for the query. + */ + timings?: Meta.Timings; + } + + export namespace Meta { + /** + * Various durations for the query. + */ + export interface Timings { + /** + * The duration of the SQL query execution inside the database. Does not include + * any network communication. + */ + sql_duration_ms?: number; + } } } @@ -301,19 +354,72 @@ export namespace DatabaseImportResponse { export namespace Result { export interface Meta { + /** + * Denotes if the database has been altered in some way, like deleting rows. + */ changed_db?: boolean; + /** + * Rough indication of how many rows were modified by the query, as provided by + * SQLite's `sqlite3_total_changes()`. + */ changes?: number; + /** + * The duration of the SQL query execution inside the database. Does not include + * any network communication. + */ duration?: number; + /** + * 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. + */ last_row_id?: number; + /** + * Number of rows read during the SQL query execution, including indices (not all + * rows are necessarily returned). + */ rows_read?: number; + /** + * Number of rows written during the SQL query execution, including indices. + */ rows_written?: number; + /** + * Denotes if the query has been handled by the database primary instance. + */ + served_by_primary?: boolean; + + /** + * Region location hint of the database instance that handled the query. + */ + served_by_region?: 'WNAM' | 'ENAM' | 'WEUR' | 'EEUR' | 'APAC' | 'OC'; + + /** + * Size of the database after the query committed, in bytes. + */ size_after?: number; + + /** + * Various durations for the query. + */ + timings?: Meta.Timings; + } + + export namespace Meta { + /** + * Various durations for the query. + */ + export interface Timings { + /** + * The duration of the SQL query execution inside the database. Does not include + * any network communication. + */ + sql_duration_ms?: number; + } } } } @@ -328,19 +434,72 @@ export interface DatabaseRawResponse { export namespace DatabaseRawResponse { export interface Meta { + /** + * Denotes if the database has been altered in some way, like deleting rows. + */ changed_db?: boolean; + /** + * Rough indication of how many rows were modified by the query, as provided by + * SQLite's `sqlite3_total_changes()`. + */ changes?: number; + /** + * The duration of the SQL query execution inside the database. Does not include + * any network communication. + */ duration?: number; + /** + * 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. + */ last_row_id?: number; + /** + * Number of rows read during the SQL query execution, including indices (not all + * rows are necessarily returned). + */ rows_read?: number; + /** + * Number of rows written during the SQL query execution, including indices. + */ rows_written?: number; + /** + * Denotes if the query has been handled by the database primary instance. + */ + served_by_primary?: boolean; + + /** + * Region location hint of the database instance that handled the query. + */ + served_by_region?: 'WNAM' | 'ENAM' | 'WEUR' | 'EEUR' | 'APAC' | 'OC'; + + /** + * Size of the database after the query committed, in bytes. + */ size_after?: number; + + /** + * Various durations for the query. + */ + timings?: Meta.Timings; + } + + export namespace Meta { + /** + * Various durations for the query. + */ + export interface Timings { + /** + * The duration of the SQL query execution inside the database. Does not include + * any network communication. + */ + sql_duration_ms?: number; + } } export interface Results {