Skip to content

Conversation

@alamb
Copy link

@alamb alamb commented Aug 5, 2022

Re https://github.com/sqlparser-rs/sqlparser-rs/pull/548/files

Here is a proposed alternative (targeting your branch) that represents a PG custom operator using Vec<String> of the raw token streams and demonstrating it is more general

///
/// See [CREATE OPERATOR](https://www.postgresql.org/docs/current/sql-createoperator.html)
/// for more information.
PGCustomBinaryOperator(Vec<String>),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One downside of this approach that I can think of is that it does not restrict the initial parts of the custom operator to valid tokens

Aka this should probably really be something like

Suggested change
PGCustomBinaryOperator(Vec<String>),
PGCustomBinaryOperator{ ident: Vec<Ident>, op: String),

But I think this may be good enough?

@iskakaushik iskakaushik merged commit 7225721 into iskakaushik:postgres-custom-operator Aug 5, 2022
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

Successfully merging this pull request may close these issues.

2 participants