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

Implement static operator for splicing constants #16

Merged
merged 1 commit into from
Aug 17, 2021

Conversation

deusaquilus
Copy link
Contributor

Want to be able to do (in an upstream compilation unit):

object PreCompileConstant {
  val SomeConst = "Blah"
}

And then...

quote { foo == static(PreCompileConstant.SomeConst) }

The value "Blah" should be spliced directly into the compile-time query. Quill should look it up and use it because it has already been compiled.

Additionally, there should be a want to implement this kind of splicing in a customizable way. If a user has a custom datatype (e.g. a custom enum), they should be able to create a implicit instance of a StaticSplice[MyDatatype]
(also in an upstream compilation unit) and then have the value of that automatically looked up and spliced into the compile-time sql query.

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.

1 participant