Commit cf87538
committed
chore(drizzle): alias _query to query and enforce via lint
Prep for drizzle v1, which renames the RQB namespace from `query` to
`_query`. Adds a runtime alias so both names work, rewrites every
`.query` drizzle receiver to `._query`, and enforces the new name with
an oxlint rule plus a type-aware CI check.
- New `@kilocode/drizzle-shims` package patches PgDatabase and
BaseSQLiteDatabase prototypes with a `_query` getter; transaction
subclasses (`tx._query`) are covered automatically.
- Side-effect imports added at every `drizzle(...)` construction site
(packages/db client plus 12 DO service files).
- `oxlint-plugin-drizzle.js` gains `prefer-underscore-query` (autofix,
name-gated: db / ctx.db / this.db / tx / trx).
- `scripts/drizzle-query-rename.ts` is a ts-morph codemod/verifier that
walks every workspace tsconfig plus dev/ and scripts/ orphans and
checks the drizzle `query` property by declaration location. Exposed
as `pnpm drizzle:query-rename` and `pnpm drizzle:query-check`; the
check runs as part of `pnpm validate`.
- 372 call sites across 76 files rewritten.1 parent c87cf72 commit cf87538
108 files changed
Lines changed: 1045 additions & 401 deletions
File tree
- apps/web/src
- app
- admin
- api/users
- add-credit
- credit-transactions
- payment-methods
- organizations/[id]/webhooks
- users/[id]
- webhooks
- api
- cron/deployment-threat-scan
- dev/create-kilocode-org
- up
- user-deployments/webhook
- payments/topup/success
- lib
- ai-gateway
- code-reviews/dispatch
- contributor-champions
- kilo-pass
- kiloclaw
- organizations
- routers
- admin
- organizations
- scripts
- db
- tests
- dev/seed/kiloclaw-billing
- packages
- db
- src
- drizzle-shims
- src
- scripts
- services
- ai-attribution
- src/dos
- app-builder
- src
- cloud-agent-next
- src/persistence
- cloud-agent
- src/persistence
- kilo-chat
- src/do
- kiloclaw
- src/durable-objects
- o11y
- src/alerting
- session-ingest
- src/dos
- webhook-agent-ingest
- src/dos
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
123 | 127 | | |
124 | 128 | | |
125 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
0 commit comments