{"id":41569,"library":"nestjs-drizzle","title":"NestJS Drizzle","description":"NestJS Drizzle ORM Helper Module v1.1.6. Provides a seamless integration of Drizzle ORM into NestJS applications with support for multiple databases: PostgreSQL (including Neon, Vercel, Supabase), MySQL (including PlanetScale), SQLite, Turso/LibSQL. Follows NestJS module conventions with DrizzleModule.forRoot() and per-database driver imports. Ships TypeScript types. Release cadence is irregular; stable but not widely adopted. Differentiator: official Drizzle NestJS integration alternatives exist, but this package simplifies configuration with driver-specific modules.","status":"active","version":"1.1.6","language":"javascript","source_language":"en","source_url":"https://github.com/solmanter/nestjs-drizzle.git","tags":["javascript","nestjs","drizzle","orm","typescript"],"install":[{"cmd":"npm install nestjs-drizzle","lang":"bash","label":"npm"},{"cmd":"yarn add nestjs-drizzle","lang":"bash","label":"yarn"},{"cmd":"pnpm add nestjs-drizzle","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core ORM library required for all database operations","package":"drizzle-orm","optional":false},{"reason":"Required for PostgreSQL driver","package":"pg","optional":true},{"reason":"Required for Neon serverless driver","package":"@neondatabase/serverless","optional":true},{"reason":"Required for Vercel Postgres driver","package":"@vercel/postgres","optional":true},{"reason":"Required for MySQL driver","package":"mysql2","optional":true},{"reason":"Required for PlanetScale driver","package":"@planetscale/database","optional":true},{"reason":"Required for SQLite driver","package":"better-sqlite3","optional":true},{"reason":"Required for Turso/LibSQL driver","package":"@libsql/client","optional":true}],"imports":[{"note":"You must import from the driver-specific subpath (e.g., 'nestjs-drizzle/postgres') not the root package.","wrong":"import { DrizzleModule } from 'nestjs-drizzle'","symbol":"DrizzleModule","correct":"import { DrizzleModule } from 'nestjs-drizzle/postgres'"},{"note":"For MySQL and PlanetScale.","wrong":"","symbol":"DrizzleModule","correct":"import { DrizzleModule } from 'nestjs-drizzle/mysql'"},{"note":"For SQLite and Turso.","wrong":"","symbol":"DrizzleModule","correct":"import { DrizzleModule } from 'nestjs-drizzle/sqlite'"},{"note":"Use forRoot() not register().","wrong":"DrizzleModule.register({ ... })","symbol":"module options","correct":"DrizzleModule.forRoot({ schema, ... })"}],"quickstart":{"code":"// app.module.ts\nimport { Module } from '@nestjs/common';\nimport { DrizzleModule } from 'nestjs-drizzle/postgres';\nimport * as schema from './drizzle/schema';\n\n@Module({\n  imports: [\n    DrizzleModule.forRoot({\n      schema,\n      connectionString: process.env.DATABASE_URL ?? 'postgres://user:pass@localhost:5432/db',\n    }),\n  ],\n})\nexport class AppModule {}\n\n// service.ts\nimport { Injectable } from '@nestjs/common';\nimport { InjectDrizzle } from 'nestjs-drizzle/postgres';\nimport { NodePgDatabase } from 'drizzle-orm/node-postgres';\nimport * as schema from './drizzle/schema';\n\n@Injectable()\nexport class UsersService {\n  constructor(@InjectDrizzle() private readonly db: NodePgDatabase<typeof schema>) {}\n\n  async findUser(id: string) {\n    return this.db.query.users.findFirst({ where: (users, { eq }) => eq(users.id, id) });\n  }\n}","lang":"typescript","description":"Basic NestJS module setup with DrizzleModule.forRoot() and injection of Drizzle database instance."},"warnings":[{"fix":"Ensure only one forRoot() call in your app module. Use forFeature() for additional schemas if needed.","message":"Multiple DrizzleModule.forRoot() calls will throw: 'Drizzle module has already been initialized'","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Install the appropriate driver package for your database (see README).","message":"You must manually install database drivers (pg, mysql2, etc.) - they are not included as dependencies.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always import from the specific driver path like 'nestjs-drizzle/postgres' or 'nestjs-drizzle/mysql'.","message":"Import from wrong subpath (e.g., 'nestjs-drizzle' without driver) will result in 'Cannot find module' error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Update imports to use driver-specific subpaths.","message":"Old import style 'nestjs-drizzle' (without driver) was deprecated in v1.1.0","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'adopt':57 'altern':63 'applic':18 'cadenc':50 'configur':69 'convent':37 'databas':23,43 'differenti':58 'driver':44,72 'driver-specif':71 'drizzl':2,4,14,60,77 'drizzlemodule.forroot':39 'exist':64 'follow':34 'helper':6 'import':45 'includ':25,30 'integr':12,62 'irregular':52 'javascript':75 'modul':7,36,74 'multipl':22 'mysql':29 'neon':26 'nestj':1,3,17,35,61,76 'offici':59 'orm':5,15,78 'packag':67 'per':42 'per-databas':41 'planetscal':31 'postgresql':24 'provid':9 'releas':49 'seamless':11 'ship':46 'simplifi':68 'specif':73 'sqlite':32 'stabl':53 'supabas':28 'support':20 'turso/libsql':33 'type':48 'typescript':47,79 'v1.1.6':8 'vercel':27 'wide':56","created_at":"2026-06-04T18:53:02.676738+00:00","updated_at":"2026-06-04T18:53:02.676738+00:00","problems":[{"fix":"Use import { DrizzleModule } from 'nestjs-drizzle/postgres' (or mysql, sqlite).","cause":"Wrong import path - must include driver subpath.","error":"Cannot find module 'nestjs-drizzle' or its corresponding type declarations."},{"fix":"Replace DrizzleModule.register() with DrizzleModule.forRoot().","cause":"Using incorrect method name.","error":"The 'DrizzleModule' class does not have a static method 'register'."},{"fix":"Ensure only one call to DrizzleModule.forRoot() in your application.","cause":"Calling forRoot() more than once.","error":"Drizzle module has already been initialized"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/solmanter/nestjs-drizzle.git","github":"https://github.com/solmanter/nestjs-drizzle.git","docs":null,"changelog":null,"pypi":null,"npm":"nestjs-drizzle","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}