Creating a Database Service with Effect and Drizzle ORM in Next.js
Hi all, in my Next.js app, I am using drizzle ORM to talk to Supabase database.
Here is how the
And I am using the exported
I don't want to import the
While going through Effect's GitHub REDAME, I came across two packages:
I would appreciate if anyone can explain in simple words how these different pieces fit together. Thanks.
Here is how the
db/index.ts file looks like:And I am using the exported
db like this:I don't want to import the
db to every function where I need to interact with the database, so I want to create a database Service using the Effect Service API. While going through Effect's GitHub REDAME, I came across two packages:
@effect/sql and @effect/sql-drizzle. Should I be using these packages to create the Service? What purpose do they solve? Anyone has got any code samples I can refer to?I would appreciate if anyone can explain in simple words how these different pieces fit together. Thanks.
