GenXDB is a command-line interface tool that is used to design and generate models easily and quickly
using the json format based on different orms such as TypeORM and Prisma
- Install Node.js which includes [Node Package Manager][npm]
-
Create a file in the project root dir named genxdb.json.
-
Install GenXDB globally:
npm install -g genxdb
- Run the application:
genxdb
{
"database": [
{
"name": "user",
"columns": [
{
"name": "id",
"type": "number"
},
{
"name": "name",
"type": "string"
},
{
"name": "surname",
"type": "string",
"nullable": true
},
{
"name": "status",
"type": "boolean",
"default": true
},
{
"name": "email",
"type": "string",
"unique": true
},
{
"name": "password",
"type": "string"
},
{
"name": "created_at",
"type": "Date",
"default": "CURRENT_TIMESTAMP"
}
],
"primary": "id",
"relations": [
{
"table": "task",
"relation": "1-N"
}
]
},
{
"name": "task",
"columns": [
{
"name": "id",
"type": "number"
},
{
"name": "name",
"type": "string",
"length": 150
}
],
"primary": "id",
"relations": [
{
"table": "user",
"relation": "N-1"
}
]
},
{
"name": "role",
"columns": [
{
"name": "id",
"type": "number"
},
{
"name": "name",
"type": "string"
}
],
"primary": "id",
"relations": [
{
"table": "user",
"relation": "N-M"
}
]
}
]
}
👤Rocco Bosio
- Github: @RBosio
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
Copyright © 2024 Rocco Bosio.
This project is MIT licensed.