-
Notifications
You must be signed in to change notification settings - Fork 510
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: Add window function support #4283
Conversation
0a800bb
to
20e5673
Compare
Draft because it needs a new (SNAPSHOT) release after AlecKazakova/sql-psi#517 |
20e5673
to
fc85b15
Compare
846ccfc
to
dcfe6ad
Compare
…d/postgres-window # Conflicts: # gradle/libs.versions.toml
same thing for this one, what probably makes the most sense is to target one of the other PRs based on sql-psi:0.4.5 so it doesn't have to go through CI checks a second time after it merges |
...ts/postgresql/src/main/kotlin/app/cash/sqldelight/dialects/postgresql/grammar/PostgreSql.bnf
Outdated
Show resolved
Hide resolved
@@ -141,6 +155,13 @@ class PostgreSqlTypeResolver(private val parentResolver: TypeResolver) : TypeRes | |||
literalValue.text.startsWith("INTERVAL") -> IntermediateType(PostgreSqlType.INTERVAL) | |||
else -> parentResolver.resolvedType(this) | |||
} | |||
is PostgreSqlExtensionExpr -> when { | |||
windowFunctionExpr != null -> { | |||
val windowFunctionExpr = windowFunctionExpr as WindowFunctionMixin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised this works with the typo in PostgreSql.bnf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or this code is never executed because we don't try to generate types based on the window function in tests anywhere
Fixes AlecKazakova/sql-psi#313
Instead overwriting the whole select and functions expr, I used AlecKazakova/sql-psi#517 to add the new window function expr.