This project uses SQLite with better-sqlite3-proxy and knex migrations. The setup is included and usable out of the box. This section describes the workflow related to erd.txt and database schema migration.
You can copy the content of erd.txt into the hosted web ui.
The hosted version store the content in LocalStorage, so the changes are persisted across page reload. You can then paste the updated version back to erd.txt.
In some region, it may take quite some time to load the website, you can run the web ui locally as well.
Command to run the web ui of erd locally:
npm run uiThe local version can auto load and save the content of erd.txt on your disk.
Remark: cd to db if not done already
Auto mode:
- update
erd.txtwith any text editor - run
npm run dev
Manual mode:
- update
erd.txtwith any text editor - run
npm run plan - review the generated migration script in the
migrationsdirectory - run
npm run migrate - run
npm run gen-proxy
You can setup configuration data and sample data in seed.ts, then run it with npm run seed.
This package is used to isolate knex from top-level package.
We're using esm on the top-level package but knex with typescript only works in commonjs package.
The files here are compiled and imported from the server directly, so the dependencies of this package should appear on the top-level package.json as well.