UNPKG

@ceramic-sdk/flight-sql-client

Version:

A FlightSQL client. Currently only supports Node.js

94 lines (91 loc) 3.35 kB
/* tslint:disable */ /* eslint-disable */ /* auto-generated by NAPI-RS */ /** A ':' separated key value pair */ export interface KeyValue { key: string value: string } export interface ClientOptions { /** * Additional headers. * * Values should be key value pairs separated by ':' */ headers: Array<KeyValue> /** Username */ username?: string /** Password */ password?: string /** Auth token. */ token?: string /** Use TLS. */ tls: boolean /** Server host. */ host: string /** Server port. */ port?: number } export declare function createFlightSqlClient(options: ClientOptions): Promise<FlightSqlClient> export declare function rustCrateVersion(): string export interface GetDbSchemasOptions { /** * Specifies the Catalog to search for the tables. * An empty string retrieves those without a catalog. * If omitted the catalog name should not be used to narrow the search. */ catalog?: string /** * Specifies a filter pattern for schemas to search for. * When no db_schema_filter_pattern is provided, the pattern will not be used to narrow the search. * In the pattern string, two special characters can be used to denote matching rules: * - "%" means to match any substring with 0 or more characters. * - "_" means to match any one character. */ dbSchemaFilterPattern?: string } export interface GetTablesOptions { /** * Specifies the Catalog to search for the tables. * An empty string retrieves those without a catalog. * If omitted the catalog name should not be used to narrow the search. */ catalog?: string /** * Specifies a filter pattern for schemas to search for. * When no db_schema_filter_pattern is provided, the pattern will not be used to narrow the search. * In the pattern string, two special characters can be used to denote matching rules: * - "%" means to match any substring with 0 or more characters. * - "_" means to match any one character. */ dbSchemaFilterPattern?: string /** * Specifies a filter pattern for tables to search for. * When no table_name_filter_pattern is provided, all tables matching other filters are searched. * In the pattern string, two special characters can be used to denote matching rules: * - "%" means to match any substring with 0 or more characters. * - "_" means to match any one character. */ tableNameFilterPattern?: string /** * Specifies a filter of table types which must match. * The table types depend on vendor/implementation. * It is usually used to separate tables from views or system tables. * TABLE, VIEW, and SYSTEM TABLE are commonly supported. */ tableTypes?: Array<string> /** Specifies if the Arrow schema should be returned for found tables. */ includeSchema?: boolean } export declare class FeedQuery { next(): Promise<Buffer | null> } export declare class FlightSqlClient { query(query: string): Promise<Buffer> feedQuery(query: string): Promise<FeedQuery> preparedQuery(query: string, params: Array<[string, string]>): Promise<Buffer> preparedFeedQuery(query: string, params: Array<[string, string]>): Promise<FeedQuery> getCatalogs(): Promise<Buffer> getDbSchemas(options: GetDbSchemasOptions): Promise<Buffer> getTables(options: GetTablesOptions): Promise<Buffer> }