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

idea: Use Drizzle ORM #58

Open
clgeoio opened this issue Oct 10, 2023 · 1 comment
Open

idea: Use Drizzle ORM #58

clgeoio opened this issue Oct 10, 2023 · 1 comment

Comments

@clgeoio
Copy link

clgeoio commented Oct 10, 2023

Found this repo and I like what's going on! Cloudflare are certainly upping the ante these days and I'm glad to see a opinionated toolkit for it.

Have you considered using Drizzle as an ORM instead of rolling your own?
It already has a D1 adapter and also has a migration creation tool too, Drizzle Kit.
I've not used Drizzle before, but it looks like it does plenty of things that Superflare is wanting to do.

Some food for thought, excited to see where this project goes next!

@jplhomer
Copy link
Owner

It for sure seems like the hot thing right now — I haven't used it before, either.

My gut reaction is that I still prefer the syntax of AR/Eloquent queries over the more verbose syntax of ORM query builders in the JS space:

Drizzle:

// Drizzle
import { eq, lt, gte, ne } from 'drizzle-orm';
 
await db.select().from(users).where(eq(users.id, 42));
await db.select().from(users).where(lt(users.id, 42));
await db.select().from(users).where(gte(users.id, 42));
await db.select().from(users).where(ne(users.id, 42));

Superflare:

import User from './User'

await User.where('id', 42);
await User.where('id', '<', 42);
await User.where('id', '>=', 42);
await User.where('id', '!=', 42);

That said, I'll keep an open mind, especially as Drizzle gains more mindshare 👍

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

2 participants