Skip to content

fix(plugin-mssql): use active schema for object queries#1778

Draft
andiahmads wants to merge 1 commit into
TableProApp:mainfrom
andiahmads:fix/mssql-current-schema-browse
Draft

fix(plugin-mssql): use active schema for object queries#1778
andiahmads wants to merge 1 commit into
TableProApp:mainfrom
andiahmads:fix/mssql-current-schema-browse

Conversation

@andiahmads

Copy link
Copy Markdown
Contributor

Summary

  • Resolve MSSQL object queries against the active schema when callers do not pass an explicit schema.
  • Keep explicit schema arguments taking precedence over the active schema.
  • Add TableProMSSQLCore tests for schema resolution and non-dbo browse query generation.

Root cause

MSSQL browse, filter, and generated edit statements treated a nil schema as unqualified object access. For connections whose active schema was not dbo, this produced queries like SELECT * FROM [Orders], which SQL Server resolved through the login default schema instead of the selected schema.

Fixes #1774

Validation

  • swift test --package-path Packages/TableProCore --filter MSSQLSchemaQueriesTests
  • xcodebuild -project TablePro.xcodeproj -scheme TablePro -configuration Debug -skipPackagePluginValidation CODE_SIGNING_ALLOWED=NO build
  • git diff --check
  • swiftlint lint --strict

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid Object name on views and table in other then DBO schema

1 participant