goforge


Namegoforge JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
Summarygenerate entire CRUD backend for golang echo and postgres with one command
upload_time2024-10-23 09:18:52
maintainerNone
docs_urlNone
authorPrashant Bhatkal
requires_python<4.0,>=3.7
licenseNone
keywords code generator golang echo postgres
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <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 entire CRUD backend for golang echo and postgres with one command 💙
</div>
    
## 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.

 ## Prerequisites
 ```bash
snap install sqlc
go install golang.org/x/tools/cmd/goimports@latest
```

 ## Installation
 ```bash
pip install goforge
```
## Quick start
generate the project code
```bash
$ goforge -c example.yml
```
delete the project
```bash
$ goforge -c example.yml -d
```

## 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
setup_postgres_local: true # setups a postgres docker instance for seamless testing
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 LIMIT $1 AND OFFSET $2"
    request:
      method: "GET"


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "goforge",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.7",
    "maintainer_email": null,
    "keywords": "code generator, golang echo, postgres",
    "author": "Prashant Bhatkal",
    "author_email": "prashantbhatkal2000@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/a0/74/b348f569b3b834deaef3948ae6514cb5a31600274d4f2bbe7ded7095aa15/goforge-0.2.0.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n\n<h1 align=\"center\">GoForge</h1>\n\n<p align=\"center\">\n\n <div align=\"center\">\n\t \n[![PyPi package version](https://img.shields.io/pypi/v/goforge)](https://pypi.org/project/goforge/)\t \n[![PyPi downloads](https://static.pepy.tech/badge/goforge)](https://pypi.org/project/goforge/)\n[![PyPI version](https://img.shields.io/pypi/pyversions/goforge?color=%2344CC11&style=flat-square)](https://pypi.org/project/goforge/)\n<br>\ngenerate entire CRUD backend for golang echo and postgres with one command \ud83d\udc99\n</div>\n    \n## Description\n 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.\n\n ## Prerequisites\n ```bash\nsnap install sqlc\ngo install golang.org/x/tools/cmd/goimports@latest\n```\n\n ## Installation\n ```bash\npip install goforge\n```\n## Quick start\ngenerate the project code\n```bash\n$ goforge -c example.yml\n```\ndelete the project\n```bash\n$ goforge -c example.yml -d\n```\n\n## API Configuration Documentation\n\nedit the yaml as per your requirements\n```yaml\nproject_path: \"example\" # specifies the root directory for the project\nschema_file: \"example.sql\" # defines the sql schema file for the project\nproject_mod: \"example.com/my_crud_app\" # go.mod project name\nsetup_postgres_local: true # setups a postgres docker instance for seamless testing\nhandlers:\n  - name: CreateUser # handler function name\n    path: \"/v1/api/user\" # api path\n    sql:\n       name: CreateUser # sqlc model method name\n       annotation: exec # annotations compatible with sqlc, for eg: \"one\", \"many\" and \"exec\"\n       query: \"INSERT INTO users (name, email) VALUES ($1, $2)\"\n    request:\n       method: \"POST\"\n  - name: GetUsers\n    path: \"/v1/api/users\"\n    sql:\n      name: GetUsers\n      annotation: many\n      query: \"SELECT id, name, email FROM users LIMIT $1 AND OFFSET $2\"\n    request:\n      method: \"GET\"\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "generate entire CRUD backend for golang echo and postgres with one command",
    "version": "0.2.0",
    "project_urls": null,
    "split_keywords": [
        "code generator",
        " golang echo",
        " postgres"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2f6ec2d02e1c0475fa95d6b4a80eea2f16db3b578bfed5bf4420dff9134fc336",
                "md5": "c45944dc1fad7bc847a93a4ce836bc47",
                "sha256": "5869b94041be1ad27816881051b538c4e5689a2a0f5cbf0bc5949c4a7a16dec3"
            },
            "downloads": -1,
            "filename": "goforge-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c45944dc1fad7bc847a93a4ce836bc47",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.7",
            "size": 9651,
            "upload_time": "2024-10-23T09:18:50",
            "upload_time_iso_8601": "2024-10-23T09:18:50.572776Z",
            "url": "https://files.pythonhosted.org/packages/2f/6e/c2d02e1c0475fa95d6b4a80eea2f16db3b578bfed5bf4420dff9134fc336/goforge-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a074b348f569b3b834deaef3948ae6514cb5a31600274d4f2bbe7ded7095aa15",
                "md5": "e03828d38db5bc1100766bc7855775cd",
                "sha256": "5a9b4c24cbfd2374ae9bc10e6552af6e92abcdca0b50fe269d1d81c875a1508a"
            },
            "downloads": -1,
            "filename": "goforge-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e03828d38db5bc1100766bc7855775cd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.7",
            "size": 6840,
            "upload_time": "2024-10-23T09:18:52",
            "upload_time_iso_8601": "2024-10-23T09:18:52.274727Z",
            "url": "https://files.pythonhosted.org/packages/a0/74/b348f569b3b834deaef3948ae6514cb5a31600274d4f2bbe7ded7095aa15/goforge-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-23 09:18:52",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "goforge"
}
        
Elapsed time: 0.93419s