Skip to content

feat(schema): improve constraints support#22

Open
graduenz wants to merge 8 commits into
mainfrom
gui/support-constraints
Open

feat(schema): improve constraints support#22
graduenz wants to merge 8 commits into
mainfrom
gui/support-constraints

Conversation

@graduenz

@graduenz graduenz commented Mar 15, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces significant enhancements to the SQL builder implementations for PostgreSQL, SQLite, and SQL Server. The changes improve support for table constraints (primary keys, foreign keys, unique constraints), add column-level features (default values, check constraints), and unify table creation logic. Comprehensive tests are added to verify these improvements.

Improvements to SQL builder functionality:

  • Added support for column-level DEFAULT values and CHECK constraints in all dialects, updating the columnDefinition methods to generate correct SQL syntax. [1] [2] [3]
  • Enhanced table creation logic to generate PRIMARY KEY, FOREIGN KEY, and UNIQUE constraints as named table-level constraints, including support for composite keys and constraints. [1] [2]

Refactoring and code unification:

  • Refactored SQL Server builder to delegate table creation to a generic implementation, reducing code duplication and ensuring consistent constraint handling.

Test coverage improvements:

  • Expanded unit tests for all dialects to cover new constraint and column features, including composite keys, foreign keys, unique constraints, defaults, and checks. [1] [2] [3] [4] [5] [6]

Documentation and minor fixes:

  • Updated example code in README.md to use new constraint APIs and fixed a typo in a test case (ammountamount). [1] [2] [3] [4]

Resolves #6

@graduenz graduenz self-assigned this Mar 15, 2026
@graduenz graduenz added the enhancement New feature or request label Mar 15, 2026
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(schema): improve constraints support

1 participant