Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: php-coder/query2app
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.0.2
Choose a base ref
...
head repository: php-coder/query2app
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 4,200 additions and 542 deletions.
  1. +10 −0 .0pdd.yml
  2. +43 −0 .github/dependabot.yml
  3. +51 −0 .github/workflows/generate-go-app.yml
  4. +51 −0 .github/workflows/generate-js-app.yml
  5. +51 −0 .github/workflows/generate-python-app.yml
  6. +51 −0 .github/workflows/generate-ts-app.yml
  7. +137 −0 .github/workflows/integration-tests.yml
  8. +0 −5 .gitignore
  9. +60 −36 README.md
  10. +1 −0 docker/{categories.sql → categories.mysql.sql}
  11. +15 −0 docker/categories.postgres.sql
  12. +18 −0 docker/docker-compose.local.yaml
  13. +87 −7 docker/docker-compose.yaml
  14. +11 −0 examples/go/chi/mysql/Dockerfile
  15. +54 −0 examples/go/chi/mysql/app.go
  16. +21 −0 examples/go/chi/mysql/custom_routes.go
  17. +1 −0 examples/go/chi/mysql/endpoints.yaml
  18. +9 −0 examples/go/chi/mysql/go.mod
  19. +277 −0 examples/go/chi/mysql/routes.go
  20. +0 −34 examples/js/app.js
  21. +0 −59 examples/js/endpoints.yaml
  22. +8 −0 examples/js/express/mysql/Dockerfile
  23. +47 −0 examples/js/express/mysql/app.js
  24. +11 −0 examples/js/express/mysql/custom_routes.js
  25. +138 −0 examples/js/express/mysql/endpoints.yaml
  26. +1 −2 examples/js/{ → express/mysql}/package.json
  27. +194 −0 examples/js/express/mysql/routes.js
  28. +0 −108 examples/js/routes.js
  29. +6 −0 examples/python/fastapi/postgres/Dockerfile
  30. +18 −0 examples/python/fastapi/postgres/app.py
  31. +12 −0 examples/python/fastapi/postgres/custom_routes.py
  32. +11 −0 examples/python/fastapi/postgres/db.py
  33. +1 −0 examples/python/fastapi/postgres/endpoints.yaml
  34. +3 −0 examples/python/fastapi/postgres/requirements.txt
  35. +224 −0 examples/python/fastapi/postgres/routes.py
  36. +9 −0 examples/ts/express/mysql/Dockerfile
  37. +49 −0 examples/ts/express/mysql/app.ts
  38. +14 −0 examples/ts/express/mysql/custom_routes.ts
  39. +1 −0 examples/ts/express/mysql/endpoints.yaml
  40. +17 −0 examples/ts/express/mysql/package.json
  41. +197 −0 examples/ts/express/mysql/routes.ts
  42. +109 −0 examples/ts/express/mysql/tsconfig.json
  43. +4 −0 mise.toml
  44. +323 −56 package-lock.json
  45. +13 −5 package.json
  46. +411 −87 src/cli.js
  47. +23 −0 src/generator/Generator.js
  48. +14 −0 src/generator/GoGenerator.js
  49. +12 −0 src/generator/JsGenerator.js
  50. +12 −0 src/generator/PyGenerator.js
  51. +14 −0 src/generator/TsGenerator.js
  52. +11 −0 src/templates/Dockerfile.go
  53. +8 −0 src/templates/Dockerfile.js
  54. +6 −0 src/templates/Dockerfile.py
  55. +9 −0 src/templates/Dockerfile.ts
  56. +65 −0 src/templates/app.go.ejs
  57. +0 −34 src/templates/app.js
  58. +63 −0 src/templates/app.js.ejs
  59. +33 −0 src/templates/app.py.ejs
  60. +65 −0 src/templates/app.ts.ejs
  61. +11 −0 src/templates/db.py.ejs
  62. +9 −0 src/templates/go.mod.ejs
  63. +13 −1 src/templates/package.json.ejs
  64. +3 −0 src/templates/requirements.txt.ejs
  65. +330 −0 src/templates/routes.go.ejs
  66. +72 −66 src/templates/routes.js.ejs
  67. +335 −0 src/templates/routes.py.ejs
  68. +94 −0 src/templates/routes.ts.ejs
  69. +110 −0 src/templates/tsconfig.json.ejs
  70. +95 −0 tests/crud.hurl
  71. +0 −42 tests/crud.robot
  72. +22 −0 tests/misc.hurl
  73. +2 −0 tests/mise.toml
10 changes: 10 additions & 0 deletions .0pdd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 0pdd configuration file.
# See for details: https://github.com/yegor256/0pdd
errors:
- slava.semushin+0pdd@gmail.com
alerts:
suppress:
- on-scope
format:
- short-title
- title-length=120
43 changes: 43 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# See for details:
# - https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuring-dependabot-version-updates
# - https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#scheduleinterval
schedule:
interval: "daily"
time: "06:00"
timezone: "Asia/Novosibirsk"
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#commit-message
commit-message:
prefix: "ci"
assignees: [ "php-coder" ]
reviewers: [ "php-coder" ]
labels: [ "kind/dependency-update", "area/ci" ]
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#rebase-strategy
rebase-strategy: "disabled"
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#open-pull-requests-limit
open-pull-requests-limit: 1

- package-ecosystem: "npm"
directory: "/"
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#scheduleinterval
schedule:
interval: "daily"
time: "06:00"
timezone: "Asia/Novosibirsk"
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#commit-message
commit-message:
prefix: "build"
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#versioning-strategy
versioning-strategy: "increase"
assignees: [ "php-coder" ]
reviewers: [ "php-coder" ]
labels: [ "kind/dependency-update" ]
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#rebase-strategy
rebase-strategy: "disabled"
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#open-pull-requests-limit
open-pull-requests-limit: 1
51 changes: 51 additions & 0 deletions .github/workflows/generate-go-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Generate Golang app

on:
push:

# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
# NOTE: actions/upload-artifact makes no use of permissions
# See https://github.com/actions/upload-artifact/issues/197#issuecomment-832279436
contents: read # for "git clone"

defaults:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#defaultsrun
run:
# Enable fail-fast behavior using set -eo pipefail
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
shell: bash

jobs:
generate-app:
name: Generate app
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
runs-on: ubuntu-22.04
steps:

- name: Clone source code
uses: actions/checkout@v4.2.2 # https://github.com/actions/checkout
with:
# Whether to configure the token or SSH key with the local git config. Default: true
persist-credentials: false

- name: Setup NodeJS
uses: actions/setup-node@v4.4.0 # https://github.com/actions/setup-node
with:
node-version: 18
cache: 'npm'

- name: Install project dependencies
run: npm ci --no-audit --no-fund # https://docs.npmjs.com/cli/v8/commands/npm-ci

- name: Generate Golang + Chi application
run: npm run example:go

- name: Check whether all modified files have been committed
run: >-
MODIFIED_FILES="$(git status --short)";
if [ -n "$MODIFIED_FILES" ]; then
echo >&2 "ERROR: the following generated files have not been committed:";
echo >&2 "$MODIFIED_FILES";
exit 1;
fi
51 changes: 51 additions & 0 deletions .github/workflows/generate-js-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Generate JavaScript app

on:
push:

# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
# NOTE: actions/upload-artifact makes no use of permissions
# See https://github.com/actions/upload-artifact/issues/197#issuecomment-832279436
contents: read # for "git clone"

defaults:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#defaultsrun
run:
# Enable fail-fast behavior using set -eo pipefail
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
shell: bash

jobs:
generate-app:
name: Generate app
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
runs-on: ubuntu-22.04
steps:

- name: Clone source code
uses: actions/checkout@v4.2.2 # https://github.com/actions/checkout
with:
# Whether to configure the token or SSH key with the local git config. Default: true
persist-credentials: false

- name: Setup NodeJS
uses: actions/setup-node@v4.4.0 # https://github.com/actions/setup-node
with:
node-version: 18
cache: 'npm'

- name: Install project dependencies
run: npm ci --no-audit --no-fund # https://docs.npmjs.com/cli/v8/commands/npm-ci

- name: Generate JavaScript + Express application
run: npm run example:js

- name: Check whether all modified files have been committed
run: >-
MODIFIED_FILES="$(git status --short)";
if [ -n "$MODIFIED_FILES" ]; then
echo >&2 "ERROR: the following generated files have not been committed:";
echo >&2 "$MODIFIED_FILES";
exit 1;
fi
51 changes: 51 additions & 0 deletions .github/workflows/generate-python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Generate Python app

on:
push:

# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
# NOTE: actions/upload-artifact makes no use of permissions
# See https://github.com/actions/upload-artifact/issues/197#issuecomment-832279436
contents: read # for "git clone"

defaults:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#defaultsrun
run:
# Enable fail-fast behavior using set -eo pipefail
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
shell: bash

jobs:
generate-app:
name: Generate app
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
runs-on: ubuntu-22.04
steps:

- name: Clone source code
uses: actions/checkout@v4.2.2 # https://github.com/actions/checkout
with:
# Whether to configure the token or SSH key with the local git config. Default: true
persist-credentials: false

- name: Setup NodeJS
uses: actions/setup-node@v4.4.0 # https://github.com/actions/setup-node
with:
node-version: 18
cache: 'npm'

- name: Install project dependencies
run: npm ci --no-audit --no-fund # https://docs.npmjs.com/cli/v8/commands/npm-ci

- name: Generate Python + FastAPI application
run: npm run example:py

- name: Check whether all modified files have been committed
run: >-
MODIFIED_FILES="$(git status --short)";
if [ -n "$MODIFIED_FILES" ]; then
echo >&2 "ERROR: the following generated files have not been committed:";
echo >&2 "$MODIFIED_FILES";
exit 1;
fi
51 changes: 51 additions & 0 deletions .github/workflows/generate-ts-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Generate TypeScript app

on:
push:

# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
# NOTE: actions/upload-artifact makes no use of permissions
# See https://github.com/actions/upload-artifact/issues/197#issuecomment-832279436
contents: read # for "git clone"

defaults:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#defaultsrun
run:
# Enable fail-fast behavior using set -eo pipefail
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
shell: bash

jobs:
generate-app:
name: Generate app
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
runs-on: ubuntu-22.04
steps:

- name: Clone source code
uses: actions/checkout@v4.2.2 # https://github.com/actions/checkout
with:
# Whether to configure the token or SSH key with the local git config. Default: true
persist-credentials: false

- name: Setup NodeJS
uses: actions/setup-node@v4.4.0 # https://github.com/actions/setup-node
with:
node-version: 18
cache: 'npm'

- name: Install project dependencies
run: npm ci --no-audit --no-fund # https://docs.npmjs.com/cli/v8/commands/npm-ci

- name: Generate TypeScript + Express application
run: npm run example:ts

- name: Check whether all modified files have been committed
run: >-
MODIFIED_FILES="$(git status --short)";
if [ -n "$MODIFIED_FILES" ]; then
echo >&2 "ERROR: the following generated files have not been committed:";
echo >&2 "$MODIFIED_FILES";
exit 1;
fi
Loading