Line data Source code
1 : import { ConnectorType } from '../../connections/connector_info.js';
2 :
3 : /// The folder of the snippets that load datasets, the browser lists it first
4 1 : export const SNIPPET_DATASETS_FOLDER = 'datasets';
5 :
6 : /// A self-contained SQL statement sequence that can replace the text of a script
7 : export interface Snippet {
8 : /// The id of the snippet, `<category>/<name>`
9 : id: string;
10 : /// The category of the snippet, the folder of its files
11 : category: string;
12 : /// The connectors that the snippet runs on
13 : connectors: ConnectorType[];
14 : /// The text of the snippet per connector
15 : bodies: ReadonlyMap<ConnectorType, string>;
16 : /// The path of the file of the snippet per connector, below the snippet folder, e.g. `hyper/dates/series.sql`
17 : paths: ReadonlyMap<ConnectorType, string>;
18 : }
19 :
20 : /// The connectors of the engine folders of the snippets, `<engine>/<category>/<name>.sql`.
21 : /// The snippets of an engine run on all of its connectors.
22 1 : export const SNIPPET_ENGINE_CONNECTORS: ReadonlyMap<string, readonly ConnectorType[]> = new Map([
23 1 : ['hyper', [ConnectorType.HYPER, ConnectorType.SIDB]],
24 1 : ['salesforce', [ConnectorType.SALESFORCE_DATA_CLOUD]],
25 1 : ['trino', [ConnectorType.TRINO]],
26 1 : ]);
27 :
|