-
-
Notifications
You must be signed in to change notification settings - Fork 7
Add semicolon to each statement while dumping the database #33
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
base: main
Are you sure you want to change the base?
Conversation
|
|
||
| if ($statements !== []) { | ||
| $file .= PHP_EOL . $statements[0]['query']; | ||
| $file .= PHP_EOL . $statements[0]['query'] .(ends_with(trim($statements[0]['query']), ';') ? '' : ';'); |
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.
ends_with will never work as the helper isn't installed in all applications with Laravel.
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.
| $file .= PHP_EOL . $statements[0]['query'] .(ends_with(trim($statements[0]['query']), ';') ? '' : ';'); | |
| $file .= PHP_EOL . Str::finish($statements[0]['query'], ';'); |
And import use Illuminate\Support\Str;
peterfox
left a comment
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.
I'm not sure how this didn't come up in development. Could you share an example file output with the problem and what version of Laravel/CockroachDB you're using?
Add illuminate/contracts ^12.0 constraint to enable compatibility with Laravel 12.x framework while maintaining backward compatibility with Laravel 9, 10, and 11. This preserves the custom semicolon fix for schema dumps (commit a94c0d4) which is not present in upstream ylsideas/cockroachdb-laravel. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Pass connection instance to QueryGrammar and SchemaGrammar constructors to support Laravel 12 requirement while maintaining backward compatibility with Laravel 11. Co-authored-by: lucacri <[email protected]>
…8e9d-ef32-48c5-96a8-61560486375a fix: Pass connection to Grammar constructors for Laravel 12 compatibility
…atibility Co-authored-by: lucacri <[email protected]>
…cf5b-52c8-4759-85cc-fe16b804de7b Fix Laravel 12 compatibility: update Grammar initialization pattern
Changes In Code
I added a check to see if the statement is ending with a semicolon. If not, it'll add it so that the .sql file generated is going to work also from the
cockroach sqlcommand