Your Novel instance will use the environment variable below to create a connection pool against your database.
Why not Drizzle/Prisma/TypeORM/Kysely?
Prisma uses a different DSL that you most likely would not touch frequently. It also has abstraction overhead and troubleshooting issues due to having a different runtime engine.
Drizzle has a smaller community but with comparable pedigree as knex
TypeORM is more of an ORM but also suffers from abstraction overhead. It has better support for typescript than knex.
Kysely is a newer player and have a smaller community similar to Drizzle.
import db from 'novel/db';
await db('accounts').select();
feature.ts
import db from 'novel/db';
function handler(request, reply) {
await db().session();
// this will run in a transaction
await db('accounts').where('id', 1).update({ test: 1 });
// and any db calls from required functions
await updateAccount();
}