Commit Graph

20 Commits

Author SHA1 Message Date
Alberto Arena 91fe5d6cf2 test: add Phase 3 SQL render tests for all dialects
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.
2026-08-05 07:26:31 +02:00
Alberto Arena d0cd2d8fa4 test: add Vitest and Phase 1 pure-helper suite
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.
2026-08-05 06:24:18 +02:00
KarimTamani 6c3b431ee2 Add Oracle & MSSQL Support 2026-06-10 18:09:54 +01:00
KarimTamani 6bb10b86f2 Merging UI/UX Improvements with the main branch 2025-09-26 20:52:12 +01:00
KarimTamani 2c421a133e Translate some labels in the open database and create database modals 2025-08-02 19:30:31 +01:00
KarimTamani ba81bab88c Datatypes Seeded and Not Found page added 2025-07-20 16:04:51 +01:00
KarimTamani 7bf3e6e74e Foriegn Key Actions (onDelete , onUpdate) Implemnted 2025-07-05 23:18:34 +01:00
KarimTamani 9ecc2f9d56 Improved Performence , Re-Order Diagram whene import , Fix Database History Bug (stuck in undo or redo , foriegn keys constraint error) 2025-07-03 22:01:12 +01:00
KarimTamani 815845e1e9 UX improvements + Manage loading states + Numerical Cardinalities implemented 2025-06-30 17:40:45 +01:00
KarimTamani 3ddb1f4e39 Import Mysql from Sql feature implemented 2025-06-23 23:22:37 +01:00
KarimTamani ea275f0a92 imoprt Postgres database features implemented 2025-06-22 18:17:12 +01:00
KarimTamani f33d6f5123 Import Tables and relationships from Postgres SQL code is implemented successfully 2025-06-21 21:44:59 +01:00
KarimTamani 26c1406f1b Column Modifiers for Sqlite and Mysql done and Sql Rendering Improvments 2025-06-19 16:04:12 +01:00
KarimTamani 93cf912243 Column Modifier for Postgres Implemented 2025-06-17 18:47:03 +01:00
KarimTamani 3ec28c3232 Mysql Datetime data types modifiers implemented 2025-06-16 19:25:02 +01:00
KarimTamani 84dfd0e9d5 fix charset and collation order whene rendering a text column declaration sql 2025-06-14 23:03:27 +01:00
KarimTamani 12d2ac693e Field Modifiers integrated , extra options added to the field settings based on the data type of that field 2025-06-12 21:29:54 +01:00
KarimTamani 071bd5eecc render mysql code 2025-06-08 21:27:42 +01:00
KarimTamani 2c7765350d code editor implemented 2025-06-06 21:16:39 +01:00
KarimTamani b9a996ba7a Render sql from Diagram initialized 2025-06-05 23:27:12 +01:00