Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: rename max_result variable default to MB #917

Merged
merged 1 commit into from
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"test": "run-s db:clean db:run test:run db:clean",
"db:clean": "cd test/db && docker compose down",
"db:run": "cd test/db && docker compose up --detach --wait",
"test:run": "PG_META_MAX_RESULT_SIZE=20971520 vitest run --coverage",
"test:update": "run-s db:clean db:run && PG_META_MAX_RESULT_SIZE=20971520 vitest run --update && run-s db:clean"
"test:run": "PG_META_MAX_RESULT_SIZE_MB=20 vitest run --coverage",
"test:update": "run-s db:clean db:run && PG_META_MAX_RESULT_SIZE_MB=20 vitest run --update && run-s db:clean"
},
"engines": {
"node": ">=20",
Expand Down
6 changes: 4 additions & 2 deletions src/server/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ export const GENERATE_TYPES_SWIFT_ACCESS_CONTROL = process.env
? (process.env.PG_META_GENERATE_TYPES_SWIFT_ACCESS_CONTROL as AccessControl)
: 'internal'

export const PG_META_MAX_RESULT_SIZE = process.env.PG_META_MAX_RESULT_SIZE
? parseInt(process.env.PG_META_MAX_RESULT_SIZE, 10)
export const PG_META_MAX_RESULT_SIZE = process.env.PG_META_MAX_RESULT_SIZE_MB
? // Node-postgres get a maximum size in bytes make the conversion from the env variable
// from MB to Bytes
parseInt(process.env.PG_META_MAX_RESULT_SIZE_MB, 10) * 1024 * 1024
: 2 * 1024 * 1024 * 1024 // default to 2GB max query size result

export const DEFAULT_POOL_CONFIG: PoolConfig = {
Expand Down