test: add generated-column fixtures and fix AT_SetExpression/AT_DropExpression deparsing#298
Closed
pyramation wants to merge 1 commit into
Closed
test: add generated-column fixtures and fix AT_SetExpression/AT_DropExpression deparsing#298pyramation wants to merge 1 commit into
pyramation wants to merge 1 commit into
Conversation
…xpression deparsing - Add __fixtures__/kitchen-sink/misc/generated-columns.sql covering CREATE, ADD, SET, DROP, and DROP IF EXISTS for generated columns - Fix AT_SetExpression to emit SET EXPRESSION AS (expr) - Fix AT_DropExpression to emit DROP EXPRESSION IF EXISTS when missing_ok is true - Regenerate generated.json and kitchen-sink test file
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add comprehensive fixture coverage for generated columns and fix the
AlterTableCmddeparsing forAT_SetExpressionandAT_DropExpression.What changed
__fixtures__/kitchen-sink/misc/generated-columns.sqlwith round-trip statements for:CREATE TABLE ... GENERATED ALWAYS AS (expr) STORED(arithmetic, function calls, type modifiers, CASE, NOT NULL/UNIQUE)ALTER TABLE ... ADD COLUMN ... GENERATED ALWAYS AS (expr) STOREDALTER TABLE ... ALTER COLUMN ... SET EXPRESSION AS (expr)ALTER TABLE ... ALTER COLUMN ... DROP EXPRESSIONALTER TABLE ... ALTER COLUMN ... DROP EXPRESSION IF EXISTS__fixtures__/generated/generated.jsonandpackages/deparser/__tests__/kitchen-sink/misc-generated-columns.test.ts.packages/deparser/src/deparser.tsAlterTableCmd:AT_SetExpressionnow emitsSET EXPRESSION AS (expr)so it round-trips.AT_DropExpressionnow emitsDROP EXPRESSION IF EXISTSwhenmissing_okis true.Tests
npx jest __tests__/kitchen-sink/misc-generated-columns.test.tspasses.npx jestinpackages/deparserpasses: 292 suites, 712 tests, 424 snapshots.Link to Devin session: https://app.devin.ai/sessions/71d24cab0da24e7b83d3f5a6e9fef9a2
Requested by: @pyramation