Watermelon code generator
An experimental generator to produce WatermelonDB database from Postgres.
Usage
Install the dependencies:
npm install
Start a mock database:
docker-compose up
Run the generator:
npm run dev watermelon
How it works
- Uses postgres-meta to introspect the schema (see
./src/commands/watermelon.js
) - Grabs all the tables
- For each table, generates a Watermelon model
- Dumps the whole database schema into ./database
Todo
- Transform snake_case to PascalCase for the ModelNames
- Transform pluralized models to singular