Add Drizzle ORM integration for Admin UI#214
Merged
Merged
Conversation
Schema generator in tools/drizzle/ introspects KalamDB and outputs typed pgTable definitions. Admin UI services (users, audit logs, jobs, storages) migrated from raw SQL to Drizzle queries with types inferred from the schema. Job detail dialog updated to use correct column names (message, exception_trace).
Member
|
Thanks inas, but i have these few suggestions:
import { kalamDriver } from '@kalamdb/orm’; const db = drizzle(kalamDriver(client));`
Future:
|
- Driver: pg-proxy adapter with DEFAULT stripping, multi-row INSERT splitting, quote removal - Generator: introspects tables via SHOW TABLES + system.columns, generates typed Drizzle schemas with .default() for server defaults, FILE column support - CLI: npx kalamdb-orm --password <pass> generates schema files, supports env vars - Tests: 61 tests (24 unit, 37 integration) covering SELECT/INSERT/UPDATE/DELETE, defaults, multi-row, FILE type, schema generation, CLI - Admin UI: migrated to use @kalamdb/orm driver, added generate:schema script - CI: workflow with KalamDB service container for integration tests
…deSystem - Default: exclude system/dba tables - --include-system flag to opt in - Remove namespaces filter option
SHOW TABLES columns JSON already provides defaults for all regular tables. Hidden tables (virtual views) don't have defaults and aren't in system.columns anyway.
Wraps client.live with Drizzle schema inference so callbacks get fully typed rows instead of raw RowData. Handles KalamCellValue unwrapping and custom column transforms like FILE -> FileRef.
Collaborator
Author
|
All addressed! Let me know if you have any notes |
KalamDB returns all BIGINT values as strings in JSON responses.
Previously mapped to bigint({ mode: 'number' }) which silently
corrupted SNOWFLAKE_IDs exceeding JS MAX_SAFE_INTEGER.
Now BIGINT columns generate as text(), timestamps stay as
bigint({ mode: 'number' }) since they're returned as actual numbers.
Updated UI cluster components to handle string types.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Drizzle ORM support. Schema generator introspects KalamDB and outputs typed pgTable definitions. All Admin UI read queries migrated from raw SQL to type-safe Drizzle queries.