Skip to main content

generate entire CRUD backend for golang echo and postgres with one command

Project description

GoForge

PyPi package version PyPi downloads PyPI version


generate the entire CRUD backend for golang echo and postgres with one command


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


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.1.1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

goforge-0.1.1-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file goforge-0.1.1.tar.gz.

File metadata

  • Download URL: goforge-0.1.1.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for goforge-0.1.1.tar.gz
Algorithm Hash digest
SHA256 edcccd2a9c4d39e91cf911d0c2a335b8e51708a83165c9c5281a840e449feec8
MD5 956c206ab9df5a0f367664762535125b
BLAKE2b-256 7a15cd6219956d40c6061d78cff1bb05f736437e5e5578e094410b43d9ea2368

See more details on using hashes here.

File details

Details for the file goforge-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: goforge-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for goforge-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0345ca4ecec4592aefe5b11cca1bba3ff8cc2a12aef49996005db3c3ddb9d525
MD5 96a39c7b94954dd27cf354efc60af8cb
BLAKE2b-256 f10d84e05f2f45fcbfe483ac07faade4dadc11d79f0af802ddefc3cf25dc4638

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page