export type DataType = "int" | "uint" | "u_int" | "float" | "timestamp" | "interval" | "boolean" | "string" | "binary" | "array" | "object" | "any" | "null"; export interface FieldSchemaPayload { name: string; data_type: DataType; } export interface ResultSetMetadata { fields: FieldSchemaPayload[]; num_rows: number; } export type ResultFormat = "json"; export interface StatementResultSet { metadata: ResultSetMetadata; format: ResultFormat; rows: Array>; } export interface StatementProgress { total_stages: number; total_partitions: number; total_rows: number; total_compressed_bytes: number; total_uncompressed_bytes: number; scanned_stages: number; scanned_partitions: number; scanned_rows: number; scanned_compressed_bytes: number; scanned_uncompressed_bytes: number; skipped_partitions: number; skipped_rows: number; skipped_compressed_bytes: number; skipped_uncompressed_bytes: number; } export interface StatementEstimatedProgress extends StatementProgress { total_percentage: number; nanos_from_submitted: number; nanos_from_started: number; } interface StatementStatusBase { statement_id: string; created_at: string; progress: StatementEstimatedProgress; } export interface StatementStatusPending extends StatementStatusBase { status: "pending"; } export interface StatementStatusRunning extends StatementStatusBase { status: "running"; } export interface StatementStatusFinished extends StatementStatusBase { status: "finished"; result_set: StatementResultSet; } export interface StatementStatusFailed extends StatementStatusBase { status: "failed"; message: string; } export interface StatementStatusCancelled extends StatementStatusBase { status: "cancelled"; message: string; } export type StatementStatus = StatementStatusPending | StatementStatusRunning | StatementStatusFinished | StatementStatusFailed | StatementStatusCancelled; export interface StatementRequest { statement: string; statement_id?: string; exec_timeout?: string; max_parallelism?: number; format: ResultFormat; } export interface StatementCancelResult { statement_id: string; status: "finished" | "failed" | "cancelled"; message: string; created_at: string; } export type IngestType = "committed" | "buffered"; export interface IngestRequest { type: IngestType; data: { format: "json"; rows: string; }; statement: string; } export interface IngestResult { num_rows_inserted: number; } export type AppendState = "committed" | "rejected" | "unknown"; export interface AppendRowsResult { append_state: "committed"; num_rows_inserted: number; } export interface AppendRowError { row_index: number; column: string; message: string; } export interface AppendRowsErrorPayload { message: string; append_state: Exclude; row_errors: AppendRowError[]; row_errors_truncated: boolean; } export interface CatalogPage { items: T[]; next_page_token?: string; } export interface DatabaseResource { name: string; comment: string | null; } export interface SchemaResource { database: string; name: string; comment: string | null; } export interface TableResourceSummary { database: string; schema: string; name: string; comment: string | null; } export interface TableColumnSpec { name: string; data_type: Exclude; comment: string | null; } export interface TableDistinctSpec { on: string[]; by: string[]; } export interface TableSpec { columns: TableColumnSpec[]; partition_by: string[]; cluster_by: string[]; distinct_on: TableDistinctSpec; data_retention_days: number | null; comment: string | null; } export interface TableResource extends TableResourceSummary, TableSpec { } export interface ErrorPayload { message: string; } export declare function statementIsFinished(status: StatementStatus): status is StatementStatusFinished; export declare function statementIsTerminated(status: StatementStatus): boolean; export {}; //# sourceMappingURL=protocol.d.ts.map