Skip to content

Comments

Fixes custom schema processing#287

Merged
devhawk merged 6 commits intomainfrom
devhawk/fix-custom-schema
Feb 24, 2026
Merged

Fixes custom schema processing#287
devhawk merged 6 commits intomainfrom
devhawk/fix-custom-schema

Conversation

@devhawk
Copy link
Collaborator

@devhawk devhawk commented Feb 23, 2026

The sanitizeSchema method originally added changed " to "" and added double quotes around the entire schema so that it would support schema names with single and double quotes in them such as C$+0m'. However, this approach is not compatible with Migration #10, where we need to use the schema name as a column value.

return "\"%s\"".formatted(schema);
return Objects.requireNonNullElse(schema, Constants.DB_SCHEMA)
.replace("\0", "")
.replace("\"", "\"\"");
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm thinking here we should just remove single and double quotes, like we remove the null char. This will allow the schema to be used as a schema in queries as well as a value in Migration #10

Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer it just fail outright with a clear error message

Copy link
Collaborator Author

@devhawk devhawk Feb 24, 2026

Choose a reason for hiding this comment

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

I added an explicit check for schemas with a single or double quote in them

@devhawk devhawk merged commit 50e19b6 into main Feb 24, 2026
21 checks passed
@devhawk devhawk deleted the devhawk/fix-custom-schema branch February 24, 2026 17:19
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