-
Notifications
You must be signed in to change notification settings - Fork 5
Cli
Levy Araújo Sampaio edited this page Jun 5, 2024
·
2 revisions
Our cli has two main funcionalities:
- Generate and destroy code
- Manage migrations and database
The code generation funcionality create two routes types
- CRUD
- USECASE
The crud command generate:
- routes and handlers on cmd/http folder
- domain with ID field on internal/aplication/domain
- service for each route with a type for request, response and a service file for your business rules
- repository based on your domain for mysql database comunication
The usecase command generate:
- single route and handler without any dependecy injection
- service with a type for request, response and a service file for your business rules
The migrator is based on atlas: https://atlasgo.io/getting-started If you want can use atlas for manage your database without use the cli
The migrator has 3 commands:
- migrate
- inspect
- generate
this command read the tools/migrator/schema/schema.my.hcl file and migrate for the real database connceted with env configuration
this command read the connceted database and generate an hcl with this configuration
Similar to inspect but generate a hcl file on tools/migrator/generated, if you want to use the generated hcl on zord migrations just replace tools/migrator/schema/schema.my.hcl with this file content