@malloydata/db-postgres 0.0.1 → 0.0.4
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.
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { StructDef, MalloyQueryData, QueryData, PooledConnection, SQLBlock, Connection, QueryDataRow } from "@malloydata/malloy";
|
|
2
|
-
import { FetchSchemaAndRunSimultaneously, FetchSchemaAndRunStreamSimultaneously, PersistSQLResults, StreamingConnection } from "@malloydata/malloy/src/runtime_types";
|
|
1
|
+
import { FetchSchemaAndRunSimultaneously, FetchSchemaAndRunStreamSimultaneously, PersistSQLResults, RunSQLOptions, StreamingConnection, StructDef, MalloyQueryData, QueryData, PooledConnection, SQLBlock, Connection, QueryDataRow } from "@malloydata/malloy";
|
|
3
2
|
import { Client } from "pg";
|
|
4
|
-
import { RunSQLOptions } from "@malloydata/malloy/src/malloy";
|
|
5
3
|
interface PostgresQueryConfiguration {
|
|
6
4
|
rowLimit?: number;
|
|
7
5
|
}
|
|
@@ -259,19 +259,19 @@ class PostgresConnection {
|
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
async getTableSchema(tableURL) {
|
|
262
|
+
const { tablePath } = (0, malloy_1.parseTableURI)(tableURL);
|
|
262
263
|
const structDef = {
|
|
263
264
|
type: "struct",
|
|
264
265
|
name: tableURL,
|
|
265
266
|
dialect: "postgres",
|
|
266
|
-
structSource: { type: "table" },
|
|
267
|
+
structSource: { type: "table", tablePath },
|
|
267
268
|
structRelationship: {
|
|
268
269
|
type: "basetable",
|
|
269
270
|
connectionName: this.name,
|
|
270
271
|
},
|
|
271
272
|
fields: [],
|
|
272
273
|
};
|
|
273
|
-
const
|
|
274
|
-
const [schema, table] = tableName.split(".");
|
|
274
|
+
const [schema, table] = tablePath.split(".");
|
|
275
275
|
if (table === undefined) {
|
|
276
276
|
throw new Error("Default schema not yet supported in Postgres");
|
|
277
277
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloydata/db-postgres",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"license": "GPL-2.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
+
"homepage": "https://github.com/looker-open-source/malloy#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/looker-open-source/malloy"
|
|
11
|
+
},
|
|
7
12
|
"scripts": {
|
|
8
13
|
"lint": "eslint '**/*.ts{,x}'",
|
|
9
14
|
"lint-fix": "eslint '**/*.ts{,x}' --fix",
|
|
@@ -12,7 +17,7 @@
|
|
|
12
17
|
"malloyc": "ts-node ../../scripts/malloy-to-json"
|
|
13
18
|
},
|
|
14
19
|
"dependencies": {
|
|
15
|
-
"@malloydata/malloy": "^0.0.
|
|
20
|
+
"@malloydata/malloy": "^0.0.4",
|
|
16
21
|
"@types/pg": "^8.6.1",
|
|
17
22
|
"pg": "^8.7.1",
|
|
18
23
|
"pg-query-stream": "4.2.3"
|