Accessing a database

Use Prisma schemas and Kysely for ubiquitous database access. Different platforms/modules can extend the schema as needed.

Be sure to get some observability tooling around your queries.

It’s up to you how you choose to implement your database access. It’s a good idea to put the boilerplate for setting up the database in its own module. Queries can be defined as actions, so you can have type-safety and universal support for the logic.

Further reading