Skip to content

What is it? ​

typeorm-extension covers the parts of a deployment that TypeORM leaves to you:

  • Create, drop and check the database on every supported driver, from code or the CLI.
  • Detect schema drift between the migrations and the entities, and repair it with guarded, resumable helpers.
  • Lock: a named advisory lock to run work like migrations in one replica at a time, and a row lock for read-modify-write.
  • Classify driver errors: recognize a unique or foreign key violation or a lock conflict, whichever driver raised it.
  • Seed the database with seeder classes and factories, optionally tracked so each seeder runs once.
  • Manage data sources: find data-source.ts automatically and use one or many instances by alias.

Supported drivers ​

DriverCreate / drop / checkNotes
postgresyes
cockroachdbyes
mysql, mariadbyes
mssqlyes
oraclecreate and checkdropDatabase does nothing on oracle
mongodbyescreates a database lazily, so checkDatabase reports it as existing once connected
better-sqlite3yesthe database is a file

TypeORM 1.0 removed the legacy sqlite driver; use better-sqlite3.