Registry / database / innomize-typeorm

innomize-typeorm

JSON →
library0.2.19jsnpmunverified

TypeORM is a Data-Mapper ORM for TypeScript and JavaScript, supporting both Active Record and Data Mapper patterns. The latest stable version is 0.2.19, with active development and a regular release cadence. It supports multiple databases (MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, CockroachDB, sql.js, and MongoDB via MongoDB driver) and platforms (Node.js, Browser, Cordova, React Native, etc.). Key differentiators include full TypeScript support, decorator-based entity definitions, automatic migrations, eager/lazy relations, and cross-database queries. Compared to alternatives like Sequelize or Prisma, TypeORM offers a closer resemblance to traditional ORMs like Hibernate and provides more flexibility in choosing between Active Record and Data Mapper patterns.

npm install innomize-typeorm
INSTALL
IMPORT
SIG · INNOMIZE-TYPEORM
I
innomize-typeorm
databasejavascriptv0.2.19
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Entity
import { Entity } from 'typeorm'
const Entity = require('typeorm').Entity
Use named import for decorators; incorrect require usage may cause issues with decorators.
PrimaryGeneratedColumn
import { PrimaryGeneratedColumn } from 'typeorm'
import PrimaryGeneratedColumn from 'typeorm'
Must be a named import, not default.
Column
import { Column } from 'typeorm'
import Column from 'typeorm'
Named import required.
getConnection
import { getConnection } from 'typeorm'
import getConnection from 'typeorm'
Named import for functions.
createConnection
import { createConnection } from 'typeorm'
import { createConnection } from 'typeorm/browser'
In browser context, use { createConnection } from 'typeorm' still works; separate browser entry points are deprecated.

Creates an in-memory SQLite database, defines a User entity, and performs basic CRUD operations using the Data Mapper pattern.

import { createConnection, Entity, PrimaryGeneratedColumn, Column, getConnection } from 'typeorm'; @Entity() class User { @PrimaryGeneratedColumn() id: number; @Column() firstName: string; @Column() lastName: string; } async function main() { const connection = await createConnection({ type: 'sqlite', database: ':memory:', entities: [User], synchronize: true, logging: false, }); const user = new User(); user.firstName = 'John'; user.lastName = 'Doe'; const repository = connection.getRepository(User); await repository.save(user); const users = await repository.find(); console.log(users); await connection.close(); } main().catch(err => console.error(err));
Debug
Known issues
breakingTypeORM 0.3.x changed the connection API: createConnection() returns a DataSource, and getConnection() is removed.
fix
Use new DataSource() and initialize() instead of createConnection(). Use AppDataSource.getRepository() instead of getConnection().getRepository().
affects: >=0.3.0
deprecatedDecorators like @Entity and @Column are experimental and require TypeScript's experimentalDecorators setting.
fix
Enable 'experimentalDecorators' and 'emitDecoratorMetadata' in tsconfig.json.
affects: *
gotchaSome drivers (e.g., MongoDB) require additional package like 'mongodb' as a peer dependency.
fix
Install the required database driver: npm install mongodb for MongoDB, or mysql2 for MySQL.
affects: *
breakingIn version 0.3.0, the way to register subscribers and migrations changed; they must be added to DataSource options.
fix
Add subscribers and migrations as arrays in the DataSource options object.
affects: >=0.3.0
Errors
Common errors & fixes
Missing required dependency: reflect-metadata. Please install it.
reflect-metadata is not installed or imported at the top of the entry file.
fix
Run 'npm install reflect-metadata' and add 'import "reflect-metadata"' at the top of your main file.
Cannot find module 'typeorm' or its corresponding type declarations.
TypeORM is not installed or TypeScript cannot find type definitions.
fix
Run 'npm install typeorm'. Ensure tsconfig.json includes 'node_modules/@types' in typeRoots.
Entity metadata for entity '' was not found. Check if you specified correct entity classes.
Entity class is not registered in DataSource options or missing @Entity() decorator.
fix
Add the entity to entities array in DataSource/Connection options and ensure the class has @Entity() decorator.
Driver not found. Please install the correct database driver: mysql2, pg, sqlite3, etc.
Database driver package is missing.
fix
Install the appropriate driver: npm install mysql2 for MySQL, pg for PostgreSQL, sqlite3 for SQLite.
Upgrade
Version history
0.2.19latest on npm
Audit
Dependencies
reflect-metadatarequiredRequired for decorator metadata reflection used by @Entity, @Column, etc.
typeorm-aurora-data-api-driveroptionalRequired when using AWS Aurora Serverless Data API
Agent activity
6 hits · last 30 days
node
6
Resources