Service
How to use database in service
To get access to the database in a service, you need to inject the DatabaseService
into the service constructor.
Query
VitNode supports query by Drizzle ORM in service to get data with relations from the database.
Check Drizzle ORM documentation - Query for more information.
Select
Check Drizzle ORM documentation - Select for more information.
Insert
Check Drizzle ORM documentation - Insert for more information.
Update
Check Drizzle ORM documentation - Update for more information.
Delete
Check Drizzle ORM documentation - Delete for more information.
Operations
Drizzle ORM documentation - Operations supports many operations like eq
, neq
, gt
, gte
, lt
, lte
, in
, nin
, like
, ilike
, is
, isNot
, between
, notBetween
, etc.
Joins
Check Drizzle ORM documentation - Joins for more information.
Magic SQL
You can use magic SQL to create raw SQL query with Drizzle ORM.
Check Drizzle ORM documentation - Magic SQL for more information.