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

TypeScript and SQL: Six Ways to Bridge the Divide #28

Open
utterances-bot opened this issue Aug 30, 2023 · 3 comments
Open

TypeScript and SQL: Six Ways to Bridge the Divide #28

utterances-bot opened this issue Aug 30, 2023 · 3 comments

Comments

@utterances-bot
Copy link

TypeScript and SQL: Six Ways to Bridge the Divide

Effective TypeScript: TypeScript and SQL: Six Ways to Bridge the Divide

https://effectivetypescript.com/2023/08/29/sql/

Copy link

I've been trying out kysley, its pretty nice. Drizzle has come quite a ways as well. For a more full featured ORM, MikroORM is pretty slick and implements some nice patterns like Unit of Work, and the Identity Map that Prisma and TypeORM are lacking.

Copy link

Hi, great post !
I was wondering if using only the Client of Prisma to generate types and populate the database using the prisma.schema was a viable option for raw queries ?

I'm kind of newbie in this field so be gentle if I'm wrong 😅.

@danvk
Copy link
Owner

danvk commented Sep 21, 2023

@ECecillo with the big caveat that I've never used Prisma, once you use something like prisma.schema as your source of truth, you're squarely in the ORM camp. Looking at their docs on raw SQL, you can associate TypeScript types with your queries but it's up to you to make sure they're right. The beauty of PgTyped is that you write raw SQL and it does this for you. You don't need to worry about keeping the types in sync with your queries. That being said, I don't see any reason why you couldn't use PgTyped in conjunction with Prisma.

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

No branches or pull requests

4 participants