npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ormbridge

v0.15.0

Published

Convert ORM models between frameworks and languages (Django, Prisma, TypeORM, Doctrine, Laravel). Define your data model once and share typed schemas across your stack.

Readme

ormbridge

Table of Contents

| Overview | Getting Started | More Information | Buy Me a Coffee | License | Copyright |

Overview

ormbridge converts data models from one Object-Relational Mapper (ORM) to another. You define a model once and share it across your whole stack. Use it from the command line or from code.

It reads source files with tree-sitter, so you do not need Python, PHP, Go, or a database. The default preserve mode keeps your table and column names, so a new tool can sit on top of the database you already have. When something cannot be converted, ormbridge prints a warning that names the model and field.

| Format | Read | Write | Notes | | --------------------------- | :--: | :---: | ------------------------------------------------------------------------------------------------------------------------------------ | | Django models | ✔ | ✔ | models.py files or models/ packages | | Prisma schema | ✔ | ✔ | All six providers; Prisma 7 header with --prisma-version 7 | | TypeORM entities | ✔ | ✔ | Decorator-based entity classes | | Doctrine ORM entities (PHP) | ✔ | ✔ | PHP 8 attributes; one file per entity | | Laravel (PHP) | ✔ | ✔ | Reads migrations plus Eloquent models; writes both | | GORM (Go) | ✔ | ✔ | Structs with gorm tags; one file per model | | Drizzle ORM (TypeScript) | ✔ | ✔ | pgTable, mysqlTable, sqliteTable plus relations() | | Zod schemas (TypeScript) | ✔ | ✔ | Reads Zod 3 and Zod 4 z.object schemas; writes Zod 4 schemas and inferred types | | JSON Schema / OpenAPI | ✔ | ✔ | Draft 2020-12, 2019-09 and 7, and OpenAPI components.schemas (JSON) | | SQL DDL | ✔ | ✔ | Tables and migrations: PostgreSQL, CockroachDB, MySQL, SQLite, SQL Server, ClickHouse (write only) | | SQLAlchemy / SQLModel | ✔ | ✔ | SQLAlchemy 2.0 (declarative, Column(), Table()) and SQLModel | | Sequelize (JavaScript/TS) | ✔ | ✔ | Sequelize 6 and 7, sequelize-cli migrations; writes TypeScript, sequelize-cli (--style define) or v7 decorators (--style v7) | | Entity Framework Core (C#) | ✔ | ✔ | EF Core 8: annotations or --style fluent, a DbContext; replays migrations; OwnsMany | | Hibernate / JPA (Java) | ✔ | ✔ | Hibernate 6 jakarta or 5 --style javax; @EmbeddedId keys; Lombok option | | TypeScript interfaces | | ✔ | Plain interfaces and enums for front ends | | Graphene (graphene-django) | | ✔ | GraphQL types, queries and mutations that pair with Django | | Neo4j (Cypher) | | ✔ | Node constraints and indexes; relationships as comments; --style enterprise for Enterprise | | Spring Data Neo4j (Java) | | ✔ | SDN 7 for Spring Boot 3: @Node, @Relationship, @RelationshipProperties classes | | neomodel (Python, Neo4j) | | ✔ | StructuredNode classes, relationships with cardinality, StructuredRel for join tables |

Each format has a guide and a runnable example project.

Back to Top

Getting Started

Prerequisites

  • Node.js 20 or newer.

Installation

npm install --global ormbridge

You can also run it without installing: npx ormbridge convert ....

Usage

Run ormbridge convert with an input, an output, and optionally the formats:

ormbridge convert -i ./shop/models.py -o ./prisma/schema.prisma

Django (.py), Prisma (.prisma), and SQL (.sql) files are detected from the file extension. For every other format, add --from or --to. List all formats with ormbridge formats.

Useful options:

  • --naming preserve|normalize: keep existing names (default), or write singular snake_case names with UUID keys.
  • --provider <name>: the database to target: postgresql, mysql, sqlite, sqlserver, mongodb, cockroachdb or clickhouse. cockroachdb keeps the PostgreSQL types and warns about every difference (64-bit integers, unique_rowid() keys, no hstore or range types). MariaDB and Percona Server are MySQL-compatible, so use mysql for them. clickhouse is written by --to sql only.
  • --dry-run: show what would be written, and write nothing.
  • --check: exit with code 3 if an output file is out of date. Use it in Continuous Integration (CI).

You can keep your settings in an ormbridge.config.json file. See the command line reference for every option, the config file, and exit codes.

Examples

Prisma to Django:

ormbridge convert -i ./prisma/schema.prisma -o ./shop/models.py

A TypeORM project to Prisma (a folder needs --from):

ormbridge convert --from typeorm -i ./src/entities -o ./prisma/schema.prisma

Prisma to Zod schemas, and Zod schemas to Prisma (a folder needs --from zod):

ormbridge convert -i ./prisma/schema.prisma --to zod -o ./src/schemas.ts
ormbridge convert --from zod -i ./src/schemas -o ./prisma/schema.prisma

Prisma to a Neo4j Cypher schema (constraints and indexes; --style enterprise adds Enterprise Edition statements):

ormbridge convert -i ./prisma/schema.prisma --to neo4j -o ./neo4j/schema.cypher

Prisma to Spring Data Neo4j entities (Java, for Neo4j):

ormbridge convert -i ./prisma/schema.prisma --to sdn -o ./src/main/java

Prisma to neomodel classes (Python, for Neo4j):

ormbridge convert -i ./prisma/schema.prisma --to neomodel -o ./app/models.py

Fail a build when generated files are out of date:

npx ormbridge convert --check

Use it from code:

import { convertText } from 'ormbridge';

const result = await convertText(
  [{ path: 'schema.prisma', text: prismaSource }],
  {
    from: 'prisma',
    to: 'django',
    naming: 'preserve',
    provider: 'postgresql',
    header: true,
    autoField: 'int',
  }
);
if (result.ok) {
  console.log(result.value.output);
}

The API reference lists every function. Each folder in examples/ is a project you can run.

Back to Top

More Information

Back to Top

Buy Me a Coffee

If this app, code, or repository has helped you or someone you know, please consider donating. I appreciate any help to offset the costs of development and/or AI Credits.

Donate via Stripe, or scan:

Donate via Stripe

Back to Top

License

MIT

Back to Top

Copyright

(c)2026 Richard McQuiston. All rights reserved.

Back to Top