Cover getRenderer().renderDDL across MySQL, MariaDB, PostgreSQL, SQLite,
Oracle and SQL Server. A shared DatabaseType fixture (users + posts with a
primary key, auto-increment, NOT NULL UNIQUE column with a length, DEFAULT
and a posts to users foreign key) is rendered per dialect, asserting the
emitted DDL creates both tables and columns and carries the primary key,
unique constraint, dialect-specific auto-increment spelling (AUTO_INCREMENT,
SERIAL, AUTOINCREMENT, IDENTITY), variable-length text type, DEFAULT value
and the foreign key with ON DELETE CASCADE.
The fixture is built from the seed data types so field type ids hydrate the
way the app hydrates them, and embeds relationship source/target objects
because the SQLite renderer orders tables from the raw database before the
migration step re-hydrates. Assertions match quote-agnostic patterns rather
than exact strings, since identifier quoting and formatting differ by dialect.
Cover getImporter().parseSql across MySQL, MariaDB, PostgreSQL, SQLite,
Oracle and SQL Server. Each dialect gets a representative CREATE TABLE +
foreign key + index fixture, asserting table and column counts, primary
key, NOT NULL, UNIQUE and DEFAULT parsing, data-type mapping, and the
captured foreign key (direction, cardinality and ON DELETE action). Also
parse the bundled PostgreSQL dump as a realistic case and verify malformed
input surfaces errors without dropping valid tables or throwing.
Data-type fixtures are built from the seed arrays via the same transform
the app uses in seedDataTypes, so tests run without booting the WASM
SQLite database. The parser is a WASM module whose init() is async; the
importer constructor does not await it, so the suite awaits init() once in
beforeAll, after which every synchronous parseSql call resolves.
Introduce automated testing to a project that had no test runner, no
test script and no CI. Vitest fits the existing Vite setup with near-zero
config; a standalone vitest.config.ts wires the @/ alias via
vite-tsconfig-paths and runs in the node environment, avoiding the app's
Tailwind/React/WASM plugins that pure-logic tests do not need.
Cover the cheapest, highest-value surface first: pure helpers with no DOM,
WASM or database. getNextSequence and cloneField (field.ts), the
charset/collation and SQLite integer-column reordering plus enum naming
(render-uttils.ts), and orderTables including the CircularDependencyError
cycle path that backs the Foreign Key Cycle Detection feature.
The build's tsc step is unaffected (plain tsc no-ops on the root config)
and the new files typecheck clean under strict and lint clean.
The production build renders thousands of modules and exceeds V8's
default heap ceiling, so `npm run build` fails with a JavaScript
heap out-of-memory error during "rendering chunks". Set
NODE_OPTIONS=--max-old-space-size=8192 on the Vite build step via
cross-env (kept portable for Windows), so a fresh clone builds
without any manual environment setup. Document the matching Docker
memory requirement in DOCKER.md, since the container build hits the
same limit when the Docker VM has too little RAM.
Correct the "Welcome" heading typo and reword "Index Suggestions"
in the feature list. The intro now lists all six exportable SQL
dialects (adding Oracle and SQL Server) so it matches the
Supported Databases section. Add the port 3000 dev-server URL to
the local setup instructions, and switch the Docker Compose
commands in README and DOCKER.md from the deprecated V1
"docker-compose" to the current V2 "docker compose" syntax.