Commit af1a932
fix(db-postgres): bump
### What?
Upgrade `drizzle-orm` from 0.44.7 to 0.45.2 and `pg` from 8.16.3 to
8.20.0 (with `@types/pg` 8.10.2 → 8.20.0) across all database adapter
packages.
### Why?
**Security:**
[`drizzle-orm@0.45.2`](https://github.com/drizzle-team/drizzle-orm/releases/tag/0.45.2)
patches an SQL injection vulnerability (CWE-89) in `sql.identifier()`
and `sql.as()` where values were not properly escaped.
**Maintenance:** Bringing `pg` / `@types/pg` current picks up upstream
fixes and keeps the adapters aligned with the types the rest of the
monorepo already resolves.
The [`@vercel/postgres`](https://www.npmjs.com/package/@vercel/postgres)
→
[`@neondatabase/serverless`](https://www.npmjs.com/package/@neondatabase/serverless)
migration has been split out into a separate PR for independent review.
siimsams#1
### How?
- **`drizzle-orm` 0.44.7 → 0.45.2** in `db-postgres`, `db-sqlite`,
`db-d1-sqlite`, `db-vercel-postgres`, `drizzle`
- **`pg` 8.16.3 → 8.20.0** and **`@types/pg` 8.10.2 → 8.20.0** in
`db-postgres`, `db-vercel-postgres`, `drizzle`
- **`db-postgres/src/types.ts`:** Fix `PgDependency` type to `typeof
import('pg').default` — `@types/pg@8.20.0` added an `index.d.mts` with
ESM types where `PG` is a module-level declaration, making the old
`typeof import('pg')` incompatible with the default import
- **`db-vercel-postgres/src/connect.ts`:** Cast `client` to `pg.Pool` at
the two `drizzle()` call sites. `drizzle-orm@0.45.2` tightened
`NodePgClient` to `pg.Pool | PoolClient | Client`, and `VercelPool`
extends `@neondatabase/serverless`'s `Pool` (not `pg`'s), so the cast is
required to satisfy the stricter type while preserving runtime behavior.
---------
Co-authored-by: Sasha Rakhmatulin <sasha@ritsuko.dev>drizzle-orm to 0.45.2 to resolve an SQL injection vulnerability and pg to 8.20.0 (#16168)1 parent ac01e82 commit af1a932
9 files changed
Lines changed: 198 additions & 87 deletions
File tree
- packages
- db-d1-sqlite
- db-postgres
- src
- db-sqlite
- db-vercel-postgres
- src
- drizzle
- test/admin/e2e/list-view
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
| 81 | + | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 11 | + | |
19 | 12 | | |
20 | 13 | | |
21 | | - | |
| 14 | + | |
22 | 15 | | |
23 | 16 | | |
24 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
| 81 | + | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
0 commit comments