classes to access db
Is this code possible? Copilot says it's valid but I cannot find it in the documentation
4 Replies
unfortunately, that is not how drizzle works. i would highly recommend reading through the docs, which can be found here: https://orm.drizzle.team/docs/overview
Drizzle ORM - Overview
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
BTW, are you aware of any examples in js/ts using OOP with drizzle-orm to create standard CRUD operations? thx!
as of right now, there only consists of the standard SQL-like syntax syntax and the Queries API. however, currently the queries API only supports
findFirst
and findMany
operations and all other CRUD operations (create, update, delete) require the SQL-like syntax.
create/insert: https://orm.drizzle.team/docs/insert
update: https://orm.drizzle.team/docs/update
delete: https://orm.drizzle.team/docs/delete
in my opinion, the docs are the best place to learn majority, if not the whole of drizzle. from using the docs, i myself have managed to learn quite a lot of how to use it.Drizzle ORM - Insert
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
Drizzle ORM - Update
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
Drizzle ORM - Delete
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
my apologies for the constant acknowledgement of the docs, i just think its the best place to learn the ins and outs of the library.