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

Add dialect-specific extension point to Expr #7

Open
jdegoes opened this issue May 19, 2020 · 1 comment
Open

Add dialect-specific extension point to Expr #7

jdegoes opened this issue May 19, 2020 · 1 comment

Comments

@jdegoes
Copy link
Member

jdegoes commented May 19, 2020

Currently, Expr is closed, and subtypes of the Sql module cannot add new expressions. This is inconvenient as different dialects of SQL support different constructs.

To support extensibility, we can add a new constructor for Expr that holds a module-defined type, e.g:

type DialectSpecificExpr[Features, -Input, Output]

...

object Expr {
  ...
  sealed case class DialectSpecific[F, -A, B](dialectSpecific: DialectSpecificExpr[F, A, B]) extends Expr[F, A, B]
}

This way, a dialect that has no extension can define type DialectSpecificExpr[F, I, O] = Nothing, while others can define it to be a custom type.

@jczuchnowski
Copy link
Member

An initial approach was proposed in #309, but it had to be closed for now due to conflicts.

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