Skip to content

Conversation

@dees91
Copy link

@dees91 dees91 commented Jun 23, 2025

Problem

SQLDelight 2.x changed the default schema introspection behavior during migration verification, causing performance issues reported in #4759:

This change causes the verifySqlDelightMigration task to hang indefinitely on complex schemas, with users reporting:

  • Tasks running for hours without completing
  • Over 3,600 "Detected circular reference" warnings in debug logs
  • Schemas that previously verified fine in 1.5.5 now fail

Solution

This PR adds a migrationVerificationLevel property to make schema introspection configurable:

sqldelight {
  databases {
    create("Database") {
      packageName = "com.example"
      verifyMigrations.set(true)
      migrationVerificationLevel.set("standard") // Allows optionally reduce the verification level
    }
  }
}

Available Levels

  • "minimum" - Minimal schema information retrieval
  • "standard" - Standard schema information retrieval (SQLDelight 1.5.5 default)
  • "detailed" - More comprehensive schema information retrieval
  • "maximum" - Most comprehensive schema information retrieval (current default)

Impact

  • Fixes verifySqlDelightMigration hangs #4759 - Users can reduce verification level to what we have in 1.x
  • Maintains compatibility - Defaults to "maximum" for existing 2.x behavior
  • Enables customization - Users can choose the appropriate level for their needs

Changes

  • Added migrationVerificationLevel property to SqlDelightDatabase
  • Modified CatalogDatabase to accept configurable schema info level
  • Updated VerifyMigrationTask to pass the configuration through
  • Added documentation and test coverage

Fixes #4759

Allows users to control the depth of schema introspection during migration
verification by setting migrationVerificationLevel property (minimum, standard,
detailed, or maximum). Defaults to maximum for backward compatibility.
@dees91 dees91 force-pushed the configurable-schema-verification-level branch from 592ed31 to 8436d36 Compare July 15, 2025 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

verifySqlDelightMigration hangs

1 participant