Skip to content

Support SQL default expressions in datasource schema#127

Merged
rmorehig merged 2 commits intomainfrom
feat/default-expr-datasource
Mar 10, 2026
Merged

Support SQL default expressions in datasource schema#127
rmorehig merged 2 commits intomainfrom
feat/default-expr-datasource

Conversation

@rmorehig
Copy link
Collaborator

Summary

  • add defaultExpr(expression) to column validators for raw SQL defaults
  • emit raw DEFAULT <expression> in generated datasource files when defaultExpr is used
  • migrate parser/TS emitter now falls back to .defaultExpr(...) for non-literal datasource defaults (for example generateUUIDv4())
  • add tests for validator modifiers, datasource generation, and migrate output
  • document the new modifier in README

Verification

  • pnpm exec vitest run src/schema/types.test.ts src/generator/datasource.test.ts src/cli/commands/migrate.test.ts
  • pnpm typecheck

@rmorehig rmorehig merged commit 4a3fbf7 into main Mar 10, 2026
2 checks passed
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.

1 participant