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

Make Lit depend on the backend #28

Open
Kamirus opened this issue Dec 17, 2019 · 2 comments
Open

Make Lit depend on the backend #28

Kamirus opened this issue Dec 17, 2019 · 2 comments
Assignees
Labels
expression-level Change related to database expressions `Col s a` pg Related with the PG backend sqlite3 Related with the SQLite3 backend

Comments

@Kamirus
Copy link
Owner

Kamirus commented Dec 17, 2019

  • remove litF and merge it with lit
  • typeclass Lit should depend on the backend
@Kamirus Kamirus added enhancement pg Related with the PG backend sqlite3 Related with the SQLite3 backend labels Dec 17, 2019
@Kamirus Kamirus self-assigned this Dec 17, 2019
@Kamirus
Copy link
Owner Author

Kamirus commented Jun 5, 2020

rename litF -> litPG
Document lit (creates concrete strings) and litPG

@Kamirus Kamirus modified the milestone: 0.2.0 Jun 5, 2020
@Kamirus
Copy link
Owner Author

Kamirus commented Jun 30, 2020

Update on: Making lit depend on the backend

There's an implementation on the scope-as-backend branch.

Features:

  • lit can be used to handle both old lit and litPG cases
  • types that indicate backends are encoded into s scope
  • using lit over litPG defers a choice which backend to use, but it generates an unsolved constraint
  • using lit for basic backend-agnostic types like String, Int should still solve constraints immediately

Insights:

  • the type class Lit has an additional type parameter - s - so it now depends on the scope
  • the scope now additionally indicates what backend is used - it carries this information so we don't need yet another type parameter
  • backend is determined based on the function used to execute a query e.g. Selda.PG.Class.query requires an argument of type FullQuery B { | i } where B = BackendPGClass

@Kamirus Kamirus added expression-level Change related to database expressions `Col s a` and removed enhancement labels Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
expression-level Change related to database expressions `Col s a` pg Related with the PG backend sqlite3 Related with the SQLite3 backend
Projects
None yet
Development

No branches or pull requests

1 participant