diff --git a/.gitignore b/.gitignore
index 8acdcaa..ee7c078 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,3 @@
-__pycache__/
-*.py[cod]
-*.egg-info/
-.venv/
-venv/
+node_modules/
+npm-debug.log*
.env
diff --git a/README.md b/README.md
index 2703cc8..70f0ea0 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,12 @@
# getpgdata
-Flask-приложение для доступа к PostgreSQL (managed k8s, internal-only).
+Node.js приложение для доступа к PostgreSQL (managed k8s, internal-only).
-Развёртывается на платформе Nubes как Python managed service (структура `site/app.py`).
+Развёртывается на платформе Nubes как NodeJS managed service (аналогично ipwhitelist-app).
## Возможности
-- Главная — состояние подключения и список таблиц (не системные схемы)
+- `GET /` — состояние подключения и список таблиц (не системные схемы)
- `GET /table?schema=public&name=
` — просмотр содержимого таблицы с пагинацией
- `POST /query` — SQL-консоль (read-only, только `SELECT`)
- `GET /healthz` — liveness-проба для k8s
@@ -15,16 +15,15 @@ Flask-приложение для доступа к PostgreSQL (managed k8s, int
```
getpgdata/
-├── requirements.txt
-└── site/
- ├── app.py
- ├── static/
- │ └── style.css
- └── templates/
- ├── index.html
- ├── table.html
- ├── query.html
- └── error.html
+├── package.json
+├── server.js # точка входа (Express)
+├── public/
+│ └── style.css
+└── views/
+ ├── index.ejs
+ ├── table.ejs
+ ├── query.ejs
+ └── error.ejs
```
## Переменные окружения (jsonEnv)
@@ -37,10 +36,10 @@ getpgdata/
"DB_USER": "super",
"DB_PASS": "",
"DB_SSLMODE": "disable",
- "DB_CONNECT_TIMEOUT": "5",
+ "DB_CONNECT_TIMEOUT": "5000",
"QUERY_MAX_ROWS": "200",
"APP_ENV": "production",
- "FLASK_DEBUG": "false"
+ "PORT": "5000"
}
```
@@ -50,8 +49,8 @@ getpgdata/
## Локальный запуск
```bash
-pip install -r requirements.txt
-DB_HOST= DB_USER= DB_PASS= python site/app.py
+npm install
+DB_HOST= DB_USER= DB_PASS= npm start
```
Если БД недоступна — приложение стартует и показывает ошибку на странице,
diff --git a/package-lock.json b/package-lock.json
new file mode 100644
index 0000000..4bbbb4b
--- /dev/null
+++ b/package-lock.json
@@ -0,0 +1,966 @@
+{
+ "name": "getpgdata",
+ "version": "1.0.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "getpgdata",
+ "version": "1.0.0",
+ "dependencies": {
+ "ejs": "^3.1.10",
+ "express": "^4.19.2",
+ "pg": "^8.11.5"
+ }
+ },
+ "node_modules/accepts": {
+ "version": "1.3.8",
+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
+ "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
+ "dependencies": {
+ "mime-types": "~2.1.34",
+ "negotiator": "0.6.3"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/array-flatten": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
+ "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
+ },
+ "node_modules/async": {
+ "version": "3.2.6",
+ "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz",
+ "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA=="
+ },
+ "node_modules/balanced-match": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
+ },
+ "node_modules/body-parser": {
+ "version": "1.20.6",
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.6.tgz",
+ "integrity": "sha512-p5tAzS57i5MV9fZFDj9LeIiTZEufbSe2eDozP+ElheSUq1m74CRq1jI4mYNDdVs9vQztXFLuk/Gd6BWTdwRJ5g==",
+ "dependencies": {
+ "bytes": "~3.1.2",
+ "content-type": "~1.0.5",
+ "debug": "2.6.9",
+ "depd": "2.0.0",
+ "destroy": "~1.2.0",
+ "http-errors": "~2.0.1",
+ "iconv-lite": "~0.4.24",
+ "on-finished": "~2.4.1",
+ "qs": "~6.15.1",
+ "raw-body": "~2.5.3",
+ "type-is": "~1.6.18",
+ "unpipe": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8",
+ "npm": "1.2.8000 || >= 1.4.16"
+ }
+ },
+ "node_modules/brace-expansion": {
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz",
+ "integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==",
+ "dependencies": {
+ "balanced-match": "^1.0.0"
+ }
+ },
+ "node_modules/bytes": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
+ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/call-bind-apply-helpers": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
+ "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/call-bound": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
+ "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.2",
+ "get-intrinsic": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/content-disposition": {
+ "version": "0.5.4",
+ "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
+ "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
+ "dependencies": {
+ "safe-buffer": "5.2.1"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/content-type": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
+ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/cookie": {
+ "version": "0.7.2",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
+ "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/cookie-signature": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz",
+ "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA=="
+ },
+ "node_modules/debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dependencies": {
+ "ms": "2.0.0"
+ }
+ },
+ "node_modules/depd": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
+ "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/destroy": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
+ "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==",
+ "engines": {
+ "node": ">= 0.8",
+ "npm": "1.2.8000 || >= 1.4.16"
+ }
+ },
+ "node_modules/dunder-proto": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
+ "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.1",
+ "es-errors": "^1.3.0",
+ "gopd": "^1.2.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/ee-first": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
+ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
+ },
+ "node_modules/ejs": {
+ "version": "3.1.10",
+ "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz",
+ "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==",
+ "dependencies": {
+ "jake": "^10.8.5"
+ },
+ "bin": {
+ "ejs": "bin/cli.js"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/encodeurl": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
+ "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/es-define-property": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
+ "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-errors": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-object-atoms": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz",
+ "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==",
+ "dependencies": {
+ "es-errors": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/escape-html": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
+ "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
+ },
+ "node_modules/etag": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
+ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/express": {
+ "version": "4.22.2",
+ "resolved": "https://registry.npmjs.org/express/-/express-4.22.2.tgz",
+ "integrity": "sha512-IuL+Elrou2ZvCFHs18/CIzy2Nzvo25nZ1/D2eIZlz7c+QUayAcYoiM2BthCjs+EBHVpjYjcuLDAiCWgeIX3X1Q==",
+ "dependencies": {
+ "accepts": "~1.3.8",
+ "array-flatten": "1.1.1",
+ "body-parser": "~1.20.5",
+ "content-disposition": "~0.5.4",
+ "content-type": "~1.0.4",
+ "cookie": "~0.7.1",
+ "cookie-signature": "~1.0.6",
+ "debug": "2.6.9",
+ "depd": "2.0.0",
+ "encodeurl": "~2.0.0",
+ "escape-html": "~1.0.3",
+ "etag": "~1.8.1",
+ "finalhandler": "~1.3.1",
+ "fresh": "~0.5.2",
+ "http-errors": "~2.0.0",
+ "merge-descriptors": "1.0.3",
+ "methods": "~1.1.2",
+ "on-finished": "~2.4.1",
+ "parseurl": "~1.3.3",
+ "path-to-regexp": "~0.1.12",
+ "proxy-addr": "~2.0.7",
+ "qs": "~6.15.1",
+ "range-parser": "~1.2.1",
+ "safe-buffer": "5.2.1",
+ "send": "~0.19.0",
+ "serve-static": "~1.16.2",
+ "setprototypeof": "1.2.0",
+ "statuses": "~2.0.1",
+ "type-is": "~1.6.18",
+ "utils-merge": "1.0.1",
+ "vary": "~1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.10.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/filelist": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.6.tgz",
+ "integrity": "sha512-5giy2PkLYY1cP39p17Ech+2xlpTRL9HLspOfEgm0L6CwBXBTgsK5ou0JtzYuepxkaQ/tvhCFIJ5uXo0OrM2DxA==",
+ "dependencies": {
+ "minimatch": "^5.0.1"
+ }
+ },
+ "node_modules/finalhandler": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz",
+ "integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==",
+ "dependencies": {
+ "debug": "2.6.9",
+ "encodeurl": "~2.0.0",
+ "escape-html": "~1.0.3",
+ "on-finished": "~2.4.1",
+ "parseurl": "~1.3.3",
+ "statuses": "~2.0.2",
+ "unpipe": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/forwarded": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
+ "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/fresh": {
+ "version": "0.5.2",
+ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
+ "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/function-bind": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/get-intrinsic": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
+ "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.2",
+ "es-define-property": "^1.0.1",
+ "es-errors": "^1.3.0",
+ "es-object-atoms": "^1.1.1",
+ "function-bind": "^1.1.2",
+ "get-proto": "^1.0.1",
+ "gopd": "^1.2.0",
+ "has-symbols": "^1.1.0",
+ "hasown": "^2.0.2",
+ "math-intrinsics": "^1.1.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/get-proto": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
+ "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
+ "dependencies": {
+ "dunder-proto": "^1.0.1",
+ "es-object-atoms": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/gopd": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
+ "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/has-symbols": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
+ "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/hasown": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz",
+ "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==",
+ "dependencies": {
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/http-errors": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",
+ "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",
+ "dependencies": {
+ "depd": "~2.0.0",
+ "inherits": "~2.0.4",
+ "setprototypeof": "~1.2.0",
+ "statuses": "~2.0.2",
+ "toidentifier": "~1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/iconv-lite": {
+ "version": "0.4.24",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
+ "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
+ },
+ "node_modules/ipaddr.js": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
+ "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/jake": {
+ "version": "10.9.4",
+ "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.4.tgz",
+ "integrity": "sha512-wpHYzhxiVQL+IV05BLE2Xn34zW1S223hvjtqk0+gsPrwd/8JNLXJgZZM/iPFsYc1xyphF+6M6EvdE5E9MBGkDA==",
+ "dependencies": {
+ "async": "^3.2.6",
+ "filelist": "^1.0.4",
+ "picocolors": "^1.1.1"
+ },
+ "bin": {
+ "jake": "bin/cli.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/math-intrinsics": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
+ "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/media-typer": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
+ "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/merge-descriptors": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
+ "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==",
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/methods": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
+ "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mime": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
+ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
+ "bin": {
+ "mime": "cli.js"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/mime-db": {
+ "version": "1.52.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mime-types": {
+ "version": "2.1.35",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+ "dependencies": {
+ "mime-db": "1.52.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/minimatch": {
+ "version": "5.1.9",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz",
+ "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==",
+ "dependencies": {
+ "brace-expansion": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
+ },
+ "node_modules/negotiator": {
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
+ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/object-inspect": {
+ "version": "1.13.4",
+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
+ "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/on-finished": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
+ "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
+ "dependencies": {
+ "ee-first": "1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/parseurl": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
+ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/path-to-regexp": {
+ "version": "0.1.13",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz",
+ "integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA=="
+ },
+ "node_modules/pg": {
+ "version": "8.23.0",
+ "resolved": "https://registry.npmjs.org/pg/-/pg-8.23.0.tgz",
+ "integrity": "sha512-Ip2EQCngowJLGOfCwkFhPXU7/ljlhn6Rxlmy4XYfL2Y+vyRM59+8uR2xqRWKdYmbXmxCFOAmKxBuSUCdF34qLg==",
+ "dependencies": {
+ "pg-connection-string": "^2.14.0",
+ "pg-pool": "^3.14.0",
+ "pg-protocol": "^1.16.0",
+ "pg-types": "2.2.0",
+ "pgpass": "1.0.5"
+ },
+ "engines": {
+ "node": ">= 16.0.0"
+ },
+ "optionalDependencies": {
+ "pg-cloudflare": "^1.4.0"
+ },
+ "peerDependencies": {
+ "pg-native": ">=3.0.1"
+ },
+ "peerDependenciesMeta": {
+ "pg-native": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/pg-cloudflare": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.4.0.tgz",
+ "integrity": "sha512-Vo7z/6rrQYxpNRylp4Tlob2elzbh+N/MOQbxFVWCxS7oEx6jF53GTJFxK2WWpKuBRkmiin4Mt+xofFDjx09R0A==",
+ "optional": true
+ },
+ "node_modules/pg-connection-string": {
+ "version": "2.14.0",
+ "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.14.0.tgz",
+ "integrity": "sha512-XwWDGcLRGCXAR8F/AM5bG7Q+A3Wm2s6QeEjlOKZLlH3UYcguiqCWKyWXVag5TLTIjR7oOJUY8kcADaZgWPyLeg=="
+ },
+ "node_modules/pg-int8": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz",
+ "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==",
+ "engines": {
+ "node": ">=4.0.0"
+ }
+ },
+ "node_modules/pg-pool": {
+ "version": "3.14.0",
+ "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.14.0.tgz",
+ "integrity": "sha512-gKtPkFdQPU3DksooVLi9LsjZxrsBUZIpa+7aVx+LV5pNh0KzP4Zleud2po+ConrxbuXGBJ6Hfer6hdgpIBpBaw==",
+ "peerDependencies": {
+ "pg": ">=8.0"
+ }
+ },
+ "node_modules/pg-protocol": {
+ "version": "1.16.0",
+ "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.16.0.tgz",
+ "integrity": "sha512-sILXutLVjCLjcDuOmvhX5e2Z4cS5qG/6Bu3VkpFwdf/633ElGLpEh9bgmuI5I4sqKqkifQiGyiCcx1HdtrK7tg=="
+ },
+ "node_modules/pg-types": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz",
+ "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==",
+ "dependencies": {
+ "pg-int8": "1.0.1",
+ "postgres-array": "~2.0.0",
+ "postgres-bytea": "~1.0.0",
+ "postgres-date": "~1.0.4",
+ "postgres-interval": "^1.1.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/pgpass": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz",
+ "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==",
+ "dependencies": {
+ "split2": "^4.1.0"
+ }
+ },
+ "node_modules/picocolors": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="
+ },
+ "node_modules/postgres-array": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",
+ "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/postgres-bytea": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.1.tgz",
+ "integrity": "sha512-5+5HqXnsZPE65IJZSMkZtURARZelel2oXUEO8rH83VS/hxH5vv1uHquPg5wZs8yMAfdv971IU+kcPUczi7NVBQ==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/postgres-date": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz",
+ "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/postgres-interval": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz",
+ "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==",
+ "dependencies": {
+ "xtend": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/proxy-addr": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
+ "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
+ "dependencies": {
+ "forwarded": "0.2.0",
+ "ipaddr.js": "1.9.1"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/qs": {
+ "version": "6.15.3",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz",
+ "integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==",
+ "dependencies": {
+ "es-define-property": "^1.0.1",
+ "side-channel": "^1.1.1"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/range-parser": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
+ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/raw-body": {
+ "version": "2.5.3",
+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz",
+ "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==",
+ "dependencies": {
+ "bytes": "~3.1.2",
+ "http-errors": "~2.0.1",
+ "iconv-lite": "~0.4.24",
+ "unpipe": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/safe-buffer": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/safer-buffer": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
+ },
+ "node_modules/send": {
+ "version": "0.19.2",
+ "resolved": "https://registry.npmjs.org/send/-/send-0.19.2.tgz",
+ "integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==",
+ "dependencies": {
+ "debug": "2.6.9",
+ "depd": "2.0.0",
+ "destroy": "1.2.0",
+ "encodeurl": "~2.0.0",
+ "escape-html": "~1.0.3",
+ "etag": "~1.8.1",
+ "fresh": "~0.5.2",
+ "http-errors": "~2.0.1",
+ "mime": "1.6.0",
+ "ms": "2.1.3",
+ "on-finished": "~2.4.1",
+ "range-parser": "~1.2.1",
+ "statuses": "~2.0.2"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/send/node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
+ },
+ "node_modules/serve-static": {
+ "version": "1.16.3",
+ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz",
+ "integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==",
+ "dependencies": {
+ "encodeurl": "~2.0.0",
+ "escape-html": "~1.0.3",
+ "parseurl": "~1.3.3",
+ "send": "~0.19.1"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/setprototypeof": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
+ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
+ },
+ "node_modules/side-channel": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz",
+ "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "object-inspect": "^1.13.4",
+ "side-channel-list": "^1.0.1",
+ "side-channel-map": "^1.0.1",
+ "side-channel-weakmap": "^1.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-list": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz",
+ "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "object-inspect": "^1.13.4"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-map": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
+ "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
+ "dependencies": {
+ "call-bound": "^1.0.2",
+ "es-errors": "^1.3.0",
+ "get-intrinsic": "^1.2.5",
+ "object-inspect": "^1.13.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-weakmap": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
+ "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
+ "dependencies": {
+ "call-bound": "^1.0.2",
+ "es-errors": "^1.3.0",
+ "get-intrinsic": "^1.2.5",
+ "object-inspect": "^1.13.3",
+ "side-channel-map": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/split2": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz",
+ "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==",
+ "engines": {
+ "node": ">= 10.x"
+ }
+ },
+ "node_modules/statuses": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz",
+ "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/toidentifier": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
+ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
+ "engines": {
+ "node": ">=0.6"
+ }
+ },
+ "node_modules/type-is": {
+ "version": "1.6.18",
+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
+ "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
+ "dependencies": {
+ "media-typer": "0.3.0",
+ "mime-types": "~2.1.24"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/unpipe": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
+ "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/utils-merge": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
+ "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",
+ "engines": {
+ "node": ">= 0.4.0"
+ }
+ },
+ "node_modules/vary": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
+ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/xtend": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
+ "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
+ "engines": {
+ "node": ">=0.4"
+ }
+ }
+ }
+}
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..c725c00
--- /dev/null
+++ b/package.json
@@ -0,0 +1,15 @@
+{
+ "name": "getpgdata",
+ "version": "1.0.0",
+ "description": "Node.js приложение для доступа к PostgreSQL (managed k8s, internal-only)",
+ "main": "server.js",
+ "scripts": {
+ "start": "node server.js",
+ "check": "node -c server.js"
+ },
+ "dependencies": {
+ "ejs": "^3.1.10",
+ "express": "^4.19.2",
+ "pg": "^8.11.5"
+ }
+}
diff --git a/site/static/style.css b/public/style.css
similarity index 100%
rename from site/static/style.css
rename to public/style.css
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644
index 247ea33..0000000
--- a/requirements.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Flask>=3.0
-gunicorn>=21.2
-psycopg2-binary>=2.9
diff --git a/server.js b/server.js
new file mode 100644
index 0000000..e7772c4
--- /dev/null
+++ b/server.js
@@ -0,0 +1,179 @@
+/**
+ * getpgdata — Node.js приложение для доступа к PostgreSQL (managed k8s, internal-only).
+ *
+ * Точка входа для Nubes NodeJS managed service (аналогично ipwhitelist-app).
+ * Подключение к БД — через переменные окружения DB_HOST/DB_PORT/DB_NAME/DB_USER/DB_PASS/DB_SSLMODE.
+ *
+ * Функции:
+ * GET / — состояние подключения + список таблиц
+ * GET /table?schema=&name=&page= — содержимое таблицы с пагинацией
+ * POST /query — SQL-консоль (read-only, только SELECT)
+ * GET /healthz — liveness-проба для k8s
+ */
+
+const path = require('path');
+const express = require('express');
+const { Pool } = require('pg');
+
+const app = express();
+app.set('view engine', 'ejs');
+app.set('views', path.join(__dirname, 'views'));
+
+const APP_ENV = process.env.APP_ENV || 'production';
+const QUERY_MAX_ROWS = parseInt(process.env.QUERY_MAX_ROWS || '200', 10);
+
+// ---------------------------------------------------------------------------
+// Конфигурация подключения к PostgreSQL
+// ---------------------------------------------------------------------------
+function dbConfig() {
+ return {
+ host: process.env.DB_HOST || 'postgresqlk8s-master.60bdf3e3-5087-41ff-b760-fe6ea544a80e.svc.cluster.local',
+ port: parseInt(process.env.DB_PORT || '5432', 10),
+ database: process.env.DB_NAME || 'postgres',
+ user: process.env.DB_USER || 'super',
+ password: process.env.DB_PASS || '',
+ ssl: process.env.DB_SSLMODE === 'require' ? { rejectUnauthorized: false } : false,
+ connectionTimeoutMillis: parseInt(process.env.DB_CONNECT_TIMEOUT || '5000', 10),
+ };
+}
+
+// Пул создаётся при старте; если БД недоступна — приложение не падает,
+// а отдаёт ошибку на страницах (важно для health-проб k8s).
+const pool = new Pool(dbConfig());
+
+// ---------------------------------------------------------------------------
+// Middleware
+// ---------------------------------------------------------------------------
+app.use(express.urlencoded({ extended: true }));
+app.use(express.json());
+app.use('/public', express.static(path.join(__dirname, 'public')));
+
+// ---------------------------------------------------------------------------
+// Маршруты
+// ---------------------------------------------------------------------------
+
+// Liveness-проба
+app.get('/healthz', async (req, res) => {
+ try {
+ await pool.query('SELECT 1');
+ res.status(200).json({ status: 'ok', db: 'connected' });
+ } catch (e) {
+ res.status(503).json({ status: 'degraded', db: 'unreachable', error: e.message });
+ }
+});
+
+// Главная: состояние подключения + список таблиц
+app.get('/', async (req, res) => {
+ let tables = null;
+ let error = null;
+
+ try {
+ const r = await pool.query(
+ `SELECT schemaname, tablename
+ FROM pg_tables
+ WHERE schemaname NOT IN ('pg_catalog', 'information_schema')
+ ORDER BY schemaname, tablename`
+ );
+ tables = r.rows;
+ } catch (e) {
+ error = e.message;
+ }
+
+ res.render('index', {
+ cfg: dbConfig(),
+ tables,
+ error,
+ env: APP_ENV,
+ });
+});
+
+// Просмотр таблицы с пагинацией
+app.get('/table', async (req, res) => {
+ const schema = (req.query.schema || 'public').replace(/[^a-zA-Z0-9_]/g, '');
+ const name = (req.query.name || '').replace(/[^a-zA-Z0-9_]/g, '');
+ const page = Math.max(parseInt(req.query.page || '1', 10) || 1, 1);
+ const perPage = Math.min(Math.max(parseInt(req.query.per_page || '50', 10) || 50, 1), 500);
+
+ if (!name) return res.redirect('/');
+
+ const fullName = `${schema}.${name}`;
+ let rows = null;
+ let columns = null;
+ let count = null;
+ let error = null;
+
+ try {
+ // Проверяем существование таблицы
+ const chk = await pool.query('SELECT to_regclass($1) AS reg', [fullName]);
+ if (!chk.rows[0].reg) {
+ return res.status(404).render('error', { code: 404, message: `Таблица ${fullName} не найдена` });
+ }
+
+ const cnt = await pool.query(`SELECT COUNT(*) AS n FROM ${fullName}`);
+ count = parseInt(cnt.rows[0].n, 10);
+
+ const offset = (page - 1) * perPage;
+ const q = await pool.query(`SELECT * FROM ${fullName} ORDER BY 1 LIMIT $1 OFFSET $2`, [perPage, offset]);
+ rows = q.rows;
+ columns = q.fields.map((f) => f.name);
+ } catch (e) {
+ error = e.message;
+ }
+
+ res.render('table', { schema, name, columns, rows, count, page, perPage, error });
+});
+
+// SQL-консоль (read-only, только SELECT)
+app.get('/query', (req, res) => {
+ res.render('query', { sql: '', columns: null, rows: null, error: null, elapsed: null });
+});
+
+app.post('/query', async (req, res) => {
+ let sql = (req.body.sql || '').trim().replace(/;\s*$/, '');
+ let columns = null;
+ let rows = null;
+ let error = null;
+ let elapsed = null;
+
+ if (sql) {
+ const startsWithSelect = /^\s*select\b/i.test(sql);
+ if (!startsWithSelect) {
+ error = 'Разрешены только SELECT-запросы (read-only режим)';
+ } else {
+ const start = Date.now();
+ try {
+ const q = await pool.query(sql);
+ if (q.fields) {
+ columns = q.fields.map((f) => f.name);
+ rows = q.rows.slice(0, QUERY_MAX_ROWS);
+ }
+ } catch (e) {
+ error = `Ошибка базы данных: ${e.message}`;
+ }
+ elapsed = ((Date.now() - start) / 1000).toFixed(3);
+ }
+ }
+
+ res.render('query', { sql, columns, rows, error, elapsed, QUERY_MAX_ROWS });
+});
+
+// Обработка 404
+app.use((req, res) => {
+ res.status(404).render('error', { code: 404, message: 'Страница не найдена' });
+});
+
+// Обработка ошибок
+app.use((err, req, res, next) => {
+ res.status(500).render('error', { code: 500, message: err.message || 'Внутренняя ошибка' });
+});
+
+// ---------------------------------------------------------------------------
+// Запуск
+// ---------------------------------------------------------------------------
+const PORT = parseInt(process.env.PORT || '5000', 10);
+
+app.listen(PORT, '0.0.0.0', () => {
+ console.log(`getpgdata listening on port ${PORT} (env=${APP_ENV})`);
+});
+
+module.exports = app;
diff --git a/site/app.py b/site/app.py
deleted file mode 100644
index ff37835..0000000
--- a/site/app.py
+++ /dev/null
@@ -1,211 +0,0 @@
-"""
-Flask-приложение для доступа к PostgreSQL (managed k8s, internal-only).
-
-Структура соответствует требованиям платформы Nubes:
- repo/
- └── site/
- ├── app.py
- ├── static/
- └── templates/
-
-Подключение к БД — через переменные окружения:
- DB_HOST, DB_PORT, DB_NAME, DB_USER, DB_PASS, DB_SSLMODE
-Если БД недоступна — приложение стартует и показывает ошибку на странице,
-а не падает (важно для k8s health-проб и диагностики).
-
-Запуск в dev:
- python site/app.py
-"""
-
-import os
-
-from flask import Flask, abort, redirect, render_template, request, url_for
-
-import psycopg2
-import psycopg2.extras
-
-
-app = Flask(__name__, template_folder="templates", static_folder="static")
-
-
-def db_config():
- """Возвращает параметры подключения к PostgreSQL из окружения."""
- return {
- "host": os.getenv("DB_HOST", "postgresqlk8s-master.60bdf3e3-5087-41ff-b760-fe6ea544a80e.svc.cluster.local"),
- "port": int(os.getenv("DB_PORT", "5432")),
- "dbname": os.getenv("DB_NAME", "postgres"),
- "user": os.getenv("DB_USER", "super"),
- "password": os.getenv("DB_PASS", ""),
- "sslmode": os.getenv("DB_SSLMODE", "disable"),
- "connect_timeout": int(os.getenv("DB_CONNECT_TIMEOUT", "5")),
- }
-
-
-def connect():
- """Открывает соединение с PostgreSQL."""
- try:
- return psycopg2.connect(**db_config())
- except psycopg2.Error as exc:
- raise ConnectionError(f"Нет соединения с PostgreSQL: {exc}") from exc
-
-
-@app.route("/healthz")
-def healthz():
- """Liveness-проба для k8s."""
- try:
- with connect() as conn:
- with conn.cursor() as cur:
- cur.execute("SELECT 1")
- cur.fetchone()
- return {"status": "ok", "db": "connected"}, 200
- except Exception:
- return {"status": "degraded", "db": "unreachable"}, 503
-
-
-@app.route("/")
-def index():
- """Главная: состояние подключения + список таблиц."""
- cfg = db_config()
- show_password = os.getenv("SHOW_DB_PASSWORD", "").lower() in ("1", "true", "yes")
-
- tables = None
- error = None
-
- try:
- with connect() as conn:
- with conn.cursor(cursor_factory=psycopg2.extras.RealDictCursor) as cur:
- cur.execute(
- """
- SELECT schemaname, tablename
- FROM pg_tables
- WHERE schemaname NOT IN ('pg_catalog', 'information_schema')
- ORDER BY schemaname, tablename
- """
- )
- tables = cur.fetchall()
- except ConnectionError as exc:
- error = str(exc)
- except psycopg2.Error as exc:
- error = f"Ошибка базы данных: {exc}"
-
- if show_password:
- cfg["password"] = "***"
-
- return render_template(
- "index.html",
- cfg=cfg,
- tables=tables,
- error=error,
- env=os.getenv("APP_ENV", "production"),
- )
-
-
-@app.route("/table")
-def table():
- """Просмотр содержимого таблицы с пагинацией."""
- schema = request.args.get("schema", "public")
- name = request.args.get("name", "")
- page = max(request.args.get("page", 1, type=int), 1)
- per_page = min(max(request.args.get("per_page", 50, type=int), 1), 500)
-
- if not name:
- return redirect(url_for("index"))
-
- full_name = f'"{schema}"."{name}"'
- rows = None
- columns = None
- count = None
- error = None
-
- try:
- with connect() as conn:
- with conn.cursor(cursor_factory=psycopg2.extras.RealDictCursor) as cur:
- # Проверяем, что таблица существует
- cur.execute(
- """
- SELECT to_regclass(%s) AS reg
- """,
- (full_name,),
- )
- if cur.fetchone()["reg"] is None:
- abort(404, f"Таблица {full_name} не найдена")
-
- cur.execute(f'SELECT COUNT(*) AS n FROM {full_name}')
- count = cur.fetchone()["n"]
-
- offset = (page - 1) * per_page
- cur.execute(
- f'SELECT * FROM {full_name} ORDER BY 1 LIMIT %s OFFSET %s',
- (per_page, offset),
- )
- rows = cur.fetchall()
- if rows:
- columns = list(rows[0].keys())
- except ConnectionError as exc:
- error = str(exc)
- except psycopg2.Error as exc:
- error = f"Ошибка базы данных: {exc}"
-
- return render_template(
- "table.html",
- schema=schema,
- name=name,
- columns=columns,
- rows=rows,
- count=count,
- page=page,
- per_page=per_page,
- error=error,
- )
-
-
-@app.route("/query", methods=["GET", "POST"])
-def query():
- """Простейшая консоль SQL (read-only SELECT)."""
- sql = request.form.get("sql", "") if request.method == "POST" else request.args.get("sql", "")
- columns = None
- rows = None
- error = None
- elapsed = None
-
- if sql:
- sql_clean = sql.strip().rstrip(";")
- if not sql_clean.lower().lstrip().startswith("select"):
- error = "Разрешены только SELECT-запросы (read-only режим)"
- else:
- import time
- start = time.time()
- try:
- with connect() as conn:
- with conn.cursor(cursor_factory=psycopg2.extras.RealDictCursor) as cur:
- cur.execute(sql_clean)
- if cur.description:
- max_rows = int(os.getenv("QUERY_MAX_ROWS", "200"))
- rows = cur.fetchmany(max_rows)
- columns = list(rows[0].keys()) if rows else [d.name for d in cur.description]
- except ConnectionError as exc:
- error = str(exc)
- except psycopg2.Error as exc:
- error = f"Ошибка базы данных: {exc}"
- elapsed = round(time.time() - start, 3)
-
- return render_template(
- "query.html",
- sql=sql,
- columns=columns,
- rows=rows,
- error=error,
- elapsed=elapsed,
- QUERY_MAX_ROWS=int(os.getenv("QUERY_MAX_ROWS", "200")),
- )
-
-
-@app.errorhandler(404)
-def not_found(exc):
- return render_template("error.html", code=404, message=exc.description or "Страница не найдена"), 404
-
-
-if __name__ == "__main__":
- app.run(debug=os.getenv("FLASK_DEBUG", "true").lower() in ("1", "true", "yes"),
- host="0.0.0.0",
- port=int(os.getenv("PORT", "5000")))
diff --git a/site/templates/error.html b/site/templates/error.html
deleted file mode 100644
index d05faf9..0000000
--- a/site/templates/error.html
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
- Ошибка {{ code }}
-
-
-
-
-
- {{ message }}
- ← На главную
-
-
-
diff --git a/site/templates/index.html b/site/templates/index.html
deleted file mode 100644
index 40c3e15..0000000
--- a/site/templates/index.html
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
- PostgreSQL Access
-
-
-
-
-
-
-
- Подключение
-
- Host {{ cfg.host }}
- Port {{ cfg.port }}
- Database {{ cfg.dbname }}
- User {{ cfg.user }}
-
- {% if error %}
- {{ error }}
- {% else %}
- ✓ Подключение активно
- {% endif %}
-
-
- {% if tables is not none and not error %}
-
- Таблицы ({{ tables|length }})
- {% if tables %}
-
-
- Схема Таблица
-
-
- {% for t in tables %}
-
- {{ t.schemaname }}
- {{ t.tablename }}
-
- открыть
-
-
- {% endfor %}
-
-
- {% else %}
- Доступных таблиц нет.
- {% endif %}
-
- {% endif %}
-
-
-
diff --git a/site/templates/query.html b/site/templates/query.html
deleted file mode 100644
index 98cce9e..0000000
--- a/site/templates/query.html
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
- SQL-консоль
-
-
-
-
-
-
-
-
- {% if error %}
- {{ error }}
- {% endif %}
-
- {% if columns is not none and not error %}
-
- Результат {% if elapsed is not none %}({{ elapsed }} c){% endif %}
- {% if columns %}
-
-
-
- {% for c in columns %}{{ c }} {% endfor %}
-
-
- {% for r in rows %}
-
- {% for c in columns %}
-
- {% if r[c] is none %}NULL
- {% elif r[c] is boolean %}{{ 'true' if r[c] else 'false' }}
- {% else %}{{ r[c] }}{% endif %}
-
- {% endfor %}
-
- {% endfor %}
-
-
-
- Строк: {{ rows|length }}
- {% else %}
- Запрос выполнен без набора строк.
- {% endif %}
-
- {% endif %}
-
-
-
diff --git a/site/templates/table.html b/site/templates/table.html
deleted file mode 100644
index 6ff17e2..0000000
--- a/site/templates/table.html
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
- Таблица — {{ schema }}.{{ name }}
-
-
-
-
-
-
- {% if error %}
- {{ error }}
- {% else %}
- Строк всего: {{ count }} . Показано: {{ rows|length }} (стр. {{ page }}).
-
- {% if columns %}
-
-
-
-
- {% for c in columns %}{{ c }} {% endfor %}
-
-
-
- {% for r in rows %}
-
- {% for c in columns %}
-
- {% if r[c] is none %}NULL
- {% elif r[c] is boolean %}{{ 'true' if r[c] else 'false' }}
- {% else %}{{ r[c] }}{% endif %}
-
- {% endfor %}
-
- {% endfor %}
-
-
-
-
-
- {% else %}
- Таблица пуста.
- {% endif %}
- {% endif %}
-
-
-
diff --git a/views/error.ejs b/views/error.ejs
new file mode 100644
index 0000000..8c32cc8
--- /dev/null
+++ b/views/error.ejs
@@ -0,0 +1,16 @@
+
+
+
+
+
+ Ошибка <%= code %>
+
+
+
+
+
+ <%= message %>
+ ← На главную
+
+
+
diff --git a/views/index.ejs b/views/index.ejs
new file mode 100644
index 0000000..a5e5ef7
--- /dev/null
+++ b/views/index.ejs
@@ -0,0 +1,60 @@
+
+
+
+
+
+ PostgreSQL Access
+
+
+
+
+ PostgreSQL Access
+
+ Главная
+ SQL-консоль
+
+ <% if (env === 'test') { %>TEST <% } %>
+
+
+
+
+ Подключение
+
+ Host <%= cfg.host %>
+ Port <%= cfg.port %>
+ Database <%= cfg.database %>
+ User <%= cfg.user %>
+
+ <% if (error) { %>
+ <%= error %>
+ <% } else { %>
+ ✓ Подключение активно
+ <% } %>
+
+
+ <% if (tables && !error) { %>
+
+ Таблицы (<%= tables.length %>)
+ <% if (tables.length) { %>
+
+
+ Схема Таблица
+
+
+ <% tables.forEach(function (t) { %>
+
+ <%= t.schemaname %>
+ <%= t.tablename %>
+ открыть
+
+ <% }); %>
+
+
+ <% } else { %>
+ Доступных таблиц нет.
+ <% } %>
+
+ <% } %>
+
+
+
diff --git a/views/query.ejs b/views/query.ejs
new file mode 100644
index 0000000..cd45a4d
--- /dev/null
+++ b/views/query.ejs
@@ -0,0 +1,64 @@
+
+
+
+
+
+ SQL-консоль
+
+
+
+
+
+
+
+
+ <%= sql %>
+ Выполнить
+ Только SELECT. Обрезается до <%= QUERY_MAX_ROWS || 200 %> строк.
+
+
+
+ <% if (error) { %>
+ <%= error %>
+ <% } %>
+
+ <% if (columns && !error) { %>
+
+ Результат <% if (elapsed !== null) { %>(<%= elapsed %> c)<% } %>
+ <% if (columns.length) { %>
+
+
+
+ <% columns.forEach(function (c) { %><%= c %> <% }); %>
+
+
+ <% rows.forEach(function (r) { %>
+
+ <% columns.forEach(function (c) { %>
+
+ <% if (r[c] === null) { %>NULL
+ <% } else if (typeof r[c] === 'boolean') { %><%= r[c] ? 'true' : 'false' %>
+ <% } else if (r[c] instanceof Date) { %><%= r[c].toISOString() %>
+ <% } else { %><%= r[c] %><% } %>
+
+ <% }); %>
+
+ <% }); %>
+
+
+
+ Строк: <%= rows.length %>
+ <% } else { %>
+ Запрос выполнен без набора строк.
+ <% } %>
+
+ <% } %>
+
+
+
diff --git a/views/table.ejs b/views/table.ejs
new file mode 100644
index 0000000..e2fa639
--- /dev/null
+++ b/views/table.ejs
@@ -0,0 +1,61 @@
+
+
+
+
+
+ Таблица — <%= schema %>.<%= name %>
+
+
+
+
+
+
+ <% if (error) { %>
+ <%= error %>
+ <% } else { %>
+ Строк всего: <%= count %> . Показано: <%= rows.length %> (стр. <%= page %>).
+
+ <% if (columns && columns.length) { %>
+
+
+
+ <% columns.forEach(function (c) { %><%= c %> <% }); %>
+
+
+ <% rows.forEach(function (r) { %>
+
+ <% columns.forEach(function (c) { %>
+
+ <% if (r[c] === null) { %>NULL
+ <% } else if (typeof r[c] === 'boolean') { %><%= r[c] ? 'true' : 'false' %>
+ <% } else if (r[c] instanceof Date) { %><%= r[c].toISOString() %>
+ <% } else { %><%= r[c] %><% } %>
+
+ <% }); %>
+
+ <% }); %>
+
+
+
+
+
+ <% } else { %>
+ Таблица пуста.
+ <% } %>
+ <% } %>
+
+
+