Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres support (user defined types) #78

Open
3 tasks
Tracked by #40
nene opened this issue Apr 15, 2024 · 2 comments
Open
3 tasks
Tracked by #40

Postgres support (user defined types) #78

nene opened this issue Apr 15, 2024 · 2 comments

Comments

@nene
Copy link
Owner

nene commented Apr 15, 2024

This was referenced Apr 15, 2024
@maheshsundaram
Copy link

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?

@nene
Copy link
Owner Author

nene commented Apr 16, 2024

I guess you can look at existing commits to see how. This one might be a good start: 00adcae

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>>;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants