Skip to content

fix: [#942] use connection driver for schema#1489

Merged
hwbrzzl merged 2 commits into
masterfrom
ai-optimize-issue-942
Jun 13, 2026
Merged

fix: [#942] use connection driver for schema#1489
hwbrzzl merged 2 commits into
masterfrom
ai-optimize-issue-942

Conversation

@goravel-coder

Copy link
Copy Markdown
Contributor

Summary

  • Schema connections now resolve the selected connection database driver before building grammar, processor, prefix, and schema metadata.
  • db:wipe --database reuses the resolved schema connection for all wipe operations.
  • Added regression coverage for schema connection driver switching and wipe connection reuse.

Closes goravel/goravel#942

Why

Applications can configure multiple database connections with different drivers. Schema operations should compile metadata queries using the selected connection driver instead of the default connection driver.

Before this change, facades.Schema().Connection("OtherDBMS") executed against the selected connection but compiled schema SQL with the default driver. After this change, both facade schema calls and db:wipe --database use the selected connection driver metadata.

facades.Schema().Connection("OtherDBMS").HasTable("example")

facades.Artisan().Call("db:wipe", map[string]string{
	"--database": "OtherDBMS",
})

@goravel-coder
goravel-coder requested a review from a team as a code owner June 13, 2026 03:44
@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.23077% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.46%. Comparing base (eab07d0) to head (16bec1b).

Files with missing lines Patch % Lines
database/schema/schema.go 64.70% 7 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1489      +/-   ##
==========================================
+ Coverage   69.38%   69.46%   +0.07%     
==========================================
  Files         378      378              
  Lines       29683    29710      +27     
==========================================
+ Hits        20597    20639      +42     
+ Misses       8140     8118      -22     
- Partials      946      953       +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hwbrzzl
hwbrzzl merged commit af5e263 into master Jun 13, 2026
16 of 19 checks passed
@hwbrzzl
hwbrzzl deleted the ai-optimize-issue-942 branch June 13, 2026 04:04
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.

Schema Connection method doesn't use connection's driver

2 participants