Skip to content

[fix] Avoid create schema#362

Merged
muir merged 4 commits into
mainfrom
avoidCreateSchema
May 6, 2026
Merged

[fix] Avoid create schema#362
muir merged 4 commits into
mainfrom
avoidCreateSchema

Conversation

@muir
Copy link
Copy Markdown
Owner

@muir muir commented May 5, 2026

Avoid issuing CREATE SCHEMA / CREATE DATABASE when they already exist
This avoids potential permissions issues.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

❌ Patch coverage is 76.27119% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.74%. Comparing base (2963391) to head (6807496).

Files with missing lines Patch % Lines
lssinglestore/singlestore.go 69.56% 4 Missing and 3 partials ⚠️
lspostgres/postgres.go 83.33% 3 Missing and 1 partial ⚠️
lsmysql/mysql.go 75.00% 2 Missing and 1 partial ⚠️
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     
Flag Coverage Δ
go_tests 19.70% <5.08%> (-0.33%) ⬇️
mysql_tests 47.91% <15.25%> (-0.60%) ⬇️
pg_tests 51.83% <55.55%> (-0.06%) ⬇️
singlestore_tests 44.75% <27.11%> (-0.25%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.schemata before attempting schema creation.
  • Postgres: query information_schema.schemata before 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.

Comment thread lssinglestore/singlestore.go
Comment thread lspostgres/postgres.go Outdated
@muir muir force-pushed the avoidCreateSchema branch from e7a38eb to 0aebed8 Compare May 5, 2026 23:28
@muir muir temporarily deployed to singlestore May 5, 2026 23:28 — with GitHub Actions Inactive
@muir muir requested a review from Copilot May 5, 2026 23:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Comment thread lssinglestore/singlestore.go
Comment thread lssinglestore/singlestore.go
Comment thread lspostgres/postgres.go
Comment thread lsmysql/mysql.go
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@muir muir merged commit 7ea5a0f into main May 6, 2026
26 of 28 checks passed
@muir muir deleted the avoidCreateSchema branch May 6, 2026 15:56
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