π¬ Join the Community Discussion π I am building code-generator to simplify CRUD code generation from PostgreSQL tables using Go β and I want your input! This is the start of the project, I will ensure to keep increasing it capability and functionality.
π£ Join the Discussion β
π In the discussion, you can: Ask questions
Share ideas & features you want
Report bugs or edge cases
Contribute templates or improvements
Connect with fellow developers
Letβs collaborate and make code-generator more powerful and flexible for everyone! π‘
Code-generator is a CLI tool written in Go that generates boilerplate CRUD code (models, handlers, routes, services, and DTOs) from a PostgreSQL database table. Ideal for kickstarting API development, it simplifies and automates repetitive tasks.
- Generate Go models from PostgreSQL tables.
- Create handlers, routes, services, and DTOs using templates.
- Add custom fields.
- Lightweight and fast.
- Go
- Cobra CLI
- PostgreSQL
- YAML for config
- Text/template
-
Clone this repository: git clone https://github.com/moses000/mysoftware-code-generator.git cd mysoftware-code-generator
-
Install dependencies:
bash go mod tidy
-
Run the application:
go run main.go --conn "<your_postgres_conn>" --table "<table_name>"
crudgen --conn "postgres://user:password@localhost:5432/dbname?sslmode=disable" --table "users"
You can also generate specific components:
bash crudgen -c "<conn_string>" -t "users" --models crudgen -c "<conn_string>" -t "users" --handlers
This project is licensed under the GNU License.
Created by Imoleayo Moses
Thanks for your interest in contributing!
- Fork the repository.
- Create a new branch (
git checkout -b feature/my-feature
). - Make your changes.
- Run
go fmt
and ensure the project builds. - Commit your changes (
git commit -am 'Add new feature'
). - Push to your fork (
git push origin feature/my-feature
). - Create a Pull Request.
- Use
gofmt
for formatting. - Keep logic modular.
- Stick to idiomatic Go practices.
- All PRs are reviewed before merging.
- Make sure your branch is up to date with
main
. - Be descriptive in your PR title and message.
Open an Issue or start a Discussion.
We as members, contributors, and leaders pledge to make participation in our project a harassment-free experience for everyone.
Examples of behavior that contributes to a positive environment:
- Respectful communication
- Constructive feedback
- Accepting different viewpoints
Examples of unacceptable behavior:
- Harassment or insults
- Discriminatory jokes or comments
- Personal attacks