Skip to content

Commit 52cd95f

Browse files
authored
Merge pull request #917 from supabase/chore/update-result-size-env-format
fix: rename max_result variable default to MB
2 parents bf544ff + 2b7c43f commit 52cd95f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
"test": "run-s db:clean db:run test:run db:clean",
3131
"db:clean": "cd test/db && docker compose down",
3232
"db:run": "cd test/db && docker compose up --detach --wait",
33-
"test:run": "PG_META_MAX_RESULT_SIZE=20971520 vitest run --coverage",
34-
"test:update": "run-s db:clean db:run && PG_META_MAX_RESULT_SIZE=20971520 vitest run --update && run-s db:clean"
33+
"test:run": "PG_META_MAX_RESULT_SIZE_MB=20 vitest run --coverage",
34+
"test:update": "run-s db:clean db:run && PG_META_MAX_RESULT_SIZE_MB=20 vitest run --update && run-s db:clean"
3535
},
3636
"engines": {
3737
"node": ">=20",

src/server/constants.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ export const GENERATE_TYPES_SWIFT_ACCESS_CONTROL = process.env
4949
? (process.env.PG_META_GENERATE_TYPES_SWIFT_ACCESS_CONTROL as AccessControl)
5050
: 'internal'
5151

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

5658
export const DEFAULT_POOL_CONFIG: PoolConfig = {

0 commit comments

Comments
 (0)