@malloydata/malloy 0.0.1 → 0.0.3
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 +12 -11
- package/dist/dialect/dialect.d.ts +1 -1
- package/dist/dialect/dialect.js +13 -0
- package/dist/dialect/duckdb.d.ts +1 -1
- package/dist/dialect/duckdb.js +35 -37
- package/dist/dialect/postgres.d.ts +1 -1
- package/dist/dialect/postgres.js +15 -8
- package/dist/dialect/standardsql.js +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/lang/ast/apply-expr.d.ts +2 -2
- package/dist/lang/ast/apply-expr.js +19 -3
- package/dist/lang/ast/ast-expr.d.ts +37 -37
- package/dist/lang/ast/ast-expr.js +24 -39
- package/dist/lang/ast/ast-main.d.ts +14 -14
- package/dist/lang/ast/ast-main.js +36 -45
- package/dist/lang/ast/ast-time-expr.d.ts +19 -19
- package/dist/lang/ast/ast-time-expr.js +6 -7
- package/dist/lang/ast/time-utils.d.ts +1 -0
- package/dist/lang/ast/time-utils.js +12 -1
- package/dist/lang/field-space.d.ts +43 -41
- package/dist/lang/field-space.js +115 -135
- package/dist/lang/lib/Malloy/MalloyLexer.d.ts +108 -106
- package/dist/lang/lib/Malloy/MalloyLexer.js +1019 -1006
- package/dist/lang/lib/Malloy/MalloyParser.d.ts +581 -590
- package/dist/lang/lib/Malloy/MalloyParser.js +1141 -1202
- package/dist/lang/lib/Malloy/MalloyParserListener.d.ts +2015 -0
- package/dist/lang/lib/Malloy/MalloyParserListener.js +4 -0
- package/dist/lang/lib/Malloy/MalloyParserVisitor.d.ts +1269 -0
- package/dist/lang/lib/Malloy/MalloyParserVisitor.js +4 -0
- package/dist/lang/parse-to-ast.d.ts +3 -4
- package/dist/lang/parse-to-ast.js +1 -1
- package/dist/lang/parse-tree-walkers/document-completion-walker.js +2 -0
- package/dist/lang/parse-tree-walkers/explore-query-walker.d.ts +2 -2
- package/dist/lang/space-field.d.ts +10 -7
- package/dist/lang/space-field.js +11 -4
- package/dist/lang/test/field-symbols.spec.js +2 -2
- package/dist/lang/test/parse.spec.js +16 -1
- package/dist/lang/test/test-translator.js +1 -1
- package/dist/malloy.d.ts +1 -1
- package/dist/malloy.js +11 -5
- package/dist/md5.d.ts +1 -0
- package/dist/md5.js +30 -0
- package/dist/model/malloy_query.js +10 -6
- package/dist/model/malloy_types.d.ts +15 -2
- package/package.json +9 -13
- package/dist/dialect/dialect-map.d.ts +0 -3
- package/dist/dialect/dialect-map.js +0 -33
- package/dist/model/malloy-query.d.ts +0 -313
- package/dist/model/malloy-query.js +0 -2603
- package/dist/model/malloy-types.d.ts +0 -404
- package/dist/model/malloy-types.js +0 -242
- package/dist/model/sql-block.d.ts +0 -11
- package/dist/model/sql-block.js +0 -38
- package/dist/runtime-types.d.ts +0 -116
- package/dist/runtime-types.js +0 -40
package/dist/runtime-types.d.ts
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { MalloyQueryData, SQLBlock, StructDef } from "./model";
|
|
2
|
-
/**
|
|
3
|
-
* A URL.
|
|
4
|
-
*/
|
|
5
|
-
export declare class URL {
|
|
6
|
-
private _url;
|
|
7
|
-
constructor(stringURL: string);
|
|
8
|
-
/**
|
|
9
|
-
* @returns The string form of this URL.
|
|
10
|
-
*/
|
|
11
|
-
toString(): string;
|
|
12
|
-
/**
|
|
13
|
-
* Construct a URL from string.
|
|
14
|
-
*
|
|
15
|
-
* @param stringURL The string form of the URL.
|
|
16
|
-
* @returns A URL.
|
|
17
|
-
*/
|
|
18
|
-
static fromString(stringURL: string): URL;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* The contents of a Malloy query document.
|
|
22
|
-
*/
|
|
23
|
-
export declare type QueryString = string;
|
|
24
|
-
/**
|
|
25
|
-
* The contents of a Malloy model document.
|
|
26
|
-
*/
|
|
27
|
-
export declare type ModelString = string;
|
|
28
|
-
/**
|
|
29
|
-
* A URL whose contents is a Malloy model.
|
|
30
|
-
*/
|
|
31
|
-
export declare type ModelURL = URL;
|
|
32
|
-
/**
|
|
33
|
-
* A URL whose contents is a Malloy query.
|
|
34
|
-
*/
|
|
35
|
-
export declare type QueryURL = URL;
|
|
36
|
-
/**
|
|
37
|
-
* An object capable of reading the contents of a URL in some context.
|
|
38
|
-
*/
|
|
39
|
-
export interface URLReader {
|
|
40
|
-
/**
|
|
41
|
-
* Read the contents of the given URL.
|
|
42
|
-
*
|
|
43
|
-
* @param url The URL to read.
|
|
44
|
-
* @returns A promise to the contents of the URL.
|
|
45
|
-
*/
|
|
46
|
-
readURL: (url: URL) => Promise<string>;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* An object capable of reading schemas for given table names.
|
|
50
|
-
*/
|
|
51
|
-
export interface InfoConnection {
|
|
52
|
-
/**
|
|
53
|
-
* Fetch schemas for multiple tables.
|
|
54
|
-
*
|
|
55
|
-
* @param tables The names of tables to fetch schemas for.
|
|
56
|
-
* @returns A mapping of table names to schemas.
|
|
57
|
-
*/
|
|
58
|
-
fetchSchemaForTables(tables: string[]): Promise<{
|
|
59
|
-
schemas: Record<string, StructDef>;
|
|
60
|
-
errors: Record<string, string>;
|
|
61
|
-
}>;
|
|
62
|
-
/**
|
|
63
|
-
* Fetch schemas for multiple SQL blocks.
|
|
64
|
-
*
|
|
65
|
-
* @param tables The SQL blocks to fetch schemas for.
|
|
66
|
-
* @returns A mapping of SQL block names to schemas.
|
|
67
|
-
*/
|
|
68
|
-
fetchSchemaForSQLBlocks(sqlStructs: SQLBlock[]): Promise<{
|
|
69
|
-
schemas: Record<string, StructDef>;
|
|
70
|
-
errors: Record<string, string>;
|
|
71
|
-
}>;
|
|
72
|
-
/**
|
|
73
|
-
* The name of the connection.
|
|
74
|
-
*/
|
|
75
|
-
get name(): string;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* An object capable of running SQL.
|
|
79
|
-
*/
|
|
80
|
-
export interface Connection extends InfoConnection {
|
|
81
|
-
/**
|
|
82
|
-
* Run some SQL and yield results.
|
|
83
|
-
*
|
|
84
|
-
* @param sql The SQL to run.
|
|
85
|
-
* @param options.pageSize Maximum number of results to return at once.
|
|
86
|
-
* @returns The rows of data resulting from running the given SQL query
|
|
87
|
-
* and the total number of rows available.
|
|
88
|
-
*/
|
|
89
|
-
runSQL(sql: string, options?: {
|
|
90
|
-
rowLimit?: number;
|
|
91
|
-
}): Promise<MalloyQueryData>;
|
|
92
|
-
runSQLBlockAndFetchResultSchema(sqlBlock: SQLBlock, options?: {
|
|
93
|
-
rowLimit?: number;
|
|
94
|
-
}): Promise<{
|
|
95
|
-
data: MalloyQueryData;
|
|
96
|
-
schema: StructDef;
|
|
97
|
-
}>;
|
|
98
|
-
isPool(): this is PooledConnection;
|
|
99
|
-
}
|
|
100
|
-
export interface TestableConnection extends Connection {
|
|
101
|
-
test(): Promise<void>;
|
|
102
|
-
}
|
|
103
|
-
export interface PooledConnection extends Connection {
|
|
104
|
-
drain(): Promise<void>;
|
|
105
|
-
isPool(): true;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* A mapping of connection names to connections.
|
|
109
|
-
*/
|
|
110
|
-
export interface LookupConnection<T extends InfoConnection> {
|
|
111
|
-
/**
|
|
112
|
-
* @param connectionName The name of the connection for which a `Connection` is required.
|
|
113
|
-
* @returns A promise to a `Connection` for the connection named `connectionName`.
|
|
114
|
-
*/
|
|
115
|
-
lookupConnection(connectionName?: string): Promise<T>;
|
|
116
|
-
}
|
package/dist/runtime-types.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright 2021 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* This program is free software; you can redistribute it and/or
|
|
6
|
-
* modify it under the terms of the GNU General Public License
|
|
7
|
-
* version 2 as published by the Free Software Foundation.
|
|
8
|
-
*
|
|
9
|
-
* This program is distributed in the hope that it will be useful,
|
|
10
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
* GNU General Public License for more details.
|
|
13
|
-
*/
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.URL = void 0;
|
|
16
|
-
/**
|
|
17
|
-
* A URL.
|
|
18
|
-
*/
|
|
19
|
-
class URL {
|
|
20
|
-
constructor(stringURL) {
|
|
21
|
-
this._url = stringURL;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* @returns The string form of this URL.
|
|
25
|
-
*/
|
|
26
|
-
toString() {
|
|
27
|
-
return this._url;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Construct a URL from string.
|
|
31
|
-
*
|
|
32
|
-
* @param stringURL The string form of the URL.
|
|
33
|
-
* @returns A URL.
|
|
34
|
-
*/
|
|
35
|
-
static fromString(stringURL) {
|
|
36
|
-
return new URL(stringURL);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.URL = URL;
|
|
40
|
-
//# sourceMappingURL=runtime-types.js.map
|