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

ZIO Module example app #97

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

lvitaly
Copy link
Contributor

@lvitaly lvitaly commented Jan 23, 2025

Close #90

@lvitaly
Copy link
Contributor Author

lvitaly commented Jan 23, 2025

@guizmaii @AugustNagro, hey guys, please take a look if you are okay with the example. It's probably not the best, but it's a start.

And I updated it with @guizmaii's change to the Transactor layer from #93.

@KaranAhlawat
Copy link

Just chiming in, after #100 is merged into the library, it might be better to show a proper PG enum in the example instead of having color be of type text.

Depending on how far off 2.0.0 is, might be better to update and then merge.

@lvitaly
Copy link
Contributor Author

lvitaly commented Jan 23, 2025

@KaranAhlawat, it makes sense. I am okay with waiting for #100.

@lvitaly lvitaly marked this pull request as ready for review January 23, 2025 19:21
Comment on lines 46 to 52
sql"create table if not exists car (id serial primary key, model text, top_speed int, vin int, color text, created timestamp)"
.update
.run()

sql"create table if not exists owner (id serial primary key, name text, car_id int references car(id))"
.update
.run()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be nicer if we were using something like flyway. Would be more realistic

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guizmaii, do you prefer a programmatic way to run flyway or maybe a docker-compose way in pairs with the Postges container? I think the second option resonates more with this @AugustNagro's comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. I introduced docker-compose.yml with PG and Flyway and moved schema creation to the magnum-zio-example/sql/migration/V1__create_schema.sql.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you prefer a programmatic way to run flyway or maybe a docker-compose way in pairs with the Postges container?

I personally prefer the first one. It allows you to write tests testing your migrations (the docker might allow that to? 🤔)

@lvitaly lvitaly force-pushed the zio-example branch 3 times, most recently from 9623308 to 72f2bbc Compare January 27, 2025 21:35
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.

ZIO Module example app with error handling
3 participants