Drizzle Queries marked as "[OLD]" #5570
-
|
Hello, After looking at the documentation, it appears the Prisma like syntax (https://orm.drizzle.team/docs/relations) is marked as "[OLD]". While I haven't used Drizzle in quite a while, I planned to recommend it for an upcoming project among a group of junior developers not as familiar with SQL. Since it's marked as "[OLD]", is there a similar, non-deprecated alternative? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
The relational query API (Prisma-like syntax) was replaced by a new "Relations V2" API that ships with Drizzle v1. The [OLD] tag means that specific API is being phased out in favor of the new version. That said, for a team of junior developers I'd actually recommend starting with the SQL-like query builder instead — it's the core Drizzle API and isn't going anywhere: const users = await db
.select()
.from(usersTable)
.where(eq(usersTable.role, 'admin'))
.orderBy(usersTable.createdAt);I use this in production (20+ tables, PostgreSQL) and it has a big advantage for juniors: it maps directly to SQL. They learn real query patterns instead of an abstraction layer, which pays off when they need to debug or write more complex queries with joins, subqueries, or aggregations. The relational API is convenient for nested eager loading, but the query builder handles joins explicitly and is more predictable when queries get complex. |
Beta Was this translation helpful? Give feedback.
The relational query API (Prisma-like syntax) was replaced by a new "Relations V2" API that ships with Drizzle v1. The [OLD] tag means that specific API is being phased out in favor of the new version.
That said, for a team of junior developers I'd actually recommend starting with the SQL-like query builder instead — it's the core Drizzle API and isn't going anywhere:
I use this in production (20+ tables, PostgreSQL) and it has a big advantage for juniors: it maps directly to SQL. They learn real query patterns instead of an abstraction layer, which pays off when…