{"_id":"@adlanarifzr/mikro-orm-sql","_rev":"3-5b18dc94104ed2039c4fa3e5c13c020e","name":"@adlanarifzr/mikro-orm-sql","dist-tags":{"next":"7.0.5-next.0","latest":"7.0.9"},"versions":{"7.0.5-next.0":{"name":"@adlanarifzr/mikro-orm-sql","version":"7.0.5-next.0","keywords":["data-mapper","ddd","entity","identity-map","javascript","js","mariadb","mikro-orm","mongo","mongodb","mysql","orm","postgresql","sqlite","sqlite3","ts","typescript","unit-of-work"],"author":{"name":"Martin Adámek"},"license":"MIT","_id":"@adlanarifzr/mikro-orm-sql@7.0.5-next.0","maintainers":[{"name":"adlanarifzr","email":"adlanarifzr@gmail.com"}],"homepage":"https://mikro-orm.io","bugs":{"url":"https://github.com/mikro-orm/mikro-orm/issues"},"dist":{"shasum":"fea8f0b3d401f6da1ab9486e8f674a07eb6142bd","tarball":"https://registry.npmjs.org/@adlanarifzr/mikro-orm-sql/-/mikro-orm-sql-7.0.5-next.0.tgz","fileCount":107,"integrity":"sha512-kx2NBIK8VyS+7+IixBitOJAKlYvv9zOGPtU3UQ8TGSpLPPGQCQ9uBs+NPygbcasvb/RINX5pRyihhEduvHTcLw==","signatures":[{"sig":"MEYCIQC5Cb4ToeNgFemCh1RdzG5IW2TQdXvLbBTnos/8k2n8xAIhAP/ddvQELnzyMtWwARYFZF6vMsTA/mhofDEfrsNGTzjr","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":852172},"type":"module","types":"./index.d.ts","engines":{"node":">= 22.17.0"},"exports":{".":"./index.js","./package.json":"./package.json"},"gitHead":"eedace94986f505c3e0ef28c68c89fef87597e5a","scripts":{"copy":"node ../../scripts/copy.mjs","build":"yarn compile && yarn copy","clean":"yarn run -T rimraf ./dist ./tsconfig.build.tsbuildinfo","compile":"yarn run -T tsc -p tsconfig.build.json"},"_npmUser":{"name":"adlanarifzr","email":"adlanarifzr@gmail.com"},"repository":{"url":"git+ssh://git@github.com/mikro-orm/mikro-orm.git","type":"git"},"_npmVersion":"11.9.0","description":"TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.","directories":{},"_nodeVersion":"24.14.0","dependencies":{"kysely":"0.28.14"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@mikro-orm/core":"^7.0.5"},"peerDependencies":{"@mikro-orm/core":"7.0.5"},"_npmOperationalInternal":{"tmp":"tmp/mikro-orm-sql_7.0.5-next.0_1774439476742_0.6013967216613056","host":"s3://npm-registry-packages-npm-production"}},"7.0.6":{"name":"@adlanarifzr/mikro-orm-sql","version":"7.0.6","keywords":["data-mapper","ddd","entity","identity-map","javascript","js","mariadb","mikro-orm","mongo","mongodb","mysql","orm","postgresql","sqlite","sqlite3","ts","typescript","unit-of-work"],"author":{"name":"Martin Adámek"},"license":"MIT","_id":"@adlanarifzr/mikro-orm-sql@7.0.6","maintainers":[{"name":"adlanarifzr","email":"adlanarifzr@gmail.com"}],"homepage":"https://mikro-orm.io","bugs":{"url":"https://github.com/mikro-orm/mikro-orm/issues"},"dist":{"shasum":"14c18277e95b96324ef6da789745a75dfb9edc8a","tarball":"https://registry.npmjs.org/@adlanarifzr/mikro-orm-sql/-/mikro-orm-sql-7.0.6.tgz","fileCount":107,"integrity":"sha512-24WUtcPM5iztfObpZhgCvTOpJSiQhfE4pdypt8O4a83zo/+iKVHNlEsKf8KBXF2wSMxXAGHnW//xepbMVd2HIQ==","signatures":[{"sig":"MEYCIQDQOX7m7vMWp4eK+38XbgELQ5yXh4z9Pd3iysP62FggBwIhAI2+RyNStUtpjX1YG/FBiZpbAJIwQy19cjPxfk4afckt","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":858206},"type":"module","types":"./index.d.ts","engines":{"node":">= 22.17.0"},"exports":{".":"./index.js","./package.json":"./package.json"},"gitHead":"d778ca6ff173b6d689d91ecd62ff9be3addbc5ad","scripts":{"copy":"node ../../scripts/copy.mjs","build":"yarn compile && yarn copy","clean":"yarn run -T rimraf ./dist ./tsconfig.build.tsbuildinfo","compile":"yarn run -T tsc -p tsconfig.build.json"},"_npmUser":{"name":"adlanarifzr","email":"adlanarifzr@gmail.com"},"repository":{"url":"git+ssh://git@github.com/mikro-orm/mikro-orm.git","type":"git"},"_npmVersion":"11.9.0","description":"TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.","directories":{},"_nodeVersion":"24.14.0","dependencies":{"kysely":"0.28.14"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@mikro-orm/core":"^7.0.6"},"peerDependencies":{"@mikro-orm/core":"7.0.6"},"_npmOperationalInternal":{"tmp":"tmp/mikro-orm-sql_7.0.6_1774885851987_0.8435985748456214","host":"s3://npm-registry-packages-npm-production"}},"7.0.9":{"name":"@adlanarifzr/mikro-orm-sql","version":"7.0.9","description":"TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.","keywords":["data-mapper","ddd","entity","identity-map","javascript","js","mariadb","mikro-orm","mongo","mongodb","mysql","orm","postgresql","sqlite","sqlite3","ts","typescript","unit-of-work"],"homepage":"https://mikro-orm.io","bugs":{"url":"https://github.com/mikro-orm/mikro-orm/issues"},"license":"MIT","author":{"name":"Martin Adámek"},"repository":{"type":"git","url":"git+ssh://git@github.com/mikro-orm/mikro-orm.git"},"type":"module","exports":{"./package.json":"./package.json",".":"./index.js"},"publishConfig":{"access":"public"},"scripts":{"build":"yarn compile && yarn copy","clean":"yarn run -T rimraf ./dist ./tsconfig.build.tsbuildinfo","compile":"yarn run -T tsc -p tsconfig.build.json","copy":"node ../../scripts/copy.mjs"},"dependencies":{"kysely":"0.28.15"},"devDependencies":{"@mikro-orm/core":"^7.0.9"},"peerDependencies":{"@mikro-orm/core":"7.0.9"},"engines":{"node":">= 22.17.0"},"gitHead":"56304ead196c3098853b9c18320e966bcadecc32","types":"./index.d.ts","_id":"@adlanarifzr/mikro-orm-sql@7.0.9","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-B4mg9j34qycCxfeaCJV3RcbNB6XwRuGfjHbMx5sQfkr+hT+hx1BsrO/234Mygrm7Y5UNfzR/jxWsmXVy6DNS2A==","shasum":"ec01cb3feb43f30e7216b3a28a32e1e889b49d52","tarball":"https://registry.npmjs.org/@adlanarifzr/mikro-orm-sql/-/mikro-orm-sql-7.0.9.tgz","fileCount":107,"unpackedSize":861782,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIClch2vFeukUECSTxtwP9RULpRq7AzsvQT6VEOaEK/A1AiEAnZSPegsjVKrSHe2fBtYFureBpyaTh+dOfDMzVX2hRoI="}]},"_npmUser":{"name":"adlanarifzr","email":"adlanarifzr@gmail.com"},"directories":{},"maintainers":[{"name":"adlanarifzr","email":"adlanarifzr@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mikro-orm-sql_7.0.9_1775708449029_0.867898331674416"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-25T11:51:16.601Z","modified":"2026-04-09T04:20:49.330Z","7.0.5-next.0":"2026-03-25T11:51:16.971Z","7.0.6":"2026-03-30T15:50:52.261Z","7.0.9":"2026-04-09T04:20:49.200Z"},"bugs":{"url":"https://github.com/mikro-orm/mikro-orm/issues"},"author":{"name":"Martin Adámek"},"license":"MIT","homepage":"https://mikro-orm.io","keywords":["data-mapper","ddd","entity","identity-map","javascript","js","mariadb","mikro-orm","mongo","mongodb","mysql","orm","postgresql","sqlite","sqlite3","ts","typescript","unit-of-work"],"repository":{"type":"git","url":"git+ssh://git@github.com/mikro-orm/mikro-orm.git"},"description":"TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.","maintainers":[{"name":"adlanarifzr","email":"adlanarifzr@gmail.com"}],"readme":"<h1 align=\"center\">\n  <a href=\"https://mikro-orm.io\"><img src=\"https://raw.githubusercontent.com/mikro-orm/mikro-orm/master/docs/static/img/logo-readme.svg?sanitize=true\" alt=\"MikroORM\" /></a>\n</h1>\n\nTypeScript ORM for Node.js based on Data Mapper, [Unit of Work](https://mikro-orm.io/docs/unit-of-work/) and [Identity Map](https://mikro-orm.io/docs/identity-map/) patterns. Supports MongoDB, MySQL, MariaDB, PostgreSQL, SQLite (including libSQL), MSSQL and Oracle databases.\n\n> Heavily inspired by [Doctrine](https://www.doctrine-project.org/) and [Hibernate](https://hibernate.org/).\n\n[![NPM version](https://img.shields.io/npm/v/@mikro-orm/core.svg)](https://npmx.dev/package/@mikro-orm/core)\n[![NPM dev version](https://img.shields.io/npm/v/@mikro-orm/core/next.svg)](https://npmx.dev/package/@mikro-orm/core)\n[![Chat on discord](https://img.shields.io/discord/1214904142443839538?label=discord&color=blue)](https://discord.gg/w8bjxFHS7X)\n[![Downloads](https://img.shields.io/npm/dm/@mikro-orm/core.svg)](https://npmx.dev/package/@mikro-orm/core)\n[![Coverage Status](https://img.shields.io/coveralls/mikro-orm/mikro-orm.svg)](https://coveralls.io/r/mikro-orm/mikro-orm?branch=master)\n[![Build Status](https://github.com/mikro-orm/mikro-orm/workflows/tests/badge.svg?branch=master)](https://github.com/mikro-orm/mikro-orm/actions?workflow=tests)\n\n## Quick Start\n\nInstall a driver package for your database:\n\n```sh\nnpm install @mikro-orm/postgresql   # PostgreSQL\nnpm install @mikro-orm/mysql        # MySQL\nnpm install @mikro-orm/mariadb      # MariaDB\nnpm install @mikro-orm/sqlite       # SQLite\nnpm install @mikro-orm/libsql       # libSQL / Turso\nnpm install @mikro-orm/mongodb      # MongoDB\nnpm install @mikro-orm/mssql        # MS SQL Server\nnpm install @mikro-orm/oracledb     # Oracle\n```\n\n> If you use additional packages like `@mikro-orm/cli`, `@mikro-orm/migrations`, or `@mikro-orm/entity-generator`, install `@mikro-orm/core` explicitly as well. See the [quick start guide](https://mikro-orm.io/docs/quick-start) for details.\n\n### Define Entities\n\nThe recommended way to define entities is using [`defineEntity`](https://mikro-orm.io/docs/define-entity) with `setClass`:\n\n```typescript\nimport { defineEntity, p, MikroORM } from '@mikro-orm/postgresql';\n\nconst AuthorSchema = defineEntity({\n  name: 'Author',\n  properties: {\n    id: p.integer().primary(),\n    name: p.string(),\n    email: p.string(),\n    born: p.datetime().nullable(),\n    books: () => p.oneToMany(Book).mappedBy('author'),\n  },\n});\n\nexport class Author extends AuthorSchema.class {}\nAuthorSchema.setClass(Author);\n\nconst BookSchema = defineEntity({\n  name: 'Book',\n  properties: {\n    id: p.integer().primary(),\n    title: p.string(),\n    author: () => p.manyToOne(Author).inversedBy('books'),\n  },\n});\n\nexport class Book extends BookSchema.class {}\nBookSchema.setClass(Book);\n```\n\nYou can also define entities using [decorators](https://mikro-orm.io/docs/using-decorators) or [`EntitySchema`](https://mikro-orm.io/docs/define-entity#entityschema-low-level-api). See the [defining entities guide](https://mikro-orm.io/docs/defining-entities) for all options.\n\n### Initialize and Use\n\n```typescript\nimport { MikroORM, RequestContext } from '@mikro-orm/postgresql';\n\nconst orm = await MikroORM.init({\n  entities: [Author, Book],\n  dbName: 'my-db',\n});\n\n// Create new entities\nconst author = orm.em.create(Author, {\n  name: 'Jon Snow',\n  email: 'snow@wall.st',\n});\nconst book = orm.em.create(Book, {\n  title: 'My Life on The Wall',\n  author,\n});\n\n// Flush persists all tracked changes in a single transaction\nawait orm.em.flush();\n```\n\n### Querying\n\n```typescript\n// Find with relations\nconst authors = await orm.em.findAll(Author, {\n  populate: ['books'],\n  orderBy: { name: 'asc' },\n});\n\n// Type-safe QueryBuilder\nconst qb = orm.em.createQueryBuilder(Author);\nconst result = await qb\n  .select('*')\n  .where({ books: { title: { $like: '%Wall%' } } })\n  .getResult();\n```\n\n### Request Context\n\nIn web applications, use `RequestContext` to isolate the identity map per request:\n\n```typescript\nconst app = express();\n\napp.use((req, res, next) => {\n  RequestContext.create(orm.em, next);\n});\n```\n\nMore info about `RequestContext` is described [here](https://mikro-orm.io/docs/identity-map/#request-context).\n\n## Unit of Work\n\n> Unit of Work maintains a list of objects (_entities_) affected by a business transaction\n> and coordinates the writing out of changes. [(Martin Fowler)](https://www.martinfowler.com/eaaCatalog/unitOfWork.html)\n\nWhen you call `em.flush()`, all computed changes are queried inside a database transaction. This means you can control transaction boundaries simply by making changes to your entities and calling `flush()` when ready.\n\n```typescript\nconst author = await em.findOneOrFail(Author, 1, {\n  populate: ['books'],\n});\nauthor.name = 'Jon Snow II';\nauthor.books.getItems().forEach(book => book.title += ' (2nd ed.)');\nauthor.books.add(orm.em.create(Book, { title: 'New Book', author }));\n\n// Flush computes change sets and executes them in a single transaction\nawait em.flush();\n```\n\nThe above flush will execute:\n\n```sql\nbegin;\nupdate \"author\" set \"name\" = 'Jon Snow II' where \"id\" = 1;\nupdate \"book\"\n  set \"title\" = case\n    when (\"id\" = 1) then 'My Life on The Wall (2nd ed.)'\n    when (\"id\" = 2) then 'Another Book (2nd ed.)'\n    else \"title\" end\n  where \"id\" in (1, 2);\ninsert into \"book\" (\"title\", \"author_id\") values ('New Book', 1);\ncommit;\n```\n\n## Core Features\n\n- [Clean and Simple Entity Definition](https://mikro-orm.io/docs/defining-entities) — decorators, `EntitySchema`, or `defineEntity`\n- [Identity Map](https://mikro-orm.io/docs/identity-map) and [Unit of Work](https://mikro-orm.io/docs/unit-of-work) — automatic change tracking\n- [Entity References](https://mikro-orm.io/docs/entity-references) and [Collections](https://mikro-orm.io/docs/collections)\n- [QueryBuilder](https://mikro-orm.io/docs/query-builder) and [Kysely Integration](https://mikro-orm.io/docs/kysely)\n- [Transactions](https://mikro-orm.io/docs/transactions) and [Cascading](https://mikro-orm.io/docs/cascading)\n- [Populating Relations](https://mikro-orm.io/docs/populating-relations) and [Loading Strategies](https://mikro-orm.io/docs/loading-strategies)\n- [Filters](https://mikro-orm.io/docs/filters) and [Lifecycle Hooks](https://mikro-orm.io/docs/events#hooks)\n- [Schema Generator](https://mikro-orm.io/docs/schema-generator) and [Migrations](https://mikro-orm.io/docs/migrations)\n- [Entity Generator](https://mikro-orm.io/docs/entity-generator) and [Seeding](https://mikro-orm.io/docs/seeding)\n- [Embeddables](https://mikro-orm.io/docs/embeddables), [Custom Types](https://mikro-orm.io/docs/custom-types), and [Serialization](https://mikro-orm.io/docs/serializing)\n- [Composite and Foreign Keys as Primary Key](https://mikro-orm.io/docs/composite-keys)\n- [Entity Constructors](https://mikro-orm.io/docs/entity-constructors) and [Property Validation](https://mikro-orm.io/docs/property-validation)\n- [Modelling Relationships](https://mikro-orm.io/docs/relationships) and [Vanilla JS Support](https://mikro-orm.io/docs/usage-with-js)\n\n## Documentation\n\nMikroORM documentation, included in this repo in the root directory, is built with [Docusaurus](https://docusaurus.io) and publicly hosted on GitHub Pages at https://mikro-orm.io.\n\nThere is also auto-generated [CHANGELOG.md](CHANGELOG.md) file based on commit messages (via `semantic-release`).\n\n## Example Integrations\n\nYou can find example integrations for some popular frameworks in the [`mikro-orm-examples` repository](https://github.com/mikro-orm/mikro-orm-examples):\n\n### TypeScript Examples\n\n- [Express + MongoDB](https://github.com/mikro-orm/express-ts-example-app)\n- [Nest + MySQL](https://github.com/mikro-orm/nestjs-example-app)\n- [RealWorld example app (Nest + MySQL)](https://github.com/mikro-orm/nestjs-realworld-example-app)\n- [Koa + SQLite](https://github.com/mikro-orm/koa-ts-example-app)\n- [GraphQL + PostgreSQL](https://github.com/driescroons/mikro-orm-graphql-example)\n- [Inversify + PostgreSQL](https://github.com/PodaruDragos/inversify-example-app)\n- [NextJS + MySQL](https://github.com/jonahallibone/mikro-orm-nextjs)\n- [Accounts.js REST and GraphQL authentication + SQLite](https://github.com/darkbasic/mikro-orm-accounts-example)\n- [Nest + Shopify + PostgreSQL + GraphQL](https://github.com/Cloudshelf/Shopify_CSConnector)\n- [Elysia.js + libSQL + Bun](https://github.com/mikro-orm/elysia-bun-example-app)\n- [Electron.js + PostgreSQL](https://github.com/adnanlah/electron-mikro-orm-example-app)\n\n### JavaScript Examples\n\n- [Express + SQLite](https://github.com/mikro-orm/express-js-example-app)\n\n## Contributing\n\nContributions, issues and feature requests are welcome. Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on the process for submitting pull requests to us.\n\n## Authors\n\n**Martin Adámek**\n\n- Twitter: [@B4nan](https://twitter.com/B4nan)\n- Github: [@b4nan](https://github.com/b4nan)\n\nSee also the list of contributors who [participated](https://github.com/mikro-orm/mikro-orm/contributors) in this project.\n\n## Show Your Support\n\nPlease star this repository if this project helped you!\n\n> If you'd like to support my open-source work, consider sponsoring me directly at [github.com/sponsors/b4nan](https://github.com/sponsors/b4nan).\n\n## License\n\nCopyright © 2018-present [Martin Adámek](https://github.com/b4nan).\n\nThis project is licensed under the MIT License - see the [LICENSE file](LICENSE) for details.\n","readmeFilename":"README.md"}