generate entire CRUD backend for golang echo and postgres with one command
Project description
GoForge
Description
This tool is designed to be used for starting a project and editing the files later. It uses sqlc to generate all the sql related code. Make sure sqlc, goimports, gofmt, and docker are installed.
Installation
pip install goforge
Quick start
$ goforge --config-file example.yml
Folder 'example' deleted successfully.
initiated golang project: example.com/my_crud_app
Container example-postgres-1 Created
done
API Configuration Documentation
edit the yaml as per your requirements
project_path: "example" # specifies the root directory for the project
schema_file: "example.sql" # defines the sql schema file for the project
project_mod: "example.com/my_crud_app" # go.mod project name
handlers:
- name: CreateUser # handler function name
path: "/v1/api/user" # api path
sql:
name: CreateUser # sqlc model method name
annotation: exec # annotations compatible with sqlc, for eg: "one", "many" and "exec"
query: "INSERT INTO users (name, email) VALUES ($1, $2)"
request:
method: "POST"
- name: GetUsers
path: "/v1/api/users"
sql:
name: GetUsers
annotation: many
query: "SELECT id, name, email FROM users"
request:
method: "GET"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
goforge-0.0.7.tar.gz
(9.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
goforge-0.0.7-py3-none-any.whl
(13.7 kB
view details)
File details
Details for the file goforge-0.0.7.tar.gz.
File metadata
- Download URL: goforge-0.0.7.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c020de90abb87fea054ca7a7314efb155a41483a74dae87d51680b221b68932c
|
|
| MD5 |
218ae927d740011c2b5dc0b7907675d4
|
|
| BLAKE2b-256 |
417342b37cb3fbe1ef60d9c0f63feab9e2af512bcd5273d760a847f26c31ab14
|
File details
Details for the file goforge-0.0.7-py3-none-any.whl.
File metadata
- Download URL: goforge-0.0.7-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d39308d863487ddd3384623637048aca71b0993ca1c1cc815ba51b814ec889c5
|
|
| MD5 |
afa8b3bdabe698bad8cc88c443e8f128
|
|
| BLAKE2b-256 |
bfe9cf359fdf3e7b4ddd2de62fe017c431f2f455d8694c403abe7d417f7d9a12
|