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
feat: support multiple database connections #1879
base: 2.x
Are you sure you want to change the base?
Conversation
6b5393b
to
2883e8e
Compare
2883e8e
to
ff344f1
Compare
ff344f1
to
1758cf8
Compare
1758cf8
to
0c3dcf5
Compare
Hey @calebdw @canvural what's the status of this PR? I'm currently leading a project at work to bump our level from 0 to 1, by generating a baseline & removing errors from the baseline each week. I didn't realise until recently that Larastan doesn't support multiple connections. We have 17 database connections, and make heavy use of Postgres schemas, so this has become a stumbling block. For now, I've switched to @calebdw's fork to keep momentum going, but would love to see it merged in. Thanks for all the hard work y'all put in maintaining this library! |
0c3dcf5
to
cd0ba06
Compare
@TaylorWilton, this PR should be ready to go, just waiting for @canvural to merge :) |
Closes #1577, closes #1642
Note that this depends on #1838 as it built on top of the refactoring in that branch.
Changes
This PR introduces support for multiple database connections as well as Postgres Schema (sub databases).
Breaking changes
None that should affect the user, but the existing code allowed for parsing multiple schema files for a single connection (i.e., the only connection). However, Laravel saves the schema squash files as
<connection>-schema.sql
. So to able to understand which schema file belongs to what connection I rely on this naming convention to determine the connection name from the filename. In practice this means there should only be one file per connection.For example, the following files would both be parsed under the
mysql
connection:mysql-schema.{sql,dump}
mysql.{sql,dump}