feat(query): apply pragmas setting to Table Preview queries #2575
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.
Fixes #2574
This PR implements pragma support for Table Preview queries, ensuring that the "Pragmas" setting from the Query Settings Dialog is consistently applied to all query executions, including table previews.
🎯 Changes Made
Core Implementation
TablePreview.tsx
: Added integration with query settingsuseQueryExecutionSettings
hook to access current user settingsprepareQueryWithPragmas
utility function from existing pragma infrastructureTest Coverage
TablePreview.test.tsx
: Comprehensive unit tests covering:🔧 Technical Implementation
Before:
After:
This approach:
prepareQueryWithPragmas
utility for consistent formatting🧪 Testing
📸 UI Verification
Frontend successfully builds and runs - network error shown is expected when no YDB backend is available
🚀 Usage
When a user sets pragmas in the Query Settings Dialog (e.g.,
PRAGMA OrderedColumns;
), table preview queries now automatically include these pragmas:User's pragma setting:
Resulting table preview query:
This ensures consistent behavior between regular query execution and table previews, completing the pragma feature implementation across all query types in the YDB Embedded UI.
This pull request was created as a result of the following prompt from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
CI Results
Test Status: ❌ FAILED
📊 Full Report
Test Changes Summary ⏭️2
⏭️ Skipped Tests (2)
Bundle Size: ✅
Current: 85.17 MB | Main: 85.16 MB
Diff: +0.49 KB (0.00%)
✅ Bundle size unchanged.
ℹ️ CI Information