2.2.0 • Published 4 months ago

genxdb v2.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

Development Setup

Prerequisites

Setting Up a Project

  • Create a file in the project root dir named genxdb.json.

  • Install GenXDB globally:

npm install -g genxdb
  • Run the application:
genxdb

Source file example

{
  "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"
        }
      ]
    }
  ]
}

Output files example

user.entity.ts

task.entity.ts

role.entity.ts

Relations

NameType
One to one1-1
One to many1-N
Many to oneN-1
Many to manyN-M

Author

👤Rocco Bosio

Contributing

Contributions, issues and feature requests are welcome!

Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

License

Copyright © 2024 Rocco Bosio.

This project is MIT licensed.

2.2.0

4 months ago

2.1.0

4 months ago

2.0.0

4 months ago

1.2.4

4 months ago

1.2.3

4 months ago

1.2.0

4 months ago

1.2.2

4 months ago

1.1.0

4 months ago

1.0.3

4 months ago

1.0.2

4 months ago

1.0.1

4 months ago

1.0.0

4 months ago