Skip to content

DbProxy - Clarify internal table filtering in schema export#2856

Merged
eshurakov merged 1 commit intomainfrom
eshurakov/descriptive-citrine
Apr 28, 2026
Merged

DbProxy - Clarify internal table filtering in schema export#2856
eshurakov merged 1 commit intomainfrom
eshurakov/descriptive-citrine

Conversation

@eshurakov
Copy link
Copy Markdown
Contributor

Summary

Refactors AppDbDO.getSchema() in services/db-proxy/src/app-db-do.ts to make the filtering of internal tables and indexes explicit and self-documenting. Replaces opaque SQL LIKE / ESCAPE patterns with named static predicates isInternalTableName and isInternalIndexName, with a JSDoc comment spelling out exactly which tables are excluded and why (sqlite_* SQLite-managed tables, _cf_* Cloudflare DO KV-API backing tables, and __drizzle_migrations bookkeeping).

No behavior change — only the previous __\_% escape pattern (which matched __drizzle_migrations but would have missed other internal tables) is replaced with an equivalent, more explicit filter.

Verification

  • Manually reviewed the diff to confirm the filter covers the same tables as before plus the _cf_* DO KV backing tables that were previously leaking through.

Visual Changes

N/A

Reviewer Notes

  • The old filter used name NOT LIKE '__\_%' ESCAPE '\\' to exclude __drizzle_migrations; the new filter matches that table by exact name and additionally excludes any _cf_* tables surfaced by the DO KV API. If any caller relies on _cf_* tables appearing in getSchema() output, this changes their result set.
  • Predicates are private static so they are only reachable through AppDbDO and don't widen the DO's RPC surface.

Replace opaque SQL LIKE patterns with named TypeScript predicates that
explicitly document which tables are excluded (sqlite_*, _cf_* DO KV
backing tables, __drizzle_migrations).
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Apr 28, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 files)
  • services/db-proxy/src/app-db-do.ts

Reviewed by gpt-5.5-2026-04-23 · 327,696 tokens

@eshurakov eshurakov merged commit 304defa into main Apr 28, 2026
16 checks passed
@eshurakov eshurakov deleted the eshurakov/descriptive-citrine branch April 28, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants