Open nene opened 4 weeks ago
Thanks for documenting this! I would be glad to help out if I can figure out how. If you have any time and is convenient for you, can you point me to where I can begin?
I guess you can look at existing commits to see how. This one might be a good start: https://github.com/nene/sql-parser-cst/commit/00adcae78bc799bb6aaa0b146b0d7aba9ff89590
The trickiest bit is figuring out the structure of the resulting syntax tree. For CREATE TYPE
I guess it should be something like:
export interface CreateTypeStmt extends BaseNode {
type: "create_type_stmt";
createKw: Keyword<"CREATE">;
typeKw: Keyword<"TYPE">;
name: EntityName;
// ENUM definition is probably the simplest, though others should fit here as well
definition?: AsClause<EnumTypeDefinition>;
}
export interface EnumTypeDefinition extends BaseNode {
type: "enum_type_definition";
enumKw: Keyword<"ENUM">;
values: ParenExpr<ListExpr<StringLiteral>>;
}