-
Notifications
You must be signed in to change notification settings - Fork 106
Closed
Labels
bugSomething isn't workingSomething isn't workingdocumentationImprovements or additions to documentationImprovements or additions to documentationhelp wantedExtra attention is neededExtra attention is needed
Description
Version
4.0.0-beta.4.9
The Type of SQL
MySQL
Your Code
从文档中复制的代码
import { MySQL, MySqlParserVisitor } from 'dt-sql-parser'
const parser = new MySQL()
const sql = 'select id,name from user1;'
// parseTree
const tree = parser.parse(sql)
class MyVisitor extends MySqlParserVisitor {
// 重写 visitTableName 方法
visitTableName(ctx) {
let tableName = ctx.getText().toLowerCase()
console.log('TableName', tableName)
}
// 重写 visitSelectElements 方法
visitSelectElements(ctx) {
let selectElements = ctx.getText().toLowerCase()
console.log('SelectElements', selectElements)
}
}
const visitor = new MyVisitor()
visitor.visit(tree)Problem
从文档中复制的代码,在浏览器端运行报错,没有导出MySqlParserVisitor.
为什么dist/lib/spark/SparkSqlParserVisitor.js导出的是空对象呢?
export 'MySqlParserVisitor' (imported as 'MySqlParserVisitor') was not found in 'dt-sql-parser' (possible exports:
FlinkSQL, HiveSQL, ImpalaSQL, MySQL, PLSQL, PostgresSQL, SparkSQL, SyntaxContextType, TrinoSQL, legacy_cleanSql, legacy_lexer, legacy_splitSql)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdocumentationImprovements or additions to documentationImprovements or additions to documentationhelp wantedExtra attention is neededExtra attention is needed