feat: Execute standalone extension statements in local runner - #2279
Merged
Conversation
WellMafra
marked this pull request as ready for review
August 12, 2026 16:23
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2279 +/- ##
============================================
+ Coverage 18.78% 18.90% +0.11%
- Complexity 1223 1227 +4
============================================
Files 630 630
Lines 18409 18420 +11
Branches 2250 2251 +1
============================================
+ Hits 3459 3483 +24
+ Misses 14618 14605 -13
Partials 332 332 ☔ View full report in Codecov by Harness. |
Signed-off-by: Wellington Mafra <wellingtonisidiomafra@gmail.com>
Collaborator
|
Why executing |
Contributor
Author
because the create_parent requires the parent table to already exist. |
ferenc-csaky
approved these changes
Aug 13, 2026
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.
What was done
DatasqrlRun.initPostgresnow executes the plan'sstandaloneExtensionStatements(e.g. the pg_partmanCREATE EXTENSION+create_parentblock) after the regular statements, non-fatally: a failure logs a warning and the run continues, so a Postgres without the extension behaves exactly as before.postgresql-${POSTGRES_VERSION}-partmanin the sqrl-cli base image sorun/testcan actually create the extension locally.Why it was done
ttl()hint are emitted asPARTITION BY RANGEparents with no inline default partition (pg_partman owns their lifecycle), but the local runner never executed the partman block — leaving the parent with zero partitions, so every insert fails withno partition of relation ... found for row. This madesqrl test/sqrl rununusable for any project usingttl()on a Postgres table.Executing standalone extension statement partman of type EXTENSION, historical test fixtures land in the partman DEFAULT partition, and all 14 snapshot tests pass.