import { Message, proto3, type BinaryReadOptions, type FieldList, type JsonReadOptions, type JsonValue, type PartialMessage, type PlainMessage } from '@bufbuild/protobuf'; import { QueryResult } from './query_pb.js'; import { RPCError } from './vtrpc_pb.js'; /** * enumcheck:exhaustive * * @generated from enum psdbconnect.v1alpha1.TabletType */ export declare enum TabletType { /** * REPLICA replicates from primary. It is used to serve live traffic. * A REPLICA can be promoted to PRIMARY. A demoted PRIMARY will go to REPLICA. * * @generated from enum value: replica = 0; */ replica = 0, /** * PRIMARY is the primary server for the shard. Only PRIMARY allows DMLs. * * @generated from enum value: primary = 1; */ primary = 1, /** * BATCH is used to serve traffic for * long-running jobs. It is a separate type from REPLICA so * long-running queries don't affect web-like traffic. * * @generated from enum value: batch = 2; */ batch = 2 } /** * SyncRequest sets up the Sync session for a specific table in a keyspace, shard. * * @generated from message psdbconnect.v1alpha1.SyncRequest */ export declare class SyncRequest extends Message { /** * The table name to Sync * * @generated from field: string table_name = 1; */ tableName: string; /** * Any known state of the table from the last time a sync was run. * * @generated from field: psdbconnect.v1alpha1.TableCursor cursor = 2; */ cursor?: TableCursor; /** * Tablet to stream data from * * @generated from field: psdbconnect.v1alpha1.TabletType tablet_type = 3; */ tabletType: TabletType; /** * If true, any new data inserted into the table in table_name will be sent in the Sync session. * * @generated from field: bool include_inserts = 4; */ includeInserts: boolean; /** * If true, any updates to data in the table in table_name will be sent in the Sync session. * * @generated from field: bool include_updates = 5; */ includeUpdates: boolean; /** * If true, any deletes to data in the table in table_name will be sent in the Sync session. * * @generated from field: bool include_deletes = 6; */ includeDeletes: boolean; /** * A list of columns to include in the data from the table, an empty array means all columns. * If a column is referenced here that isn't in the table's schema, the SyncRequest will fail. * * @generated from field: repeated string columns = 7; */ columns: string[]; /** * if specified, these cells are used to pick source tablets from. * defaults to the cell of the vtgate serving the VStream API. * * @generated from field: repeated string cells = 8; */ cells: string[]; constructor(data?: PartialMessage); static readonly runtime: typeof proto3; static readonly typeName = "psdbconnect.v1alpha1.SyncRequest"; static readonly fields: FieldList; static fromBinary(bytes: Uint8Array, options?: Partial): SyncRequest; static fromJson(jsonValue: JsonValue, options?: Partial): SyncRequest; static fromJsonString(jsonString: string, options?: Partial): SyncRequest; static equals(a: SyncRequest | PlainMessage | undefined, b: SyncRequest | PlainMessage | undefined): boolean; } /** * DeletedRow denotes a row that is deleted from the table referenced in the SyncRequest * * @generated from message psdbconnect.v1alpha1.DeletedRow */ export declare class DeletedRow extends Message { /** * This result will contain only the primary keys from the deleted row. * * @generated from field: query.QueryResult result = 1; */ result?: QueryResult; constructor(data?: PartialMessage); static readonly runtime: typeof proto3; static readonly typeName = "psdbconnect.v1alpha1.DeletedRow"; static readonly fields: FieldList; static fromBinary(bytes: Uint8Array, options?: Partial): DeletedRow; static fromJson(jsonValue: JsonValue, options?: Partial): DeletedRow; static fromJsonString(jsonString: string, options?: Partial): DeletedRow; static equals(a: DeletedRow | PlainMessage | undefined, b: DeletedRow | PlainMessage | undefined): boolean; } /** * Updated denotes a row that is updated in the table referenced in the SyncRequest * * @generated from message psdbconnect.v1alpha1.UpdatedRow */ export declare class UpdatedRow extends Message { /** * All values of the table before the update was made. * * @generated from field: query.QueryResult before = 1; */ before?: QueryResult; /** * All values of the table ater the update was made. * * @generated from field: query.QueryResult after = 2; */ after?: QueryResult; constructor(data?: PartialMessage); static readonly runtime: typeof proto3; static readonly typeName = "psdbconnect.v1alpha1.UpdatedRow"; static readonly fields: FieldList; static fromBinary(bytes: Uint8Array, options?: Partial): UpdatedRow; static fromJson(jsonValue: JsonValue, options?: Partial): UpdatedRow; static fromJsonString(jsonString: string, options?: Partial): UpdatedRow; static equals(a: UpdatedRow | PlainMessage | undefined, b: UpdatedRow | PlainMessage | undefined): boolean; } /** * SyncResponse denotes a response to the SyncRequest * * @generated from message psdbconnect.v1alpha1.SyncResponse */ export declare class SyncResponse extends Message { /** * An array of rows that denote inserts into the table. * * @generated from field: repeated query.QueryResult result = 1; */ result: QueryResult[]; /** * A state object to use that denotes the current state of the SyncResponse. * * @generated from field: psdbconnect.v1alpha1.TableCursor cursor = 2; */ cursor?: TableCursor; /** * Any errors encountered in streaming data from the table. * * @generated from field: vtrpc.RPCError error = 3; */ error?: RPCError; /** * An array of rows that denote deletes from the table. * * @generated from field: repeated psdbconnect.v1alpha1.DeletedRow deletes = 4; */ deletes: DeletedRow[]; /** * An array of rows that denote updates to the table. * * @generated from field: repeated psdbconnect.v1alpha1.UpdatedRow updates = 5; */ updates: UpdatedRow[]; constructor(data?: PartialMessage); static readonly runtime: typeof proto3; static readonly typeName = "psdbconnect.v1alpha1.SyncResponse"; static readonly fields: FieldList; static fromBinary(bytes: Uint8Array, options?: Partial): SyncResponse; static fromJson(jsonValue: JsonValue, options?: Partial): SyncResponse; static fromJsonString(jsonString: string, options?: Partial): SyncResponse; static equals(a: SyncResponse | PlainMessage | undefined, b: SyncResponse | PlainMessage | undefined): boolean; } /** * TableCursor denotes state of a Sync request to a table. * This type can be round-tripped in a SyncRequest to pickup where the last Sync session left off. * * @generated from message psdbconnect.v1alpha1.TableCursor */ export declare class TableCursor extends Message { /** * The shard to sync data from. * * @generated from field: string shard = 1; */ shard: string; /** * Keyspace within a shard where the table resides. * * @generated from field: string keyspace = 2; */ keyspace: string; /** * Any known vgtid positions from the last a previous session. * If this value is empty, the Sync request is treated as a request to * download all data within a table in a shard. * If this value is invalid, i.e. incorrect format or the binlogs have been purged, * the SyncRequest will fail. * * @generated from field: string position = 3; */ position: string; /** * Any known last known primary key values from the a previous session. * * @generated from field: query.QueryResult last_known_pk = 4; */ lastKnownPk?: QueryResult; constructor(data?: PartialMessage); static readonly runtime: typeof proto3; static readonly typeName = "psdbconnect.v1alpha1.TableCursor"; static readonly fields: FieldList; static fromBinary(bytes: Uint8Array, options?: Partial): TableCursor; static fromJson(jsonValue: JsonValue, options?: Partial): TableCursor; static fromJsonString(jsonString: string, options?: Partial): TableCursor; static equals(a: TableCursor | PlainMessage | undefined, b: TableCursor | PlainMessage | undefined): boolean; }