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

[WIP] Proof of concept implementation of generic repository #62

Closed
wants to merge 5 commits into from

Conversation

bartma11
Copy link

@bartma11 bartma11 commented Apr 7, 2023

WORK IN PROGRESS

Proof of concept implementation for generic repository. Unfortunately it compiles, but fails at runtime. For some reason, ZIO Environment is unable to provide Quill context for Sqlite when the next ZLayer requests a generic Quill context. Maybe someone more experienced with ZIO will have some insights.

@bartma11 bartma11 linked an issue Apr 7, 2023 that may be closed by this pull request
@adamw
Copy link
Member

adamw commented Apr 7, 2023

What's the compiler error?

@bartma11
Copy link
Author

bartma11 commented Apr 7, 2023

@adamw it compiles fine, then when running tests or launching the app, I get errors like this

java.lang.Error: Defect in zio.ZEnvironment: Could not find Quill[+SqlIdiom,+NamingStrategy] inside ZEnvironment(DbConfig -> com.softwaremill.realworld.db.DbConfig@7b8dead7, HikariDataSource -> HikariDataSource (HikariPool-62), Quill::Sqlite[+SnakeCase] -> io.getquill.jdbczio.Quill$Sqlite@3678041b, DbMigrator -> com.softwaremill.realworld.db.DbMigrator@35375778, Unit -> ())

@adamw
Copy link
Member

adamw commented Apr 7, 2023

@rucek isn't it the same as the one you encountered?

Base automatically changed from use-jdbczio-quill to master April 7, 2023 08:45
@rucek
Copy link

rucek commented Apr 12, 2023

The error I was getting was similar, but it also mentioned that the dependency was known at compile time:

java.lang.Error: Defect in zio.ZEnvironment: Set(PostgresSupport::SqlDriver) statically known to be contained within the environment are missing

I was able to figure out that it was ZIO.provideSomeLayer that was failing.

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.

Generalize quill context
4 participants