prisma-nodejs-typescript
Starter template for Prisma ORM with TypeScript (ESM) and the MariaDB adapter.
- Language
- TypeScript
Starter template for Prisma ORM with TypeScript (ESM) and the MariaDB adapter.
Step-by-step setup for a Node.js project with Prisma, strict TypeScript on nodenext modules, and the @prisma/adapter-mariadb driver adapter.
Covers SSL database connections, pulling an existing schema, and a nodemon + tsx dev loop.
Getting Prisma, ESM TypeScript and the MariaDB adapter to work together takes a few non-obvious steps. I wrote them down once so every new service starts from a setup that already works.
npm install @prisma/client @prisma/adapter-mariadb dotenv
npm install -D prisma @types/node nodemon tsx typescriptimport 'dotenv/config';
import { PrismaMariaDb } from '@prisma/adapter-mariadb';
import { PrismaClient } from '../generated/prisma/index.js';
const adapter = new PrismaMariaDb(process.env.DATABASE_URL!);
export const prisma = new PrismaClient({ adapter });A browser demo of prisma-nodejs-typescript will live here. For now, see the repository.