Skip to content

Conversation

@psteinb
Copy link

@psteinb psteinb commented Mar 14, 2025

Thanks again for providing and supporting the library.

This is a a suggestion to avoid triggering a warning. If a user calls MySQL.load with append=true, I think she is likely to assume or know that the table under name already exists. Hence calling createtable to me doesn't make too much sense. For this, I suggest to put the entire try-catch clasue in the !append if statement.

@TianChengJiang9911
Copy link
Contributor

We still want to create table at the first time even if append=true. I think maybe it should be like:

try
    createtable(conn, name, sch; quoteidentifiers=quoteidentifiers, debug=debug, createtableclause=append ? "CREATE TABLE IF NOT EXISTS" : "CREATE TABLE", kw...)
catch e

@quinnj
Copy link
Member

quinnj commented Jan 14, 2026

Thanks for the contribution! However, this change would be breaking - users who call MySQL.load(...; append=true) on a new table would get an error since the table creation is skipped entirely.

I'll implement the suggested CREATE TABLE IF NOT EXISTS approach separately, which achieves the goal of suppressing the warning on subsequent appends without breaking the first-load case.

@quinnj quinnj closed this Jan 14, 2026
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.

3 participants