Metadata-Version: 2.1
Name: goforge
Version: 0.0.7
Summary: generate entire CRUD backend for golang echo and postgres with one command
Keywords: code generator,golang echo,postgres
Author: Prashant Bhatkal
Author-email: prashantbhatkal2000@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: Jinja2 (>=3.1.2)
Requires-Dist: pyyaml (>=5.4.1)
Description-Content-Type: text/markdown

<p align="center">

<h1 align="center">GoForge</h1>

<p align="center">

 <div align="center">
	 
[![PyPi package version](https://img.shields.io/pypi/v/goforge)](https://pypi.org/project/goforge/)	 
[![PyPi downloads](https://static.pepy.tech/badge/goforge)](https://pypi.org/project/goforge/)
[![PyPI version](https://img.shields.io/pypi/pyversions/goforge?color=%2344CC11&style=flat-square)](https://pypi.org/project/goforge/)

<br>
    generate the entire CRUD backend for golang echo and postgres with one command
 </div>
    <br>
    <br>
    
## 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
 ```bash
pip install goforge
```
## Quick start
```bash
$ 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
```yaml
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"
```

