Skip to content
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

Merged
merged 6 commits into from
Oct 10, 2024
Merged

Conversation

kfriars
Copy link
Collaborator

@kfriars kfriars commented Oct 3, 2024

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 SnapshotSchemaBuilders 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

  1. Covered with auto tests

@kfriars kfriars requested a review from m-triassi October 3, 2024 23:48
@kfriars kfriars self-assigned this Oct 3, 2024
@m-triassi
Copy link
Contributor

Closes #24
Closes #26

Copy link
Contributor

@m-triassi m-triassi left a 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 () {
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

@kfriars kfriars merged commit c65f11e into main Oct 10, 2024
36 checks passed
@kfriars kfriars deleted the per-driver-schema-builders branch October 10, 2024 13:16
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.

2 participants