feat(sqlite): add SQLite writer for converting PostgreSQL schemas
All checks were successful
All checks were successful
- Implement SQLite DDL writer to convert PostgreSQL schemas to SQLite-compatible SQL statements. - Include automatic schema flattening, type mapping, auto-increment detection, and function translation. - Add templates for creating tables, indexes, unique constraints, check constraints, and foreign keys. - Implement tests for writer functionality and data type mapping.
This commit is contained in:
@@ -59,6 +59,7 @@ RelSpec can write database schemas to multiple formats:
|
||||
|
||||
#### Database DDL
|
||||
- [PostgreSQL](pkg/writers/pgsql/README.md) - PostgreSQL DDL (CREATE TABLE, etc.)
|
||||
- [SQLite](pkg/writers/sqlite/README.md) - SQLite DDL with automatic schema flattening
|
||||
|
||||
#### Schema Formats
|
||||
- [DBML](pkg/writers/dbml/README.md) - Database Markup Language
|
||||
@@ -185,6 +186,10 @@ relspec convert --from pgsql --from-conn "postgres://..." \
|
||||
# Convert DBML to PostgreSQL SQL
|
||||
relspec convert --from dbml --from-path schema.dbml \
|
||||
--to pgsql --to-path schema.sql
|
||||
|
||||
# Convert PostgreSQL database to SQLite (with automatic schema flattening)
|
||||
relspec convert --from pgsql --from-conn "postgres://..." \
|
||||
--to sqlite --to-path sqlite_schema.sql
|
||||
```
|
||||
|
||||
### Schema Validation
|
||||
|
||||
Reference in New Issue
Block a user