Skip to content

Commit 9383d47

Browse files
committed
refactor: group Golang examples as <lang>/<framework>/<database>
1 parent d6ebf55 commit 9383d47

File tree

7 files changed

+3
-3
lines changed

7 files changed

+3
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Generates the endpoints (or a whole app) from a mapping (SQL query -> URL)
4848
| Language | Command for code generation | Example of generated files | Libraries |
4949
| -----------| ----------------------------| ---------------------------| --------- |
5050
| JavaScript | `npx query2app --lang js` | [`app.js`](examples/js/app.js)<br/>[`routes.js`](examples/js/routes.js)<br/>[`package.json`](examples/js/package.json) | Web: [`express`](https://www.npmjs.com/package/express), [`body-parser`](https://www.npmjs.com/package/body-parser)<br>Database: [`mysql`](https://www.npmjs.com/package/mysql) |
51-
| Golang | `npx query2app --lang go` | [`app.go`](examples/go/app.go)<br/>[`routes.go`](examples/go/routes.go)<br/>[`go.mod`](examples/go/go.mod) | Web: [`go-chi/chi`](https://github.com/go-chi/chi)<br/>Database: [`go-sql-driver/mysql`](https://github.com/go-sql-driver/mysql), [`jmoiron/sqlx`](https://github.com/jmoiron/sqlx) |
51+
| Golang | `npx query2app --lang go` | [`app.go`](examples/go/chi/mysql/app.go)<br/>[`routes.go`](examples/go/chi/mysql/routes.go)<br/>[`go.mod`](examples/go/chi/mysql/go.mod) | Web: [`go-chi/chi`](https://github.com/go-chi/chi)<br/>Database: [`go-sql-driver/mysql`](https://github.com/go-sql-driver/mysql), [`jmoiron/sqlx`](https://github.com/jmoiron/sqlx) |
5252
| Python | `npx query2app --lang python` | [`app.py`](examples/python/app.py)<br/>[`db.py`](examples/python/db.py)<br/>[`routes.py`](examples/python/routes.py)<br/>[`requirements.txt`](examples/python/requirements.txt) | Web: [FastAPI](https://github.com/tiangolo/fastapi), [Uvicorn](https://www.uvicorn.org)<br/>Database: [psycopg2](https://pypi.org/project/psycopg2/) |
5353

5454
1. Run the application
File renamed without changes.

examples/go/chi/mysql/endpoints.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../js/endpoints.yaml
File renamed without changes.
File renamed without changes.

examples/go/endpoints.yaml

-1
This file was deleted.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"start": "node src/index.js",
3030
"test": "echo \"Error: no test specified\" && exit 1",
3131
"gen-js-example": "cd examples/js; ../../src/cli.js --lang js",
32-
"gen-go-example": "cd examples/go; ../../src/cli.js --lang go",
32+
"gen-go-example": "cd examples/go/chi/mysql; ../../../../src/cli.js --lang go",
3333
"gen-py-example": "cd examples/python; ../../src/cli.js --lang python"
3434
},
3535
"dependencies": {

0 commit comments

Comments
 (0)