Last 12 weeks · 0 commits
2 of 6 standards met
Repository: drizzle-team/drizzle-prisma-generator. Description: Generate Drizzle schema from Prisma schema Stars: 35, Forks: 15. Primary language: TypeScript. Languages: TypeScript (95.2%), JavaScript (4.8%). License: Apache-2.0. Homepage: https://www.npmjs.com/package/drizzle-prisma-generator Topics: database, drizzle-orm, mysql, nodejs, postgresql, prisma, sql, sqlite, typescript. Latest release: 0.1.7 (1y ago). Open PRs: 11, open issues: 5. Last activity: 1y ago. Community health: 37%. Top contributors: Sukairo-02.
⚠️ Breaking Change - Drizzle ORM 1.0.0-beta.1 This PR introduces breaking changes to support Drizzle ORM 1.0.0-beta.1's new API. ## Summary This PR adds SQL Server (MSSQL) support to the generator and updates all database generators (PostgreSQL, MySQL, SQLite, MSSQL) to be compatible with Drizzle ORM's 1.0 beta release, which introduces the new API. Additionally, it includes a comprehensive test suite and critical bug fixes. ## Key Changes ### New Features SQL Server (MSSQL) Support (b4dea8f) Added complete MSSQL schema generator () Support for MSSQL-specific types: , , , , , , etc. Proper handling of MSSQL constraints and defaults Updated provider detection to include ### Breaking Changes Drizzle ORM 1.0 Beta Compatibility (cb2b0ba) Migrated all generators from individual exports to single export Updated relation syntax from to Changed internal data structure from to Added Set to track which tables have relations All generators now generate: ### Bug Fixes Fixed Falsy Default Values (ab32f63) Critical fix: Changed to Now correctly handles falsy default values like , , and Affected all generators: PostgreSQL, MySQL, SQLite, MSSQL Added null checks to prevent undefined value errors in MSSQL generator ### Testing Comprehensive Test Suite (e7b04f2) Added 118 tests across all 4 database generators (100% passing) Test coverage includes: Basic table generation All Prisma → Drizzle type mappings Default values (including edge cases) Relations and foreign keys Delete actions (Cascade, SetNull, SetDefault, Restrict, NoAction) Enums (MySQL and PostgreSQL) Unique constraints and indexes Edge cases (empty models, models without relations) Set up Vitest with for interactive testing Added test scripts: , , ### Documentation Updated README.md to document SQL Server support (f3a65d7) Added comprehensive TEST_SUMMARY.md documenting test setup and results Fixed documentation typos (1de4b20) ## Files Changed New Files: SQL Server generator Test suites for all 4 generators Shared test fixtures Vitest configuration Test documentation Modified Files: Updated for defineRelations + bug fixes Updated for defineRelations + bug fixes Updated for defineRelations + bug fixes Added MSSQL provider support Code improvements Updated documentation ## Test Results ✓ src/util/generators/tests/mssql.test.ts (27 tests) ✓ src/util/generators/tests/mysql.test.ts (30 tests) ✓ src/util/generators/tests/pg.test.ts (33 tests) ✓ src/util/generators/tests/sqlite.test.ts (28 tests) Test Files 4 passed (4) Tests 118 passed (118) ## Migration Guide For users upgrading to this version: 1. Drizzle ORM Update Required: Ensure you're using Drizzle ORM 1.0 beta or later 2. Generated Code Changes: Your generated schema will change to use instead of individual relation exports 3. Import Changes: Update your imports from individual relation exports to the single export Before:** After: Breaking Changes Generated relation code structure has changed due to Drizzle ORM 1.0 beta If you have code that imports individual relation exports, you'll need to update to import from the single relations export Supported Databases PostgreSQL MySQL SQLite SQL Server (MSSQL) - NEW Stats: 18 files changed, 7302 insertions(+), 952 deletions(-)