[fix] Avoid create schema#362
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #362 +/- ##
==========================================
- Coverage 81.90% 81.74% -0.16%
==========================================
Files 16 16
Lines 1752 1786 +34
==========================================
+ Hits 1435 1460 +25
- Misses 195 200 +5
- Partials 122 126 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to avoid issuing CREATE SCHEMA / CREATE DATABASE when the schema already exists, to reduce the chance of hitting permission errors in environments where the user can use an existing schema but cannot create it.
Changes:
- SingleStore/MySQL: query
information_schema.schematabefore attempting schema creation. - Postgres: query
information_schema.schematabefore attempting schema creation, and refactor tracking-table parsing to return both raw and quoted schema names. - SingleStore: adjust tracking table qualification to use a separately-quoted schema component.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lssinglestore/singlestore.go | Adds schema existence check and adjusts schema/table quoting for the tracking table. |
| lspostgres/postgres.go | Adds schema existence check and refactors tracking table parsing to separate raw vs quoted identifiers. |
| lsmysql/mysql.go | Adds schema existence check before attempting CREATE SCHEMA. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Avoid issuing CREATE SCHEMA / CREATE DATABASE when they already exist
This avoids potential permissions issues.