Skip to main content

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

Project description

GoForge

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

Description

This tool is designed to be used as a starting a project and editing the files later. It uses sqlc to generate all the sql related code. Make sure sqlc, goimports, gofmt, docker are installed

Installation

pip install goforge

Quick start

$ goforge --config-file example.yml

Folder 'example' deleted successfully.
initiated golang project: example.com/crud
Container example-postgres-1  Created
done

API Configuration Documentation

edit the yaml as per your requirements

project_path: "example"
schema_file: "example.sql"
handlers:
  - name: CreateUser
    path: "/v1/api/user"
    sql:
       name: CreateUser
       annotation: 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"

This document describes the configuration for an API project using a YAML file.

  • project_path: Specifies the root directory for the project.
  • schema_file: Defines the SQL schema file for the project.
  • handlers: The configuration defines API handlers
    • name : name of handler in PascalCase
    • path : api path
    • sql : configuration for sql queries
      • name : name of sql query function
      • annotation : ranges from "one", "many" and "exec"
      • query : sql query with variable params syntax of psql
    • request.method : defines the http verb of the api path

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.0.6.tar.gz (8.7 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.0.6-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for goforge-0.0.6.tar.gz
Algorithm Hash digest
SHA256 c6df44440233f859c9e523d889712b18d8b82c54bbd103fc35f6f0005ea09833
MD5 21c2f951fe25cb433c61053845258bb2
BLAKE2b-256 0403f10e371c946bdb3f02cdc4eceb6aa59d05442691078789da060f2e58d5a6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: goforge-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 13.5 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.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b2d78cc8dcbbf5fd3808cab5482f7b92420b4de8d011c61c20b2b647037c803b
MD5 dd62ddd8529e130bf0d65dd42453ac42
BLAKE2b-256 1b1b455ec383ae260f3f330b8f0bce6efbb17b4517e2f54979752c9256d59800

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