@sqlrooms/room-config / DataSource
Type Alias: DataSource
DataSource = {
tableName:string;type:"file";fileName:string;loadOptions?: {[key:string]:unknown;schema?:string;select?:string[];where?:string;view?:boolean;temp?:boolean;replace?:boolean;options?:string|Record<string,unknown> |string[];method:"st_read"; } | {[key:string]:unknown;schema?:string;select?:string[];where?:string;view?:boolean;temp?:boolean;replace?:boolean;method:"read_json"|"read_ndjson"|"read_parquet"|"read_csv"|"auto"; }; } | {tableName:string;type:"url";url:string;loadOptions?: {[key:string]:unknown;schema?:string;select?:string[];where?:string;view?:boolean;temp?:boolean;replace?:boolean;options?:string|Record<string,unknown> |string[];method:"st_read"; } | {[key:string]:unknown;schema?:string;select?:string[];where?:string;view?:boolean;temp?:boolean;replace?:boolean;method:"read_json"|"read_ndjson"|"read_parquet"|"read_csv"|"auto"; };httpMethod?:string;headers?:Record<string,string>; } | {tableName:string;type:"sql";sqlQuery:string; }
Union type representing all possible data source configurations Discriminated union based on the 'type' field
Type Declaration
{ tableName: string; type: "file"; fileName: string; loadOptions?: {[key: string]: unknown; schema?: string; select?: string[]; where?: string; view?: boolean; temp?: boolean; replace?: boolean; options?: string | Record<string, unknown> | string[]; method: "st_read"; } | {[key: string]: unknown; schema?: string; select?: string[]; where?: string; view?: boolean; temp?: boolean; replace?: boolean; method: "read_json" | "read_ndjson" | "read_parquet" | "read_csv" | "auto"; }; }
| Name | Type | Description |
|---|---|---|
tableName | string | Unique table name used to store the data loaded from the data source. This name will be used to reference the data in SQL queries. |
type | "file" | - |
fileName | string | Path to the data file |
loadOptions? | {[key: string]: unknown; schema?: string; select?: string[]; where?: string; view?: boolean; temp?: boolean; replace?: boolean; options?: string | Record<string, unknown> | string[]; method: "st_read"; } | {[key: string]: unknown; schema?: string; select?: string[]; where?: string; view?: boolean; temp?: boolean; replace?: boolean; method: "read_json" | "read_ndjson" | "read_parquet" | "read_csv" | "auto"; } | Optional configuration for file loading |
{ tableName: string; type: "url"; url: string; loadOptions?: {[key: string]: unknown; schema?: string; select?: string[]; where?: string; view?: boolean; temp?: boolean; replace?: boolean; options?: string | Record<string, unknown> | string[]; method: "st_read"; } | {[key: string]: unknown; schema?: string; select?: string[]; where?: string; view?: boolean; temp?: boolean; replace?: boolean; method: "read_json" | "read_ndjson" | "read_parquet" | "read_csv" | "auto"; }; httpMethod?: string; headers?: Record<string, string>; }
| Name | Type | Description |
|---|---|---|
tableName | string | Unique table name used to store the data loaded from the data source. This name will be used to reference the data in SQL queries. |
type | "url" | - |
url | string | URL from which to fetch the data |
loadOptions? | {[key: string]: unknown; schema?: string; select?: string[]; where?: string; view?: boolean; temp?: boolean; replace?: boolean; options?: string | Record<string, unknown> | string[]; method: "st_read"; } | {[key: string]: unknown; schema?: string; select?: string[]; where?: string; view?: boolean; temp?: boolean; replace?: boolean; method: "read_json" | "read_ndjson" | "read_parquet" | "read_csv" | "auto"; } | Optional configuration for file loading |
httpMethod? | string | Optional HTTP method to use for the request |
headers? | Record<string, string> | Optional headers to include in the request |
{ tableName: string; type: "sql"; sqlQuery: string; }
| Name | Type | Description |
|---|---|---|
tableName | string | Unique table name used to store the data loaded from the data source. This name will be used to reference the data in SQL queries. |
type | "sql" | - |
sqlQuery | string | SQL query to execute for data retrieval |
