Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feat: parse schema for syntax validation only in database-only mode
In database-only mode, parse the schema migrations to validate syntax
and collect them for the database connection, but skip updating the
catalog. The database will be the source of truth for schema information.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
  • Loading branch information
claude committed Dec 18, 2025
commit a87a418df48fc6af958e6f0676fcb910896d0deb
8 changes: 8 additions & 0 deletions internal/compiler/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,19 @@ func (c *Compiler) parseCatalog(schemas []string) error {
contents := migrations.RemoveRollbackStatements(string(blob))
c.schema = append(c.schema, contents)

// In database-only mode, we parse the schema to validate syntax
// but don't update the catalog - the database will be the source of truth
stmts, err := c.parser.Parse(strings.NewReader(contents))
if err != nil {
merr.Add(filename, contents, 0, err)
continue
}

// Skip catalog updates in database-only mode
if c.databaseOnlyMode {
continue
}

for i := range stmts {
if err := c.catalog.Update(stmts[i], c); err != nil {
merr.Add(filename, contents, stmts[i].Pos(), err)
Expand Down
Loading