From aa42b9abdb60a8b26281eaa301f7e9502f668b59 Mon Sep 17 00:00:00 2001 From: Michael Toy <66150587+mtoy-googly-moogly@users.noreply.github.com> Date: Mon, 18 Mar 2024 12:43:39 -0700 Subject: [PATCH 1/2] cleanup sql: and from_sql() (#1657) * remove vestiges of from_sql * remove sql: statement * remove cruft utility function * cleanup from_sql and sql: in textmade grammar * update grammar test * drop old highlight api instead of maintaining it --- .../grammars/malloy/malloy.monarch.ts | 15 +- .../grammars/malloy/malloy.tmGrammar.json | 24 +- .../grammars/malloy/malloyTestInput.ts | 1 - .../grammars/malloy/tokenizations/darkPlus.ts | 32 -- packages/malloy/src/index.ts | 3 - packages/malloy/src/lang/ast/index.ts | 2 - .../ast/source-elements/from-sql-source.ts | 63 --- .../lang/ast/sql-elements/sql-statement.ts | 103 ----- .../malloy/src/lang/grammar/MalloyLexer.g4 | 2 - .../malloy/src/lang/grammar/MalloyParser.g4 | 14 - packages/malloy/src/lang/index.ts | 2 - packages/malloy/src/lang/malloy-to-ast.ts | 42 -- packages/malloy/src/lang/parse-malloy.ts | 57 +-- .../document-highlight-walker.ts | 406 ------------------ .../document-symbol-walker.ts | 11 - .../malloy/src/lang/test/locations.spec.ts | 25 -- packages/malloy/src/lang/test/parse.spec.ts | 16 - .../malloy/src/lang/test/sql-block.spec.ts | 86 +--- .../malloy/src/lang/translate-response.ts | 2 - packages/malloy/src/malloy.ts | 54 --- 20 files changed, 11 insertions(+), 949 deletions(-) delete mode 100644 packages/malloy/src/lang/ast/source-elements/from-sql-source.ts delete mode 100644 packages/malloy/src/lang/ast/sql-elements/sql-statement.ts delete mode 100644 packages/malloy/src/lang/parse-tree-walkers/document-highlight-walker.ts diff --git a/packages/malloy-syntax-highlight/grammars/malloy/malloy.monarch.ts b/packages/malloy-syntax-highlight/grammars/malloy/malloy.monarch.ts index 29406bf0f..8eb0b31b0 100644 --- a/packages/malloy-syntax-highlight/grammars/malloy/malloy.monarch.ts +++ b/packages/malloy-syntax-highlight/grammars/malloy/malloy.monarch.ts @@ -47,18 +47,6 @@ export const monarch: Monaco.IMonarchLanguage = { {include: '@identifiers_unquoted'}, ], sql_string: [ - [ - /\b(select)(\s*:\s*)(""")/, - [ - 'keyword.control.select', - '', - { - next: '@sql_end', - nextEmbedded: 'sql', - token: 'punctuation.sql.block.open', - }, - ], - ], [ /(\b[A-Za-z_][A-Za-z_0-9]*)(\s*\.\s*)(sql)(\s*\(\s*)(""")/, [ @@ -196,7 +184,6 @@ export const monarch: Monaco.IMonarchLanguage = { ], properties: [ [/\baccept\b/, 'keyword.control.accept'], - [/\bsql\b/, 'keyword.control.sql'], [/\bselect\b/, 'keyword.control.select'], [/\bconnection\b/, 'keyword.control.connection'], [/\brun\b/, 'keyword.control.run'], @@ -236,7 +223,7 @@ export const monarch: Monaco.IMonarchLanguage = { ['entity.name.function', '', 'entity.name.function.modifier'], ], [ - /\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE|TABLE|FROM|FROM_SQL|UNGROUPED)(\s*\()/, + /\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE|UNGROUPED)(\s*\()/, ['entity.name.function', ''], ], [/\b([a-zA-Z_][a-zA-Z_0-9]*)(\s*\()/, ['entity.name.function', '']], diff --git a/packages/malloy-syntax-highlight/grammars/malloy/malloy.tmGrammar.json b/packages/malloy-syntax-highlight/grammars/malloy/malloy.tmGrammar.json index 8212a229b..6b1aa425c 100644 --- a/packages/malloy-syntax-highlight/grammars/malloy/malloy.tmGrammar.json +++ b/packages/malloy-syntax-highlight/grammars/malloy/malloy.tmGrammar.json @@ -39,22 +39,6 @@ }, "sql-string": { "patterns": [ - { - "begin": "\\b(select)(\\s*:\\s*)(\"\"\")", - "end": "\"\"\"", - "beginCaptures": { - "1": { "name": "keyword.control.select" }, - "3": { "name": "punctuation.sql-block.open" } - }, - "endCaptures": { - "0": { "name": "punctuation.sql-block.close" } - }, - "name": "source.sql", - "patterns": [ - { "include": "#malloy-in-sql" }, - { "include": "source.sql" } - ] - }, { "begin": "(\\b[A-Za-z_][A-Za-z_0-9]*)(\\s*\\.\\s*)(sql)(\\s*\\(\\s*)(\"\"\")", "end": "\"\"\"", @@ -84,7 +68,7 @@ } }, { - "match": "(?i)\\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE|TABLE|FROM|FROM_SQL|UNGROUPED)(\\s*\\()", + "match": "(?i)\\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE|UNGROUPED)(\\s*\\()", "captures": { "1": { "name": "entity.name.function" } } @@ -350,11 +334,7 @@ "match": "(?i)\\baccept\\b", "name": "keyword.control.accept" }, - { - "match": "(?i)\\bsql\\b", - "name": "keyword.control.sql" - }, - { + { "match": "(?i)\\bselect\\b", "name": "keyword.control.select" }, diff --git a/packages/malloy-syntax-highlight/grammars/malloy/malloyTestInput.ts b/packages/malloy-syntax-highlight/grammars/malloy/malloyTestInput.ts index aadbc5dc7..cd79af838 100644 --- a/packages/malloy-syntax-highlight/grammars/malloy/malloyTestInput.ts +++ b/packages/malloy-syntax-highlight/grammars/malloy/malloyTestInput.ts @@ -60,7 +60,6 @@ export default [ ["/'regexp string /*-- \\escapes\\uFFFF \\'more\\"], ['"/* -- \\e\\uFFFF \\\'\\'], ["state ~ 'CA' | r'M.' | \"CO\" | /'O.' -- end"], - ['select: """ SELECT 1 """'], ['run: duckdb.sql("""', ' SELECT 1', '""")'], // [ // 'select: """', diff --git a/packages/malloy-syntax-highlight/grammars/malloy/tokenizations/darkPlus.ts b/packages/malloy-syntax-highlight/grammars/malloy/tokenizations/darkPlus.ts index 925c51b9b..51b7846fe 100644 --- a/packages/malloy-syntax-highlight/grammars/malloy/tokenizations/darkPlus.ts +++ b/packages/malloy-syntax-highlight/grammars/malloy/tokenizations/darkPlus.ts @@ -1024,38 +1024,6 @@ export default [ ], }, ], - [ - { - line: 'select: """ SELECT 1 """', - tokens: [ - { - startIndex: 0, - type: ['source.malloy', 'source.sql', 'keyword.control.select'], - color: '#C586C0', - }, - { - startIndex: 6, - type: ['source.malloy', 'source.sql'], - color: '#000000', - }, - { - startIndex: 8, - type: ['source.malloy', 'source.sql', 'punctuation.sql-block.open'], - color: '#000000', - }, - { - startIndex: 11, - type: ['source.malloy', 'source.sql'], - color: '#000000', - }, - { - startIndex: 21, - type: ['source.malloy', 'source.sql', 'punctuation.sql-block.close'], - color: '#000000', - }, - ], - }, - ], [ { line: 'run: duckdb.sql("""', diff --git a/packages/malloy/src/index.ts b/packages/malloy/src/index.ts index a4e3b1960..c2913ff58 100644 --- a/packages/malloy/src/index.ts +++ b/packages/malloy/src/index.ts @@ -117,8 +117,6 @@ export { indent, } from './model'; export { - // Neede for VSCode extension - HighlightType, // Needed for tests only MalloyTranslator, } from './lang'; @@ -161,7 +159,6 @@ export type { Loggable, ModelMaterializer, DocumentSymbol, - DocumentHighlight, ResultJSON, PreparedResultMaterializer, SQLBlockMaterializer, diff --git a/packages/malloy/src/lang/ast/index.ts b/packages/malloy/src/lang/ast/index.ts index 092a47c7c..2759ba011 100644 --- a/packages/malloy/src/lang/ast/index.ts +++ b/packages/malloy/src/lang/ast/index.ts @@ -115,10 +115,8 @@ export * from './query-properties/sampling'; export * from './query-properties/top'; export * from './source-elements/named-source'; export * from './source-elements/query-source'; -export * from './source-elements/from-sql-source'; export * from './source-elements/sql-source'; export * from './source-elements/table-source'; -export * from './sql-elements/sql-statement'; export * from './sql-elements/sql-string'; export * from './types/annotation-elements'; export * from './types/comparison'; diff --git a/packages/malloy/src/lang/ast/source-elements/from-sql-source.ts b/packages/malloy/src/lang/ast/source-elements/from-sql-source.ts deleted file mode 100644 index 602a0a46c..000000000 --- a/packages/malloy/src/lang/ast/source-elements/from-sql-source.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2023 Google LLC - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -import { - StructDef, - StructRef, - isSQLBlockStruct, -} from '../../../model/malloy_types'; -import {NamedSource} from './named-source'; - -export class FromSQLSource extends NamedSource { - elementType = 'fromSQLSource'; - structRef(): StructRef { - return this.structDef(); - } - - modelStruct(): StructDef | undefined { - const modelEnt = this.modelEntry(this.ref); - const entry = modelEnt?.entry; - if (!entry) { - this.log(`Undefined from_sql source '${this.refName}'`); - return; - } - if (entry.type === 'function') { - this.log(`Cannot construct a source from a function '${this.refName}'`); - return; - } else if (entry.type === 'query') { - this.log(`Cannot use 'from_sql()' with a query '${this.refName}'`); - return; - } else if (entry.type === 'connection') { - this.log(`Cannot use 'from_sql()' with a connection '${this.refName}'`); - return; - } else if (isSQLBlockStruct(entry) && entry.declaredSQLBlock) { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const {declaredSQLBlock, ...newEntry} = entry; - return newEntry; - } else if (!isSQLBlockStruct(entry)) { - this.log(`Cannot use 'from_sql()' to reference '${this.refName}'`); - return; - } - this.log(`Cannot use 'from_sql()' to reference '${this.refName}'`); - } -} diff --git a/packages/malloy/src/lang/ast/sql-elements/sql-statement.ts b/packages/malloy/src/lang/ast/sql-elements/sql-statement.ts deleted file mode 100644 index 74f4a628b..000000000 --- a/packages/malloy/src/lang/ast/sql-elements/sql-statement.ts +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2023 Google LLC - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -import {SQLBlockSource, SQLBlockStructDef} from '../../../model/malloy_types'; -import {makeSQLBlock} from '../../../model/sql_block'; - -import {ModelDataRequest} from '../../translate-response'; -import {ZoneEntry} from '../../zone'; -import {DocStatement, Document, MalloyElement} from '../types/malloy-element'; -import {SQLString} from './sql-string'; - -export class SQLStatement extends MalloyElement implements DocStatement { - elementType = 'sqlStatement'; - is?: string; - connection?: string; - requestBlock?: SQLBlockSource; - - constructor(readonly select: SQLString) { - super(); - this.has({select: select}); - } - - sqlBlock(): SQLBlockSource { - if (!this.requestBlock) { - this.requestBlock = makeSQLBlock( - this.select.sqlPhrases(), - this.connection - ); - } - return this.requestBlock; - } - - private lookupCompiledSQL( - sql: SQLBlockSource - ): ZoneEntry | undefined { - const sqlDefEntry = this.translator()?.root.sqlQueryZone; - if (!sqlDefEntry) return; - sqlDefEntry.reference(sql.name, this.location); - return sqlDefEntry.getEntry(sql.name); - } - - needs(doc: Document): ModelDataRequest { - const sql = this.sqlBlock(); - const lookup = this.lookupCompiledSQL(sql); - if (lookup?.status === 'reference') { - return { - compileSQL: sql, - partialModel: this.select.containsQueries ? doc.modelDef() : undefined, - }; - } - } - - /** - * This is the one statement which pauses execution. First time through - * it will generate a schema request, next time through it will either - * record the error or record the schema. - */ - execute(doc: Document): void { - const sql = this.sqlBlock(); - const lookup = this.lookupCompiledSQL(sql); - if (!lookup) { - this.log("Cant't look up schema for sql block"); - return; - } - if (lookup.status === 'error') { - const msgLines = lookup.message.split(/\r?\n/); - this.select.log('Invalid SQL, ' + msgLines.join('\n ')); - return undefined; - } - if (lookup.status === 'present') { - const location = this.select.location; - const locStruct = { - ...lookup.value, - fields: lookup.value.fields.map(f => ({...f, location})), - location: this.location, - }; - if (this.is && !doc.defineSQL(locStruct, this.is)) { - this.log(`'${this.is}' already defined`); - } - return undefined; - } - } -} diff --git a/packages/malloy/src/lang/grammar/MalloyLexer.g4 b/packages/malloy/src/lang/grammar/MalloyLexer.g4 index 920580be2..86c0f3e1b 100644 --- a/packages/malloy/src/lang/grammar/MalloyLexer.g4 +++ b/packages/malloy/src/lang/grammar/MalloyLexer.g4 @@ -54,7 +54,6 @@ RUN: R U N SPACE_CHAR* ':'; SAMPLE: S A M P L E SPACE_CHAR* ':'; SELECT: S E L E C T SPACE_CHAR* ':'; SOURCE: S O U R C E SPACE_CHAR* ':'; -SQLC: S Q L SPACE_CHAR* ':'; TOP: T O P SPACE_CHAR* ':'; WHERE: W H E R E SPACE_CHAR* ':'; VIEW: V I E W SPACE_CHAR* ':' ; @@ -84,7 +83,6 @@ FALSE: F A L S E; FULL: F U L L; FOR: F O R; FROM: F R O M ; -FROM_SQL: F R O M '_' S Q L; HAS: H A S ; HOUR: H O U R S?; IMPORT: I M P O R T; diff --git a/packages/malloy/src/lang/grammar/MalloyParser.g4 b/packages/malloy/src/lang/grammar/MalloyParser.g4 index 210dfa4be..7c6549633 100644 --- a/packages/malloy/src/lang/grammar/MalloyParser.g4 +++ b/packages/malloy/src/lang/grammar/MalloyParser.g4 @@ -28,7 +28,6 @@ malloyDocument: (malloyStatement | SEMI)* EOF; malloyStatement : defineSourceStatement - | defineSQLStatement | defineQuery | importStatement | runStatement @@ -62,19 +61,6 @@ runStatement : tags RUN topLevelAnonQueryDef ; -defineSQLStatement - : SQLC nameSQLBlock isDefine sqlBlock - ; - -sqlBlock - : OCURLY blockSQLDef+ CCURLY - ; - -blockSQLDef - : CONNECTION connectionName - | SELECT sqlString - ; - sqlString : SQL_BEGIN sqlInterpolation* SQL_END ; diff --git a/packages/malloy/src/lang/index.ts b/packages/malloy/src/lang/index.ts index d5cddd191..72559e831 100644 --- a/packages/malloy/src/lang/index.ts +++ b/packages/malloy/src/lang/index.ts @@ -31,8 +31,6 @@ export type { export type {TranslateResponse} from './translate-response'; export {exploreQueryWalkerBuilder} from './parse-tree-walkers/explore-query-walker'; export type {ExploreClauseRef} from './parse-tree-walkers/explore-query-walker'; -export {HighlightType} from './parse-tree-walkers/document-highlight-walker'; -export type {DocumentHighlight} from './parse-tree-walkers/document-highlight-walker'; export type {DocumentSymbol} from './parse-tree-walkers/document-symbol-walker'; export type {DocumentCompletion} from './parse-tree-walkers/document-completion-walker'; export type {LogMessage} from './parse-log'; diff --git a/packages/malloy/src/lang/malloy-to-ast.ts b/packages/malloy/src/lang/malloy-to-ast.ts index bb6672dc7..91423a7fb 100644 --- a/packages/malloy/src/lang/malloy-to-ast.ts +++ b/packages/malloy/src/lang/malloy-to-ast.ts @@ -408,14 +408,6 @@ export class MalloyToAST ); } - protected getLegacySQLSouce( - pcx: parse.SqlExploreNameRefContext - ): ast.FromSQLSource { - const name = this.getModelEntryName(pcx); - const res = this.astAt(new ast.FromSQLSource(name), pcx); - return res; - } - visitSqlSource(pcx: parse.SqlSourceContext): ast.SQLSource { const connId = pcx.connectionId(); const connectionName = this.astAt(this.getModelEntryName(connId), connId); @@ -1605,40 +1597,6 @@ export class MalloyToAST return this.getFieldExpr(pcx.fieldExpr()); } - visitDefineSQLStatement( - pcx: parse.DefineSQLStatementContext - ): ast.SQLStatement { - const blockName = pcx.nameSQLBlock()?.text; - const blockParts = pcx.sqlBlock().blockSQLDef(); - const sqlStr = new ast.SQLString(); - let connectionName: string | undefined; - for (const blockEnt of blockParts) { - const nmCx = blockEnt.connectionName(); - if (nmCx) { - if (connectionName) { - this.contextError(nmCx, 'Cannot redefine connection'); - } else { - connectionName = this.getPlainString(nmCx); - } - } - const selCx = blockEnt.sqlString(); - if (selCx) { - this.makeSqlString(selCx, sqlStr); - } - } - const stmt = new ast.SQLStatement(sqlStr); - if (connectionName !== undefined) { - stmt.connection = connectionName; - } - stmt.is = blockName; - const result = this.astAt(stmt, pcx); - this.m4advisory( - pcx, - '`sql:` statement is deprecated, use `connection_name.sql(...)` instead' - ); - return result; - } - visitSampleStatement(pcx: parse.SampleStatementContext): ast.SampleProperty { const rowCx = pcx.sampleSpec().INTEGER_LITERAL(); if (rowCx) { diff --git a/packages/malloy/src/lang/parse-malloy.ts b/packages/malloy/src/lang/parse-malloy.ts index 056bb884e..00ff6193d 100644 --- a/packages/malloy/src/lang/parse-malloy.ts +++ b/packages/malloy/src/lang/parse-malloy.ts @@ -52,12 +52,6 @@ import { } from './parse-tree-walkers/find-external-references'; import {Zone, ZoneData} from './zone'; import {walkForDocumentSymbols} from './parse-tree-walkers/document-symbol-walker'; -import { - DocumentHighlight, - passForHighlights, - sortHighlights, - walkForDocumentHighlights, -} from './parse-tree-walkers/document-highlight-walker'; import { DocumentCompletion, walkForDocumentCompletions, @@ -361,11 +355,6 @@ class ImportsAndTablesStep implements TranslationStep { } } -interface SQLExploreRef { - ref?: ast.FromSQLSource; - def?: ast.SQLStatement; -} - class ASTStep implements TranslationStep { response?: ASTResponse; private walked = false; @@ -400,49 +389,28 @@ class ASTStep implements TranslationStep { ); const newAst = secondPass.visit(parse.root); that.compilerFlags = secondPass.compilerFlags; - if (that.root.logger.hasErrors()) { - this.response = that.fatalResponse(); - return this.response; - } if (newAst.elementType === 'unimplemented') { - throw new Error('TRANSLATOR INTERNAL ERROR: Unimplemented AST node'); + newAst.log('INTERNAL COMPILER ERROR: Untranslated parse node'); } - // I kind of think table refs should probably also be collected here - // instead of in the parse step. Note to myself, do that someday. - const sqlExplores: Record = {}; if (!this.walked) { + // The DocumentStatement.needs method has largely replaced the need to walk + // the AST once it has been translated, this one check remains, though + // it should probably never be hit for (const walkedTo of newAst.walk()) { - if (walkedTo instanceof ast.FromSQLSource) { - if (!sqlExplores[walkedTo.refName]) { - sqlExplores[walkedTo.refName] = {}; - } - sqlExplores[walkedTo.refName].ref = walkedTo; - } else if (walkedTo instanceof ast.SQLStatement && walkedTo.is) { - if (!sqlExplores[walkedTo.is]) { - sqlExplores[walkedTo.is] = {}; - } - sqlExplores[walkedTo.is].def = walkedTo; - } else if (walkedTo instanceof ast.Unimplemented) { + if (walkedTo instanceof ast.Unimplemented) { walkedTo.log('INTERNAL COMPILER ERROR: Untranslated parse node'); } } this.walked = true; } - // If there is a partial ast ... + if (that.root.logger.hasErrors()) { this.response = that.fatalResponse(); return this.response; } - /* -TODO we used to scna the AST for SQL blocks here, don't need to do that -becausae that happens at the translate step, but the code I need to -understand is how a root translate can return the need of a chiold -which has an SQL block ... - -*/ // Now make sure that every child has fully translated itself // before this tree is ready to also translate ... for (const child of that.childTranslators.values()) { @@ -486,21 +454,8 @@ class MetadataStep implements TranslationStep { } catch { // Do nothing, symbols already `undefined` } - let walkHighlights: DocumentHighlight[]; - try { - walkHighlights = walkForDocumentHighlights( - tryParse.parse.tokenStream, - tryParse.parse.root - ); - } catch { - walkHighlights = []; - } this.response = { symbols, - highlights: sortHighlights([ - ...passForHighlights(tryParse.parse.tokenStream), - ...walkHighlights, - ]), final: true, }; } diff --git a/packages/malloy/src/lang/parse-tree-walkers/document-highlight-walker.ts b/packages/malloy/src/lang/parse-tree-walkers/document-highlight-walker.ts deleted file mode 100644 index cc52ad76f..000000000 --- a/packages/malloy/src/lang/parse-tree-walkers/document-highlight-walker.ts +++ /dev/null @@ -1,406 +0,0 @@ -/* - * Copyright 2023 Google LLC - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -import {CommonTokenStream, ParserRuleContext} from 'antlr4ts'; -import {ParseTreeWalker} from 'antlr4ts/tree/ParseTreeWalker'; -import {ParseTree} from 'antlr4ts/tree'; -import {MalloyParserListener} from '../lib/Malloy/MalloyParserListener'; -import * as parser from '../lib/Malloy/MalloyParser'; -import {MalloyParser} from '../lib/Malloy/MalloyParser'; -import {Token} from 'antlr4ts/Token'; -import {DocumentRange} from '../../model/malloy_types'; - -export interface DocumentHighlight { - range: DocumentRange; - type: string; -} - -// TODO maybe this could be an enum like Definition__Field, etc. -export const HighlightType = { - Identifier: 'identifier', - Type: 'type', - Literal: { - Date: 'literal.date', - Number: 'literal.number', - String: 'literal.string', - RegularExpression: 'literal.regular_expression', - Boolean: 'literal.boolean', - Null: 'literal.null', - }, - Call: { - Aggregate: 'call.aggregate', - TimeFrame: 'call.time_frame', - Cast: 'call.cast', - Table: 'call.table', - From: 'call.from', - Function: 'call.function', - FromSQL: 'call.from_sql', - }, - // TODO many of these should probably be categorized further - Keyword: { - AggregateModifier: { - Distinct: 'keyword.aggregate_modifier.distinct', - }, - CastModifier: { - As: 'keyword.cast_modifier.as', - }, - Is: 'keyword.is', - On: 'keyword.on', - Desc: 'keyword.desc', - Asc: 'keyword.asc', - Pick: 'keyword.pick', - When: 'keyword.when', - Else: 'keyword.else', - With: 'keyword.with', - // TODO or is this a meta type? - JSON: 'keyword.json', - // TODO or is this a meta type? - Turtle: 'keyword.turtle', - Import: 'keyword.import', - }, - Operator: { - Comparison: 'operator.comparison', - Boolean: 'operator.boolean', - Date: 'operator.date', - }, - Comment: { - Line: 'comment.line', - Block: 'comment.block', - }, - Property: { - Accept: 'property.accept', - Aggregate: 'property.aggregate', - Dimension: 'property.dimension', - Except: 'property.except', - Source: 'property.source', - GroupBy: 'property.group_by', - Having: 'property.having', - Index: 'property.index', - JoinOne: 'keyword.join_one', - JoinMany: 'keyword.join_many', - JoinCross: 'keyword.join_cross', - Limit: 'property.limit', - Measure: 'property.measure', - Nest: 'property.nest', - OrderBy: 'property.order_by', - PrimaryKey: 'property.primary_key', - Project: 'property.project', - Query: 'property.query', - Rename: 'property.rename', - Top: 'property.top', - Where: 'property.where', - SQL: 'property.sql', - }, -}; - -export function passForHighlights( - tokens: CommonTokenStream -): DocumentHighlight[] { - const highlights: DocumentHighlight[] = []; - const register = (token: Token, type: string, removeColon = false) => { - const offset = token.startIndex - token.charPositionInLine; - const tokenLines = token.text?.split('\n') || []; - const numberOfLines = tokenLines.length; - const lengthOfAllButLastLine = tokenLines - .slice(0, -1) - .reduce((a, l) => a + l.length, 0); - const colonAdjustment = removeColon ? 1 : 0; - highlights.push({ - type, - range: { - start: { - line: token.line - 1, - character: token.startIndex - offset, - }, - end: { - line: token.line - 1 + numberOfLines - 1, - character: - token.stopIndex + - 2 - - (numberOfLines > 1 ? token.startIndex : offset) - - lengthOfAllButLastLine - - numberOfLines - - colonAdjustment, - }, - }, - }); - }; - for (let i = 0; i < tokens.size; i++) { - const token = tokens.get(i); - - switch (token.type) { - case MalloyParser.ACCEPT: - register(token, HighlightType.Property.Accept, true); - break; - case MalloyParser.AGGREGATE: - register(token, HighlightType.Property.Aggregate, true); - break; - case MalloyParser.DIMENSION: - register(token, HighlightType.Property.Dimension, true); - break; - case MalloyParser.EXCEPT: - register(token, HighlightType.Property.Except, true); - break; - case MalloyParser.GROUP_BY: - register(token, HighlightType.Property.GroupBy, true); - break; - case MalloyParser.HAVING: - register(token, HighlightType.Property.Having, true); - break; - case MalloyParser.INDEX: - register(token, HighlightType.Property.Index, true); - break; - case MalloyParser.JOIN_CROSS: - register(token, HighlightType.Property.JoinOne, true); - break; - case MalloyParser.JOIN_ONE: - register(token, HighlightType.Property.JoinMany, true); - break; - case MalloyParser.JOIN_MANY: - register(token, HighlightType.Property.JoinCross, true); - break; - case MalloyParser.LIMIT: - register(token, HighlightType.Property.Limit, true); - break; - case MalloyParser.MEASURE: - register(token, HighlightType.Property.Measure, true); - break; - case MalloyParser.NEST: - register(token, HighlightType.Property.Nest, true); - break; - case MalloyParser.ORDER_BY: - register(token, HighlightType.Property.OrderBy, true); - break; - case MalloyParser.PRIMARY_KEY: - register(token, HighlightType.Property.PrimaryKey, true); - break; - case MalloyParser.PROJECT: - register(token, HighlightType.Property.Project, true); - break; - case MalloyParser.QUERY: - register(token, HighlightType.Property.Query, true); - break; - case MalloyParser.RENAME: - register(token, HighlightType.Property.Rename, true); - break; - case MalloyParser.SOURCE: - register(token, HighlightType.Property.Source, true); - break; - case MalloyParser.TOP: - register(token, HighlightType.Property.Top, true); - break; - case MalloyParser.WHERE: - register(token, HighlightType.Property.Where, true); - break; - case MalloyParser.SQL: - register(token, HighlightType.Property.SQL, true); - break; - case MalloyParser.TABLE: - register(token, HighlightType.Call.Table); - break; - case MalloyParser.FROM: - register(token, HighlightType.Call.From); - break; - case MalloyParser.FROM_SQL: - register(token, HighlightType.Call.FromSQL); - break; - case MalloyParser.SQ_STRING: - case MalloyParser.DQ_STRING: - register(token, HighlightType.Literal.String); - break; - case MalloyParser.NUMERIC_LITERAL: - case MalloyParser.INTEGER_LITERAL: - register(token, HighlightType.Literal.Number); - break; - case MalloyParser.HACKY_REGEX: - register(token, HighlightType.Literal.RegularExpression); - break; - case MalloyParser.IS: - register(token, HighlightType.Keyword.Is); - break; - case MalloyParser.DISTINCT: - register(token, HighlightType.Keyword.AggregateModifier.Distinct); - break; - case MalloyParser.ON: - register(token, HighlightType.Keyword.On); - break; - case MalloyParser.DESC: - register(token, HighlightType.Keyword.Desc); - break; - case MalloyParser.ASC: - register(token, HighlightType.Keyword.Asc); - break; - case MalloyParser.CAST: - register(token, HighlightType.Call.Cast); - break; - case MalloyParser.AS: - register(token, HighlightType.Keyword.CastModifier.As); - break; - case MalloyParser.PICK: - register(token, HighlightType.Keyword.Pick); - break; - case MalloyParser.WHEN: - register(token, HighlightType.Keyword.When); - break; - case MalloyParser.WITH: - register(token, HighlightType.Keyword.With); - break; - case MalloyParser.ELSE: - register(token, HighlightType.Keyword.Else); - break; - case MalloyParser.JSON: - register(token, HighlightType.Keyword.JSON); - break; - case MalloyParser.TURTLE: - register(token, HighlightType.Keyword.Turtle); - break; - case MalloyParser.TRUE: - case MalloyParser.FALSE: - register(token, HighlightType.Literal.Boolean); - break; - case MalloyParser.NOW: - case MalloyParser.LITERAL_TIMESTAMP: - case MalloyParser.LITERAL_QUARTER: - case MalloyParser.LITERAL_MONTH: - case MalloyParser.LITERAL_DAY: - case MalloyParser.LITERAL_WEEK: - case MalloyParser.LITERAL_YEAR: - register(token, HighlightType.Literal.Date); - break; - case MalloyParser.NULL: - register(token, HighlightType.Literal.Null); - break; - case MalloyParser.AND: - case MalloyParser.OR: - case MalloyParser.NOT: - register(token, HighlightType.Operator.Boolean); - break; - case MalloyParser.FOR: - register(token, HighlightType.Operator.Date); - break; - case MalloyParser.COMMENT_TO_EOL: - register(token, HighlightType.Comment.Line); - break; - case MalloyParser.BLOCK_COMMENT: - register(token, HighlightType.Comment.Block); - break; - case MalloyParser.SUM: - case MalloyParser.COUNT: - case MalloyParser.AVG: - case MalloyParser.MIN: - case MalloyParser.MAX: - register(token, HighlightType.Call.Aggregate); - break; - case MalloyParser.IDENTIFIER: - case MalloyParser.BQ_STRING: - register(token, HighlightType.Identifier); - break; - case MalloyParser.STRING: - case MalloyParser.NUMBER: - case MalloyParser.BOOLEAN: - case MalloyParser.DATE: - case MalloyParser.TIMESTAMP: - register(token, HighlightType.Type); - break; - case MalloyParser.SECOND: - case MalloyParser.MINUTE: - case MalloyParser.HOUR: - case MalloyParser.DAY: - case MalloyParser.WEEK: - case MalloyParser.MONTH: - case MalloyParser.QUARTER: - case MalloyParser.YEAR: - register(token, HighlightType.Call.TimeFrame); - break; - case MalloyParser.IMPORT: - register(token, HighlightType.Keyword.Import); - break; - - // TODO durations? How should we highlight `3 days` or - // `(1 + 2) days` or `n days`? - } - } - return highlights; -} - -class DocumentHighlightWalker implements MalloyParserListener { - constructor( - readonly tokens: CommonTokenStream, - readonly highlights: DocumentHighlight[] - ) {} - - rangeOf(pcx: ParserRuleContext) { - const stopToken = pcx.stop || pcx.start; - return { - start: { - line: pcx.start.line - 1, - character: pcx.start.charPositionInLine, - }, - end: { - line: stopToken.line - 1, - character: - stopToken.stopIndex - - (stopToken.startIndex - stopToken.charPositionInLine) + - 1, - }, - }; - } - - enterExprFunc(pcx: parser.ExprFuncContext) { - const id = pcx.id() || pcx.timeframe(); - if (id) { - this.highlights.push({ - range: this.rangeOf(id), - type: HighlightType.Call.Function, - }); - } - } -} - -export function walkForDocumentHighlights( - tokens: CommonTokenStream, - parseTree: ParseTree -): DocumentHighlight[] { - const finder = new DocumentHighlightWalker(tokens, []); - const listener: MalloyParserListener = finder; - ParseTreeWalker.DEFAULT.walk(listener, parseTree); - return finder.highlights; -} - -export function sortHighlights( - highlights: DocumentHighlight[] -): DocumentHighlight[] { - return highlights.sort((a, b) => { - if (a.range.start.line < b.range.start.line) { - return -1; - } else if (a.range.start.line > b.range.start.line) { - return 1; - } else if (a.range.start.character < b.range.start.character) { - return -1; - } else if (a.range.start.character > b.range.start.character) { - return 1; - } else { - return 0; - } - }); -} diff --git a/packages/malloy/src/lang/parse-tree-walkers/document-symbol-walker.ts b/packages/malloy/src/lang/parse-tree-walkers/document-symbol-walker.ts index 1ee6bd302..a45bb84c4 100644 --- a/packages/malloy/src/lang/parse-tree-walkers/document-symbol-walker.ts +++ b/packages/malloy/src/lang/parse-tree-walkers/document-symbol-walker.ts @@ -276,17 +276,6 @@ class DocumentSymbolWalker implements MalloyParserListener { } } - enterDefineSQLStatement(pcx: parser.DefineSQLStatementContext) { - const name = pcx.nameSQLBlock().text; - const symbol = { - range: this.translator.rangeFromContext(pcx), - name, - type: 'sql', - children: [], - }; - this.symbols.push(symbol); - } - enterImportStatement(pcx: parser.ImportStatementContext) { const name = getStringIfShort(pcx.importURL()); if (name) { diff --git a/packages/malloy/src/lang/test/locations.spec.ts b/packages/malloy/src/lang/test/locations.spec.ts index e0cb0ff75..53f49376f 100644 --- a/packages/malloy/src/lang/test/locations.spec.ts +++ b/packages/malloy/src/lang/test/locations.spec.ts @@ -184,22 +184,6 @@ describe('source locations', () => { } }); - test('pre m4 location of named SQL block', () => { - const source = markSource`##! -m4warnings\n${'sql: s is { select: """SELECT 1 as one""" }'}`; - const m = new TestTranslator(source.code); - expect(m).toParse(); - const compileSql = m.translate().compileSQL; - expect(compileSql).toBeDefined(); - if (compileSql) { - m.update({ - compileSQL: {[compileSql.name]: getSelectOneStruct(compileSql)}, - }); - expect(m).toTranslate(); - const s = m.sqlBlocks[0]; - expect(s.location).isLocationIn(source.locations[0], source.code); - } - }); - test('location of renamed field', () => { const source = markSource` source: na is a extend { @@ -256,15 +240,6 @@ describe('source locations', () => { expect(y.location).toMatchObject(source.locations[0]); }); - // Since """ strings are not single tokens, I don't know how to do this. - // test("multi line sql block token span is correct", () => { - // const sqlSource = `sql: { select: """// line 0\n//line 1\n// line 2""" }`; - // const m = new TestTranslator(sqlSource); - // expect(m).not.toParse(); - // const errList = m.errors().errors; - // expect(errList[0].at?.range.end).toEqual({ line: 2, character: 11 }); - // }); - test('undefined query location', () => { expect(model`run: ${'xyz'}`).translationToFailWith( "Reference to undefined object 'xyz'" diff --git a/packages/malloy/src/lang/test/parse.spec.ts b/packages/malloy/src/lang/test/parse.spec.ts index 717c05c42..ebe045b52 100644 --- a/packages/malloy/src/lang/test/parse.spec.ts +++ b/packages/malloy/src/lang/test/parse.spec.ts @@ -662,22 +662,6 @@ describe('sql expressions', () => { } }); - test('sql statement deprecation warning', () => { - const m = new TestTranslator( - `##! m4warnings=warn - sql: bad_sql is {select: """SELECT 1 as one"""}` - ); - const req = m.translate().compileSQL; - if (req) { - m.update({ - compileSQL: {[req.name]: getSelectOneStruct(req)}, - }); - } - expect(m).toTranslateWithWarnings( - '`sql:` statement is deprecated, use `connection_name.sql(...)` instead' - ); - }); - test('reference to sql expression in run', () => { const m = new TestTranslator(` run: bigquery.sql("""select 1 as one""") diff --git a/packages/malloy/src/lang/test/sql-block.spec.ts b/packages/malloy/src/lang/test/sql-block.spec.ts index 027ceded2..5e9309e77 100644 --- a/packages/malloy/src/lang/test/sql-block.spec.ts +++ b/packages/malloy/src/lang/test/sql-block.spec.ts @@ -25,7 +25,6 @@ import { SQLBlockSource, SQLBlockStructDef, - StructDef, isSQLBlockStruct, isSQLFragment, } from '../../model'; @@ -34,18 +33,7 @@ import {TestTranslator, aTableDef} from './test-translator'; import './parse-expects'; import {MalloyTranslator} from '../parse-malloy'; -function unlocatedStructDef(sd: StructDef): StructDef { - const ret = {...sd}; - ret.fields = sd.fields.map(f => { - const nf = {...f}; - delete nf.location; - return nf; - }); - delete ret.location; - return ret; -} - -describe('sql:', () => { +describe('sql blocks in malloy', () => { const selStmt = 'SELECT * FROM aTable'; function makeSchemaResponse(sql: SQLBlockSource): SQLBlockStructDef { const cname = sql.connection || 'bigquery'; @@ -67,38 +55,6 @@ describe('sql:', () => { }; } - test('definition', () => { - const model = new TestTranslator(` - ##! -m4warnings - sql: users IS { - select: """${selStmt}""" - connection: "aConnection" - } - `); - const needReq = model.translate(); - expect(model).toParse(); - const needs = needReq?.compileSQL; - expect(needs).toBeDefined(); - if (needs) { - const sql = makeSQLBlock([{sql: selStmt}], 'aConnection'); - expect(needs).toMatchObject(sql); - const refKey = needs.name; - expect(refKey).toBeDefined(); - if (refKey) { - const sr = makeSchemaResponse(sql); - model.update({compileSQL: {[refKey]: sr}}); - expect(model).toTranslate(); - const expectThis = unlocatedStructDef({...sr, as: 'users'}); - if (isSQLBlockStruct(expectThis)) { - expectThis.declaredSQLBlock = true; - } - const got = unlocatedStructDef(model.sqlBlocks[0]); - delete got.modelAnnotation; - expect(got).toEqual(expectThis); - } - } - }); - test('source from sql', () => { const model = new TestTranslator(` source: users is aConnection.sql("""${selStmt}""") @@ -146,29 +102,7 @@ describe('sql:', () => { it('simple turducken', () => { const m = new TestTranslator(` - ##! -m4warnings - sql: someSql is { - select: """SELECT * FROM %{ a -> { group_by: astr } } WHERE 1=1""" - } - `); - expect(m).toParse(); - const compileSql = m.translate().compileSQL; - expect(compileSql).toBeDefined(); - if (compileSql) { - const select = compileSql.select[0]; - const star = compileSql.select[1]; - const where = compileSql.select[2]; - expect(select).toEqual({sql: 'SELECT * FROM '}); - expect(isSQLFragment(star)).toBeFalsy(); - expect(where).toEqual({sql: ' WHERE 1=1'}); - } - }); - it('old style ', () => { - const m = new TestTranslator(` - ##! -m4warnings - sql: someSql is { - select: """SELECT * FROM %{ a -> { group_by: astr } } WHERE 1=1""" - } + source: someSql is _db_.sql("""SELECT * FROM %{ a -> { group_by: astr } } WHERE 1=1""") `); expect(m).toParse(); const compileSql = m.translate().compileSQL; @@ -214,22 +148,6 @@ describe('sql:', () => { `); expect(m).toParse(); }); - it('model preserved', () => { - const shouldBeOK = ` - ##! -m4warnings - source: newa is a - sql: someSql is { select: """${selStmt}""" } - source: newaa is newa - `; - const model = new TestTranslator(shouldBeOK); - expect(model).toParse(); - const needReq = model.translate(); - const needs = needReq?.compileSQL; - expect(needs).toBeDefined(); - const sql = makeSQLBlock([{sql: selStmt}]); - model.update({compileSQL: {[sql.name]: makeSchemaResponse(sql)}}); - expect(model).toTranslate(); - }); test('source from extended sql-based-source', () => { const model = new TestTranslator(` diff --git a/packages/malloy/src/lang/translate-response.ts b/packages/malloy/src/lang/translate-response.ts index b689c91db..652a8de66 100644 --- a/packages/malloy/src/lang/translate-response.ts +++ b/packages/malloy/src/lang/translate-response.ts @@ -31,7 +31,6 @@ import { import {MalloyElement} from './ast'; import {LogMessage} from './parse-log'; import {DocumentSymbol} from './parse-tree-walkers/document-symbol-walker'; -import {DocumentHighlight} from './parse-tree-walkers/document-highlight-walker'; import {DocumentCompletion} from './parse-tree-walkers/document-completion-walker'; import {DocumentHelpContext} from './parse-tree-walkers/document-help-context-walker'; @@ -77,7 +76,6 @@ interface ASTData extends ProblemResponse, NeededData, FinalResponse { export type ASTResponse = Partial; interface Metadata extends NeededData, ProblemResponse, FinalResponse { symbols: DocumentSymbol[]; - highlights: DocumentHighlight[]; } export type MetadataResponse = Partial; interface ModelAnnotationData diff --git a/packages/malloy/src/malloy.ts b/packages/malloy/src/malloy.ts index de29ebf01..afa4e6a97 100644 --- a/packages/malloy/src/malloy.ts +++ b/packages/malloy/src/malloy.ts @@ -24,7 +24,6 @@ import {RunSQLOptions} from './run_sql_options'; import { DocumentCompletion as DocumentCompletionDefinition, - DocumentHighlight as DocumentHighlightDefinition, DocumentSymbol as DocumentSymbolDefinition, LogMessage, MalloyTranslator, @@ -915,20 +914,6 @@ export class PreparedQuery implements Taggable { export class Parse { constructor(private translator: MalloyTranslator) {} - /** - * Retrieve the document highlights for the parsed document. - * - * These highlights represent the parsed tokens contained in the document, - * and may be used for syntax highlighting in an IDE, for example. - * - * @return An array of document highlights. - */ - public get highlights(): DocumentHighlight[] { - return (this.translator.metadata().highlights || []).map( - highlight => new DocumentHighlight(highlight) - ); - } - /** * Retrieve the symbols defined in the parsed document. * @@ -964,45 +949,6 @@ export class Parse { } } -/** - * A document highlight. - * - * Represents a parsed token contained in a Malloy document - * and may be used for syntax highlighting in an IDE, for example. - */ -export class DocumentHighlight { - private _range: DocumentRange; - private _type: string; - - constructor(documentHighlight: DocumentHighlightDefinition) { - this._range = new DocumentRange( - new DocumentPosition( - documentHighlight.range.start.line, - documentHighlight.range.start.character - ), - new DocumentPosition( - documentHighlight.range.end.line, - documentHighlight.range.end.character - ) - ); - this._type = documentHighlight.type; - } - - /** - * @return The range of characters this highlight spans within its source document. - */ - get range(): DocumentRange { - return this._range; - } - - /** - * @return The type of highlight, which may be any `HighlightType`. - */ - get type(): string { - return this._type; - } -} - /** * A range of characters within a Malloy document. */ From a3d5be3a3fc482b5f72ebd4ec91d5c764a8b19e4 Mon Sep 17 00:00:00 2001 From: Malloy CI Bot Date: Mon, 18 Mar 2024 20:38:43 +0000 Subject: [PATCH 2/2] Version 0.0.133-dev --- lerna.json | 2 +- package-lock.json | 48 +++++++++---------- packages/malloy-db-bigquery/package.json | 4 +- packages/malloy-db-duckdb/package.json | 4 +- packages/malloy-db-postgres/package.json | 4 +- packages/malloy-db-snowflake/package.json | 4 +- packages/malloy-db-trino/package.json | 2 +- packages/malloy-interfaces/package.json | 2 +- packages/malloy-lint/package.json | 2 +- packages/malloy-malloy-sql/package.json | 4 +- packages/malloy-render/package.json | 4 +- packages/malloy-syntax-highlight/package.json | 2 +- packages/malloy/package.json | 2 +- test/package.json | 14 +++--- 14 files changed, 49 insertions(+), 49 deletions(-) diff --git a/lerna.json b/lerna.json index c69354467..a2f694642 100644 --- a/lerna.json +++ b/lerna.json @@ -1,7 +1,7 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", "useNx": false, - "version": "0.0.132", + "version": "0.0.133", "command": { "version": { "allowBranch": "main" diff --git a/package-lock.json b/package-lock.json index a066af584..a408b5008 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28114,7 +28114,7 @@ }, "packages/malloy": { "name": "@malloydata/malloy", - "version": "0.0.132", + "version": "0.0.133", "license": "MIT", "dependencies": { "antlr4ts": "^0.5.0-alpha.4", @@ -28135,13 +28135,13 @@ }, "packages/malloy-db-bigquery": { "name": "@malloydata/db-bigquery", - "version": "0.0.132", + "version": "0.0.133", "license": "MIT", "dependencies": { "@google-cloud/bigquery": "^7.3.0", "@google-cloud/common": "^5.0.1", "@google-cloud/paginator": "^5.0.0", - "@malloydata/malloy": "^0.0.132", + "@malloydata/malloy": "^0.0.133", "gaxios": "^4.2.0" }, "engines": { @@ -28150,11 +28150,11 @@ }, "packages/malloy-db-duckdb": { "name": "@malloydata/db-duckdb", - "version": "0.0.132", + "version": "0.0.133", "license": "MIT", "dependencies": { "@duckdb/duckdb-wasm": "1.28.1-dev106.0", - "@malloydata/malloy": "^0.0.132", + "@malloydata/malloy": "^0.0.133", "@motherduck/wasm-client": "^0.4.0", "apache-arrow": "^14.0.0", "duckdb": "0.9.2", @@ -28166,10 +28166,10 @@ }, "packages/malloy-db-postgres": { "name": "@malloydata/db-postgres", - "version": "0.0.132", + "version": "0.0.133", "license": "MIT", "dependencies": { - "@malloydata/malloy": "^0.0.132", + "@malloydata/malloy": "^0.0.133", "@types/pg": "^8.6.1", "pg": "^8.7.1", "pg-query-stream": "4.2.3" @@ -28180,10 +28180,10 @@ }, "packages/malloy-db-snowflake": { "name": "@malloydata/db-snowflake", - "version": "0.0.132", + "version": "0.0.133", "license": "MIT", "dependencies": { - "@malloydata/malloy": "^0.0.132", + "@malloydata/malloy": "^0.0.133", "@types/snowflake-sdk": "^1.6.16", "generic-pool": "^3.9.0", "snowflake-sdk": "^1.9.0", @@ -28195,7 +28195,7 @@ }, "packages/malloy-db-trino": { "name": "@malloydata/db-trino", - "version": "0.0.132", + "version": "0.0.133", "license": "MIT", "dependencies": { "@malloydata/malloy": "^0.0.130", @@ -28254,7 +28254,7 @@ }, "packages/malloy-interfaces": { "name": "@malloydata/malloy-interfaces", - "version": "0.0.132", + "version": "0.0.133", "license": "MIT", "engines": { "node": ">=16" @@ -28262,7 +28262,7 @@ }, "packages/malloy-lint": { "name": "@malloydata/eslint-plugin-lint", - "version": "0.0.132", + "version": "0.0.133", "license": "MIT", "dependencies": { "@typescript-eslint/utils": "^5.59.1", @@ -28274,10 +28274,10 @@ }, "packages/malloy-malloy-sql": { "name": "@malloydata/malloy-sql", - "version": "0.0.132", + "version": "0.0.133", "license": "MIT", "dependencies": { - "@malloydata/malloy": "^0.0.132" + "@malloydata/malloy": "^0.0.133" }, "devDependencies": { "peggy": "^3.0.2" @@ -28288,11 +28288,11 @@ }, "packages/malloy-render": { "name": "@malloydata/render", - "version": "0.0.132", + "version": "0.0.133", "license": "MIT", "dependencies": { "@lit/context": "^1.1.0", - "@malloydata/malloy": "^0.0.132", + "@malloydata/malloy": "^0.0.133", "@types/luxon": "^2.4.0", "lit": "^3.0.2", "lodash": "^4.17.20", @@ -28754,7 +28754,7 @@ }, "packages/malloy-syntax-highlight": { "name": "@malloydata/syntax-highlight", - "version": "0.0.132", + "version": "0.0.133", "license": "MIT", "devDependencies": { "@types/jasmine": "^4.3.5", @@ -28804,16 +28804,16 @@ }, "test": { "name": "@malloydata/malloy-tests", - "version": "0.0.132", + "version": "0.0.133", "license": "MIT", "dependencies": { "@jest/globals": "^29.4.3", - "@malloydata/db-bigquery": "^0.0.132", - "@malloydata/db-duckdb": "^0.0.132", - "@malloydata/db-postgres": "^0.0.132", - "@malloydata/db-snowflake": "^0.0.132", - "@malloydata/malloy": "^0.0.132", - "@malloydata/render": "^0.0.132", + "@malloydata/db-bigquery": "^0.0.133", + "@malloydata/db-duckdb": "^0.0.133", + "@malloydata/db-postgres": "^0.0.133", + "@malloydata/db-snowflake": "^0.0.133", + "@malloydata/malloy": "^0.0.133", + "@malloydata/render": "^0.0.133", "jsdom": "^22.1.0", "luxon": "^2.4.0", "madge": "^6.0.0" diff --git a/packages/malloy-db-bigquery/package.json b/packages/malloy-db-bigquery/package.json index 26f61a1d8..eb3e4222d 100644 --- a/packages/malloy-db-bigquery/package.json +++ b/packages/malloy-db-bigquery/package.json @@ -1,6 +1,6 @@ { "name": "@malloydata/db-bigquery", - "version": "0.0.132", + "version": "0.0.133", "license": "MIT", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -25,7 +25,7 @@ "@google-cloud/bigquery": "^7.3.0", "@google-cloud/common": "^5.0.1", "@google-cloud/paginator": "^5.0.0", - "@malloydata/malloy": "^0.0.132", + "@malloydata/malloy": "^0.0.133", "gaxios": "^4.2.0" } } diff --git a/packages/malloy-db-duckdb/package.json b/packages/malloy-db-duckdb/package.json index ea84fbc25..2e1668f9f 100644 --- a/packages/malloy-db-duckdb/package.json +++ b/packages/malloy-db-duckdb/package.json @@ -1,6 +1,6 @@ { "name": "@malloydata/db-duckdb", - "version": "0.0.132", + "version": "0.0.133", "license": "MIT", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -41,7 +41,7 @@ }, "dependencies": { "@duckdb/duckdb-wasm": "1.28.1-dev106.0", - "@malloydata/malloy": "^0.0.132", + "@malloydata/malloy": "^0.0.133", "@motherduck/wasm-client": "^0.4.0", "apache-arrow": "^14.0.0", "duckdb": "0.9.2", diff --git a/packages/malloy-db-postgres/package.json b/packages/malloy-db-postgres/package.json index 3d44f26d9..59e89cfae 100644 --- a/packages/malloy-db-postgres/package.json +++ b/packages/malloy-db-postgres/package.json @@ -1,6 +1,6 @@ { "name": "@malloydata/db-postgres", - "version": "0.0.132", + "version": "0.0.133", "license": "MIT", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -22,7 +22,7 @@ "prepublishOnly": "npm run build" }, "dependencies": { - "@malloydata/malloy": "^0.0.132", + "@malloydata/malloy": "^0.0.133", "@types/pg": "^8.6.1", "pg": "^8.7.1", "pg-query-stream": "4.2.3" diff --git a/packages/malloy-db-snowflake/package.json b/packages/malloy-db-snowflake/package.json index 3232dbe9b..d1e0845aa 100644 --- a/packages/malloy-db-snowflake/package.json +++ b/packages/malloy-db-snowflake/package.json @@ -1,6 +1,6 @@ { "name": "@malloydata/db-snowflake", - "version": "0.0.132", + "version": "0.0.133", "license": "MIT", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -21,7 +21,7 @@ "prepublishOnly": "npm run build" }, "dependencies": { - "@malloydata/malloy": "^0.0.132", + "@malloydata/malloy": "^0.0.133", "@types/snowflake-sdk": "^1.6.16", "generic-pool": "^3.9.0", "snowflake-sdk": "^1.9.0", diff --git a/packages/malloy-db-trino/package.json b/packages/malloy-db-trino/package.json index 6b5137faa..4bbe75f62 100644 --- a/packages/malloy-db-trino/package.json +++ b/packages/malloy-db-trino/package.json @@ -1,6 +1,6 @@ { "name": "@malloydata/db-trino", - "version": "0.0.132", + "version": "0.0.133", "license": "MIT", "main": "dist/tmp_index.js", "types": "dist/tmp_index.d.ts", diff --git a/packages/malloy-interfaces/package.json b/packages/malloy-interfaces/package.json index a808c1b22..dc66e5534 100644 --- a/packages/malloy-interfaces/package.json +++ b/packages/malloy-interfaces/package.json @@ -1,6 +1,6 @@ { "name": "@malloydata/malloy-interfaces", - "version": "0.0.132", + "version": "0.0.133", "license": "MIT", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/malloy-lint/package.json b/packages/malloy-lint/package.json index d3cf5ad82..fc3197881 100644 --- a/packages/malloy-lint/package.json +++ b/packages/malloy-lint/package.json @@ -1,6 +1,6 @@ { "name": "@malloydata/eslint-plugin-lint", - "version": "0.0.132", + "version": "0.0.133", "license": "MIT", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/malloy-malloy-sql/package.json b/packages/malloy-malloy-sql/package.json index 7329acafd..05eb476a6 100644 --- a/packages/malloy-malloy-sql/package.json +++ b/packages/malloy-malloy-sql/package.json @@ -1,6 +1,6 @@ { "name": "@malloydata/malloy-sql", - "version": "0.0.132", + "version": "0.0.133", "license": "MIT", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -24,7 +24,7 @@ "prepublishOnly": "npm run build" }, "dependencies": { - "@malloydata/malloy": "^0.0.132" + "@malloydata/malloy": "^0.0.133" }, "devDependencies": { "peggy": "^3.0.2" diff --git a/packages/malloy-render/package.json b/packages/malloy-render/package.json index 6d09bcaf5..4f3ded530 100644 --- a/packages/malloy-render/package.json +++ b/packages/malloy-render/package.json @@ -1,6 +1,6 @@ { "name": "@malloydata/render", - "version": "0.0.132", + "version": "0.0.133", "license": "MIT", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -25,7 +25,7 @@ }, "dependencies": { "@lit/context": "^1.1.0", - "@malloydata/malloy": "^0.0.132", + "@malloydata/malloy": "^0.0.133", "@types/luxon": "^2.4.0", "lit": "^3.0.2", "lodash": "^4.17.20", diff --git a/packages/malloy-syntax-highlight/package.json b/packages/malloy-syntax-highlight/package.json index 9f42a8150..188c4faa7 100644 --- a/packages/malloy-syntax-highlight/package.json +++ b/packages/malloy-syntax-highlight/package.json @@ -1,6 +1,6 @@ { "name": "@malloydata/syntax-highlight", - "version": "0.0.132", + "version": "0.0.133", "description": "A package to simplify the process of developing, testing, and syncnig Malloy syntax highlighting grammars", "files": [ "grammars/**/*.tmGrammar.json", diff --git a/packages/malloy/package.json b/packages/malloy/package.json index 88fc71880..e07e718b9 100644 --- a/packages/malloy/package.json +++ b/packages/malloy/package.json @@ -1,6 +1,6 @@ { "name": "@malloydata/malloy", - "version": "0.0.132", + "version": "0.0.133", "license": "MIT", "exports": { ".": "./dist/index.js", diff --git a/test/package.json b/test/package.json index b8f399986..1d1e25009 100644 --- a/test/package.json +++ b/test/package.json @@ -21,12 +21,12 @@ }, "dependencies": { "@jest/globals": "^29.4.3", - "@malloydata/db-bigquery": "^0.0.132", - "@malloydata/db-duckdb": "^0.0.132", - "@malloydata/db-postgres": "^0.0.132", - "@malloydata/db-snowflake": "^0.0.132", - "@malloydata/malloy": "^0.0.132", - "@malloydata/render": "^0.0.132", + "@malloydata/db-bigquery": "^0.0.133", + "@malloydata/db-duckdb": "^0.0.133", + "@malloydata/db-postgres": "^0.0.133", + "@malloydata/db-snowflake": "^0.0.133", + "@malloydata/malloy": "^0.0.133", + "@malloydata/render": "^0.0.133", "jsdom": "^22.1.0", "luxon": "^2.4.0", "madge": "^6.0.0" @@ -35,5 +35,5 @@ "@types/jsdom": "^21.1.1", "@types/luxon": "^2.4.0" }, - "version": "0.0.132" + "version": "0.0.133" }