Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -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
22 changes: 22 additions & 0 deletions src/resources/d1/d1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -45,6 +48,11 @@ export interface D1 {

num_tables?: number;

/**
* Configuration for D1 read replication.
*/
read_replication?: D1.ReadReplication;

/**
* D1 database identifier (UUID).
*/
Expand All @@ -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;
Expand Down
159 changes: 159 additions & 0 deletions src/resources/d1/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down Expand Up @@ -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;
}
}
}
}
Expand All @@ -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 {
Expand Down