-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SchemaBuilder Per Connection Grammar #27
Conversation
… newer Framework changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, this looks excellent, i think this covers both bugs we discovered here, and then some. 🚀 it!
use Plank\Snapshots\Schema\SQLiteSnapshotBuilder; | ||
use Plank\Snapshots\Schema\SqlServerSnapshotBuilder; | ||
|
||
describe('The Schema Builder is resolved in the container based on the db connection', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not something we need to tackle in this PR: It might be interesting to eventually have the test suites actually run on each schema builder, and see if they behave as expected.
This is a great first step towards that imho, just making sure the system can resolve correct builder is excellent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would definitely be nice assurance.
Summary
The Laravel Framework added some new methods (ie:
getIndexes()
,getColumns()
) to the Schema Builder, and in order to do so, they needed to break out the Schema Builder implementations per Database Connection Grammar.As a result, we also need to provide a Grammar specific set of
SnapshotSchemaBuilder
s in order to expose the new methods add in Laravel.This should be a non breaking change, as the service container bindings should still resolve to the old base builder if the new framework builder classes aren't there.
Tests