@graphenedata/cli 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +138 -0
- package/dist/cli/bigQuery-I3F46SC6.js +75 -0
- package/dist/cli/bigQuery-I3F46SC6.js.map +7 -0
- package/dist/cli/chunk-OVWODUTJ.js +12849 -0
- package/dist/cli/chunk-OVWODUTJ.js.map +7 -0
- package/dist/cli/chunk-QAXEOZ43.js +53 -0
- package/dist/cli/chunk-QAXEOZ43.js.map +7 -0
- package/dist/cli/cli.js +234 -11197
- package/dist/cli/clickhouse-ZN5AN2UL.js +64 -0
- package/dist/cli/clickhouse-ZN5AN2UL.js.map +7 -0
- package/dist/cli/duckdb-IYBIO5KJ.js +87 -0
- package/dist/cli/duckdb-IYBIO5KJ.js.map +7 -0
- package/dist/cli/serve2-TNN5EROW.js +447 -0
- package/dist/cli/serve2-TNN5EROW.js.map +7 -0
- package/dist/cli/snowflake-MOQB5GA4.js +128 -0
- package/dist/cli/snowflake-MOQB5GA4.js.map +7 -0
- package/dist/index.d.ts +63 -0
- package/dist/lang/index.d.ts +63 -0
- package/dist/skills/graphene/SKILL.md +150 -96
- package/dist/skills/graphene/references/big-value.md +6 -41
- package/dist/skills/graphene/references/date-range.md +64 -0
- package/dist/skills/graphene/references/dropdown.md +3 -4
- package/dist/skills/graphene/references/echarts.md +162 -0
- package/dist/skills/graphene/references/gsql.md +55 -25
- package/dist/skills/graphene/references/model-gsql.md +72 -0
- package/dist/skills/graphene/references/table.md +13 -14
- package/dist/skills/graphene/references/text-input.md +2 -1
- package/dist/ui/app.css +239 -340
- package/dist/ui/component-utilities/dataShaping.ts +484 -0
- package/dist/ui/component-utilities/dataSummary.ts +57 -0
- package/dist/ui/component-utilities/enrich.ts +763 -0
- package/dist/ui/component-utilities/format.ts +177 -0
- package/dist/ui/component-utilities/inputUtils.ts +44 -8
- package/dist/ui/component-utilities/theme.ts +200 -0
- package/dist/ui/component-utilities/themeStores.ts +21 -8
- package/dist/ui/component-utilities/types.ts +70 -0
- package/dist/ui/components/AreaChart.svelte +57 -105
- package/dist/ui/components/BarChart.svelte +71 -129
- package/dist/ui/components/BigValue.svelte +24 -40
- package/dist/ui/components/Column.svelte +10 -18
- package/dist/ui/components/DateRange.svelte +54 -21
- package/dist/ui/components/Dropdown.svelte +47 -26
- package/dist/ui/components/DropdownOption.svelte +1 -2
- package/dist/ui/components/ECharts.svelte +181 -67
- package/dist/ui/components/InlineDelta.svelte +50 -31
- package/dist/ui/components/LineChart.svelte +54 -125
- package/dist/ui/components/PieChart.svelte +27 -37
- package/dist/ui/components/QueryLoad.svelte +77 -45
- package/dist/ui/components/Row.svelte +2 -1
- package/dist/ui/components/ScatterPlot.svelte +52 -0
- package/dist/ui/components/Skeleton.svelte +32 -0
- package/dist/ui/components/Table.svelte +3 -2
- package/dist/ui/components/TableGroupRow.svelte +28 -36
- package/dist/ui/components/TableHarness.svelte +32 -0
- package/dist/ui/components/TableHeader.svelte +34 -59
- package/dist/ui/components/TableRow.svelte +14 -38
- package/dist/ui/components/TableSubtotalRow.svelte +18 -21
- package/dist/ui/components/TableTotalRow.svelte +27 -37
- package/dist/ui/components/TextInput.svelte +13 -12
- package/dist/ui/components/Value.svelte +25 -0
- package/dist/ui/components/_Table.svelte +72 -70
- package/dist/ui/internal/ChartGallery.svelte +527 -0
- package/dist/ui/internal/ErrorDisplay.svelte +22 -97
- package/dist/ui/internal/LocalApp.svelte +80 -17
- package/dist/ui/internal/PageNavGroup.svelte +269 -0
- package/dist/ui/internal/Sidebar.svelte +178 -0
- package/dist/ui/internal/SidebarToggle.svelte +47 -0
- package/dist/ui/internal/StyleGallery.svelte +244 -0
- package/dist/ui/internal/clientCache.ts +2 -2
- package/dist/ui/internal/pageInputs.svelte.js +292 -0
- package/dist/ui/internal/queryEngine.ts +102 -117
- package/dist/ui/internal/runSocket.ts +32 -12
- package/dist/ui/internal/sidebar.svelte.js +18 -0
- package/dist/ui/internal/telemetry.ts +51 -16
- package/dist/ui/internal/types.d.ts +7 -0
- package/dist/ui/web.js +28 -11
- package/package.json +36 -38
- package/dist/skills/graphene/references/area-chart.md +0 -95
- package/dist/skills/graphene/references/bar-chart.md +0 -112
- package/dist/skills/graphene/references/line-chart.md +0 -108
- package/dist/skills/graphene/references/pie-chart.md +0 -29
- package/dist/skills/graphene/references/value-formats.md +0 -104
- package/dist/ui/component-utilities/autoFormatting.js +0 -280
- package/dist/ui/component-utilities/builtInFormats.js +0 -481
- package/dist/ui/component-utilities/chartContext.js +0 -12
- package/dist/ui/component-utilities/chartWindowDebug.js +0 -21
- package/dist/ui/component-utilities/checkInputs.js +0 -84
- package/dist/ui/component-utilities/convert.js +0 -15
- package/dist/ui/component-utilities/dateParsing.js +0 -56
- package/dist/ui/component-utilities/dropdownContext.ts +0 -1
- package/dist/ui/component-utilities/echarts.js +0 -252
- package/dist/ui/component-utilities/echartsThemes.js +0 -443
- package/dist/ui/component-utilities/formatTitle.js +0 -24
- package/dist/ui/component-utilities/formatting.js +0 -241
- package/dist/ui/component-utilities/getColumnExtents.js +0 -79
- package/dist/ui/component-utilities/getColumnSummary.js +0 -62
- package/dist/ui/component-utilities/getCompletedData.js +0 -122
- package/dist/ui/component-utilities/getDistinctCount.js +0 -7
- package/dist/ui/component-utilities/getDistinctValues.js +0 -15
- package/dist/ui/component-utilities/getSeriesConfig.js +0 -231
- package/dist/ui/component-utilities/getSortedData.js +0 -9
- package/dist/ui/component-utilities/getStackPercentages.js +0 -45
- package/dist/ui/component-utilities/getStackedData.js +0 -19
- package/dist/ui/component-utilities/getYAxisIndex.js +0 -15
- package/dist/ui/component-utilities/globalContexts.js +0 -1
- package/dist/ui/component-utilities/helpers/getCompletedData.helpers.js +0 -119
- package/dist/ui/component-utilities/replaceNulls.js +0 -16
- package/dist/ui/component-utilities/tableUtils.ts +0 -107
- package/dist/ui/component-utilities/tidyWithTypes.js +0 -9
- package/dist/ui/components/Area.svelte +0 -214
- package/dist/ui/components/Bar.svelte +0 -347
- package/dist/ui/components/Chart.svelte +0 -995
- package/dist/ui/components/Line.svelte +0 -227
- package/dist/ui/internal/NavSidebar.svelte +0 -396
- package/dist/ui/internal/theme.ts +0 -60
- package/dist/ui/public/inter-latin-ext.woff2 +0 -0
- package/dist/ui/public/inter-latin.woff2 +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<br/>
|
|
3
|
+
<a href="https://graphenedata.com">
|
|
4
|
+
<img height="125" alt="Graphene Logo" src="./assets/logo.png" />
|
|
5
|
+
</a>
|
|
6
|
+
<br/>
|
|
7
|
+
<br/>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<b>Graphene</b> is a data analytics framework built for agents.
|
|
12
|
+
<br/>
|
|
13
|
+
Ask questions and build visualizations 10x faster when agents do the work.
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<div align="center">
|
|
17
|
+
<a href="https://graphenedata.com">Website</a>
|
|
18
|
+
•
|
|
19
|
+
<a href="https://github.com/graphene-data/example-flights">Demo Project</a>
|
|
20
|
+
•
|
|
21
|
+
<a href="/docs/setup.md">Setup</a>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<br/>
|
|
25
|
+
|
|
26
|
+
## Why Graphene?
|
|
27
|
+
|
|
28
|
+
In the future, we believe **most low-level data analytics work will be done by agents**, allowing humans to focus on insights and decision-making. However, today's tools weren't built with agents in mind:
|
|
29
|
+
|
|
30
|
+
- They are GUI centric. Lots of actions can only be done via GUI and aren't accessible to external agents like Claude.
|
|
31
|
+
- They focus on raising the floor at the expense of lowering the ceiling (limited viz types, simplified querying APIs).
|
|
32
|
+
- They assume the human user has the tribal knowledge and business context necessary for analysis.
|
|
33
|
+
|
|
34
|
+
If we really want agents to be more productive with data, an entirely new toolset is needed.
|
|
35
|
+
|
|
36
|
+
Graphene is:
|
|
37
|
+
|
|
38
|
+
- [x] **Built for agents**. Everything is code, written only in languages that are prevalent in training data (SQL, Markdown, HTML). All actions are CLIs; nothing is trapped in a button.
|
|
39
|
+
- [x] **High-ceiling**. Agents can create any visualization that's supported by ECharts, one of the most feature-complete visualization libraries. And Graphene's query language is as powerful as ANSI SQL, which supports 170+ functions, CTEs, subqueries, set operations, window functions, arrays, and more.
|
|
40
|
+
- [x] **Optimized for agent context**. Graphene's SQL language contains a semantic layer which allows metrics and join relationships to be invoked in queries. When combined with [agent skills](https://agentskills.io/home) for general business context and best practices, agents perform at human levels of competency.
|
|
41
|
+
|
|
42
|
+
### Open, forever
|
|
43
|
+
|
|
44
|
+
Importantly, Graphene is **open**. You can use this project for internal purposes for free, forever, and aren't locked in to a contract with us. More details [below](#faq).
|
|
45
|
+
|
|
46
|
+
### Rich visualizations
|
|
47
|
+
|
|
48
|
+
Graphene pages support visualizations, input components for filtering and dynamic behaviors, and layout modes for monitoring-oriented dashboards vs. narrative-oriented notebooks.
|
|
49
|
+
|
|
50
|
+
<img alt="Graphene Screenshots" src="./assets/page_examples.png"/>
|
|
51
|
+
|
|
52
|
+
### Powerful workflows
|
|
53
|
+
|
|
54
|
+
When you deconstruct data analytics into code, CLIs, and coding agents, things that used to be hard become easy:
|
|
55
|
+
|
|
56
|
+
- Promote metrics from pages into the model, or demote metrics out of the model back into pages
|
|
57
|
+
- Bulk refactors in a single atomic commit/PR
|
|
58
|
+
- Ability to use extensive skill/MCP ecosystem to augment agent behavior
|
|
59
|
+
- Iterate on a dashboard (edit, run, view) without needing to push up to some API or open a SaaS portal
|
|
60
|
+
- Validate SQL and page syntax instantaneously as you type
|
|
61
|
+
- Set up a recurring agent that de-bloats, consolidates your model over time
|
|
62
|
+
|
|
63
|
+
## Get started
|
|
64
|
+
|
|
65
|
+
- [Try the demo project](https://github.com/graphene-data/example-flights)
|
|
66
|
+
- [Create a new Graphene project](/docs/setup.md)
|
|
67
|
+
|
|
68
|
+
Graphene currently supports Snowflake, BigQuery, ClickHouse, and local data (via DuckDB) as data sources. It is easy for us to add more - just ask.
|
|
69
|
+
|
|
70
|
+
Once your project is set up, simply start the dev server via `npm exec graphene serve` (or `pnpm graphene serve`, etc. based on your package manager) and then prompt your coding agent to do analytics work: answer a data question, build a dashboard, edit the model, etc.
|
|
71
|
+
|
|
72
|
+
## How it works
|
|
73
|
+
|
|
74
|
+
A Graphene project can either be a standalone repo or a directory within a larger codebase (such as dbt). It is comprised of:
|
|
75
|
+
|
|
76
|
+
- **Semantic models**, via .gsql files. GSQL is both a modeling language and a query language, in the same way that SQL has both DDL and DML.
|
|
77
|
+
- **Pages**, via .md files. Pages are typically used for dashboards, but can also contain notebook-style narratives, documentation, and other visual content.
|
|
78
|
+
|
|
79
|
+
Graphene itself is a CLI which can be installed via npm (or pnpm, yarn, etc.). The CLI can run and compile GSQL queries, render pages in the browser, check syntax, print screenshots, and more.
|
|
80
|
+
|
|
81
|
+
### GSQL and Graphene markdown
|
|
82
|
+
|
|
83
|
+
Semantic models are defined like so:
|
|
84
|
+
|
|
85
|
+
```sql
|
|
86
|
+
table orders (
|
|
87
|
+
id BIGINT
|
|
88
|
+
user_id BIGINT
|
|
89
|
+
amount FLOAT
|
|
90
|
+
status STRING
|
|
91
|
+
|
|
92
|
+
join one users on user_id = users.id -- many orders per user
|
|
93
|
+
|
|
94
|
+
is_complete: status = 'Complete' -- dimension (scalar expression)
|
|
95
|
+
revenue: sum(amount) -- measure (agg expression)
|
|
96
|
+
aov: revenue / count(*) -- measures can compose
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
table users (
|
|
100
|
+
id BIGINT
|
|
101
|
+
name VARCHAR
|
|
102
|
+
|
|
103
|
+
join many orders on id = orders.user_id
|
|
104
|
+
)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Models are then queried via `select`, either directly via CLI or inside a Graphene markdown page like this.
|
|
108
|
+
|
|
109
|
+
````md
|
|
110
|
+
```sql top_customers
|
|
111
|
+
select
|
|
112
|
+
users.name as name, -- Use the dot operator to traverse the modeled join relationship
|
|
113
|
+
revenue -- Invokes the measure
|
|
114
|
+
from orders -- A join statement here is not needed
|
|
115
|
+
group by 1
|
|
116
|
+
order by 2 desc
|
|
117
|
+
limit 10
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
<BigValue data="orders" value="revenue" />
|
|
121
|
+
<BarChart data="top_customers" x="name" y="revenue" />
|
|
122
|
+
````
|
|
123
|
+
|
|
124
|
+
## Documentation
|
|
125
|
+
|
|
126
|
+
Graphene's entire documentation ships as an agent skill in the Graphene npm package. The source files are available [here](/docs).
|
|
127
|
+
|
|
128
|
+
## FAQ
|
|
129
|
+
|
|
130
|
+
<details>
|
|
131
|
+
<summary><b>So does everyone have to use git and a coding agent to use Graphene for BI?</b></summary>
|
|
132
|
+
If you just want to use this project and nothing more, yes. Our managed service, Graphene Cloud, offers a Slack agent, MCP server, and browser-based SaaS experience.
|
|
133
|
+
</details>
|
|
134
|
+
|
|
135
|
+
<details>
|
|
136
|
+
<summary><b>What software license does this use?</b></summary>
|
|
137
|
+
Graphene is licensed under the Elastic License 2.0 which allows you to use it for internal use cases for free, forever. If you would like to use the Graphene Cloud services above, or if you would like a commercial license, please contact us <a href="https://graphenedata.com/contact-us">here</a>.
|
|
138
|
+
</details>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import {
|
|
2
|
+
config
|
|
3
|
+
} from "./chunk-QAXEOZ43.js";
|
|
4
|
+
|
|
5
|
+
// connections/bigQuery.ts
|
|
6
|
+
import { BigQuery, BigQueryDate, BigQueryTimestamp } from "@google-cloud/bigquery";
|
|
7
|
+
function validateBigQueryIdent(ident) {
|
|
8
|
+
if (!/^[\w.-]+$/.test(ident)) throw new Error(`Invalid BigQuery identifier: ${ident}`);
|
|
9
|
+
}
|
|
10
|
+
var BigQueryConnection = class {
|
|
11
|
+
client;
|
|
12
|
+
projectId;
|
|
13
|
+
defaultNamespace;
|
|
14
|
+
constructor(options = {}) {
|
|
15
|
+
options.projectId ||= config.bigquery?.projectId;
|
|
16
|
+
if (!options.projectId) throw new Error("projectId must be set in config or provided in service account credentials");
|
|
17
|
+
this.projectId = options.projectId;
|
|
18
|
+
this.client = new BigQuery({ ...options, userAgent: "Graphene" });
|
|
19
|
+
this.defaultNamespace = config.defaultNamespace;
|
|
20
|
+
}
|
|
21
|
+
async runQuery(sql, params) {
|
|
22
|
+
let [job] = await this.client.createQueryJob({ query: sql, useLegacySql: false, params });
|
|
23
|
+
let [rows] = await job.getQueryResults({ maxResults: 1e4 });
|
|
24
|
+
let metadata = job.metadata || (await job.getMetadata())[0];
|
|
25
|
+
let totalRows = Number(metadata?.statistics?.query?.totalRows ?? rows.length);
|
|
26
|
+
rows.forEach((r) => {
|
|
27
|
+
Object.entries(r).forEach(([k, v]) => {
|
|
28
|
+
if (v instanceof BigQueryTimestamp) r[k] = v.value;
|
|
29
|
+
if (v instanceof BigQueryDate) r[k] = v.value;
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
return { rows, totalRows };
|
|
33
|
+
}
|
|
34
|
+
async listDatasets() {
|
|
35
|
+
let [datasets] = await this.client.getDatasets();
|
|
36
|
+
return datasets.map((d) => String(d.id || d.metadata.datasetReference?.datasetId || "").toLowerCase());
|
|
37
|
+
}
|
|
38
|
+
async listTables(dataset) {
|
|
39
|
+
if (!dataset) throw new Error("BigQuery requires a dataset");
|
|
40
|
+
validateBigQueryIdent(dataset);
|
|
41
|
+
let resolvedDataset = await this.resolveDatasetName(dataset);
|
|
42
|
+
let res = await this.runQuery(`select table_name as table_name
|
|
43
|
+
from \`${resolvedDataset}.INFORMATION_SCHEMA.TABLES\`
|
|
44
|
+
where table_type in ('BASE TABLE', 'VIEW') order by table_name`);
|
|
45
|
+
return res.rows.map((r) => `${resolvedDataset.toLowerCase()}.${String(r["table_name"]).toLowerCase()}`);
|
|
46
|
+
}
|
|
47
|
+
async describeTable(target) {
|
|
48
|
+
let parts = target.split(".");
|
|
49
|
+
let table = parts.pop() || "";
|
|
50
|
+
let dataset = parts.join(".") || this.defaultNamespace;
|
|
51
|
+
if (!dataset) throw new Error("No dataset specified and no default namespace configured");
|
|
52
|
+
validateBigQueryIdent(dataset);
|
|
53
|
+
let resolvedDataset = await this.resolveDatasetName(dataset);
|
|
54
|
+
let sql = `
|
|
55
|
+
select column_name as column_name, data_type as data_type, ordinal_position as ordinal_position
|
|
56
|
+
from \`${resolvedDataset}.INFORMATION_SCHEMA.COLUMNS\`
|
|
57
|
+
where lower(table_name) = lower(@table)
|
|
58
|
+
order by ordinal_position
|
|
59
|
+
`.trim();
|
|
60
|
+
let res = await this.runQuery(sql, { table });
|
|
61
|
+
return res.rows.map((row) => {
|
|
62
|
+
return { name: String(row["column_name"]).toLowerCase(), dataType: String(row["data_type"]) };
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
async resolveDatasetName(name) {
|
|
66
|
+
let datasets = await this.listDatasets();
|
|
67
|
+
return datasets.find((ds) => ds.toLowerCase() == name.toLowerCase()) || name;
|
|
68
|
+
}
|
|
69
|
+
async close() {
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
export {
|
|
73
|
+
BigQueryConnection
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=bigQuery-I3F46SC6.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../connections/bigQuery.ts"],
|
|
4
|
+
"sourcesContent": ["import {BigQuery, BigQueryDate, BigQueryTimestamp, type BigQueryOptions} from '@google-cloud/bigquery'\n\nimport {config} from '../../lang/config.ts'\nimport {type QueryConnection, type QueryResult, type SchemaColumn, type QueryParams} from './types.ts'\n\n// BigQuery identifiers can contain letters, numbers, underscores, and hyphens\nfunction validateBigQueryIdent(ident: string) {\n if (!/^[\\w.-]+$/.test(ident)) throw new Error(`Invalid BigQuery identifier: ${ident}`)\n}\n\nexport class BigQueryConnection implements QueryConnection {\n private readonly client: BigQuery\n private readonly projectId: string\n private readonly defaultNamespace?: string\n\n constructor(options: BigQueryOptions = {}) {\n options.projectId ||= config.bigquery?.projectId\n if (!options.projectId) throw new Error('projectId must be set in config or provided in service account credentials')\n this.projectId = options.projectId\n this.client = new BigQuery({...options, userAgent: 'Graphene'})\n this.defaultNamespace = config.defaultNamespace\n }\n\n async runQuery(sql: string, params?: QueryParams): Promise<QueryResult> {\n let [job] = await this.client.createQueryJob({query: sql, useLegacySql: false, params})\n let [rows] = await job.getQueryResults({maxResults: 10000})\n let metadata = job.metadata || (await job.getMetadata())[0]\n let totalRows = Number(metadata?.statistics?.query?.totalRows ?? rows.length)\n\n rows.forEach(r => {\n Object.entries(r).forEach(([k, v]) => {\n if (v instanceof BigQueryTimestamp) r[k] = v.value\n if (v instanceof BigQueryDate) r[k] = v.value\n })\n })\n\n return {rows, totalRows}\n }\n\n async listDatasets(): Promise<string[]> {\n let [datasets] = await this.client.getDatasets()\n return datasets.map(d => String(d.id || d.metadata.datasetReference?.datasetId || '').toLowerCase())\n }\n\n async listTables(dataset?: string): Promise<string[]> {\n if (!dataset) throw new Error('BigQuery requires a dataset')\n validateBigQueryIdent(dataset)\n\n let resolvedDataset = await this.resolveDatasetName(dataset)\n let res = await this.runQuery(`select table_name as table_name\n from \\`${resolvedDataset}.INFORMATION_SCHEMA.TABLES\\`\n where table_type in ('BASE TABLE', 'VIEW') order by table_name`)\n\n return res.rows.map(r => `${resolvedDataset.toLowerCase()}.${String(r['table_name']).toLowerCase()}`)\n }\n\n async describeTable(target: string): Promise<SchemaColumn[]> {\n let parts = target.split('.')\n let table = parts.pop() || ''\n let dataset = parts.join('.') || this.defaultNamespace\n if (!dataset) throw new Error('No dataset specified and no default namespace configured')\n validateBigQueryIdent(dataset)\n let resolvedDataset = await this.resolveDatasetName(dataset)\n let sql = `\n select column_name as column_name, data_type as data_type, ordinal_position as ordinal_position\n from \\`${resolvedDataset}.INFORMATION_SCHEMA.COLUMNS\\`\n where lower(table_name) = lower(@table)\n order by ordinal_position\n `.trim()\n let res = await this.runQuery(sql, {table})\n return res.rows.map(row => {\n return {name: String(row['column_name']).toLowerCase(), dataType: String(row['data_type'])}\n })\n }\n\n async resolveDatasetName(name: string): Promise<string> {\n let datasets = await this.listDatasets()\n return datasets.find(ds => ds.toLowerCase() == name.toLowerCase()) || name\n }\n\n async close(): Promise<void> {}\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|