feat(database): add statement and CTE changes (#11069)

Read pull request "feat(database): add statement and CTE changes
(#11069)"

This pull request introduces new functionality for handling database
changes using statements and Common Table Expressions (CTEs).

### Summary

This PR accomplishes the following:

- **Statement and CTE Changes**: Adds new types and functions in
change.go for handling more complex database changes. This includes:
    -   `NewChangeToNull`: A change that sets a column to `NULL`.
- `NewChangeToColumn`: A change that sets a column's value to the value
of another column.
- `NewIncrementColumnChange`: A change that increments a column's value
by 1.
- `NewChangeToStatement`: A change that sets a column's value to the
result of a subquery.
- `NewCTEChange`: A change that uses a Common Table Expression (CTE) to
perform more complex updates.
- **Testing**: Adds comprehensive tests in change_test.go to cover the
new functionality and ensure the correctness of the generated SQL
statements and arguments.
- **Ignoring AI Files**: Updates the .gitignore to exclude files
generated by AI tools.

This work enhances the flexibility of the database layer, allowing for
more complex and efficient database operations.
This commit is contained in:
Silvan
2025-11-14 12:58:22 +00:00
committed by GitHub
parent 9274e008fe
commit 0f1b7c6eaa
3 changed files with 410 additions and 0 deletions
+6
View File
@@ -97,3 +97,9 @@ dist
.nx/cache
.nx/workspace-data
.cursor/rules/nx-rules.mdc
# AI Files
CLAUDE.md
AGENTS.md
.mcp.json
.gemini/*