Skip to content

Improve connection handling during dev dump reload#13344

Open
gregorbg wants to merge 4 commits intothewca:mainfrom
gregorbg:cleanup/dev-dump-connection-handling
Open

Improve connection handling during dev dump reload#13344
gregorbg wants to merge 4 commits intothewca:mainfrom
gregorbg:cleanup/dev-dump-connection-handling

Conversation

@gregorbg
Copy link
Member

@gregorbg gregorbg commented Feb 4, 2026

Addresses recent staging import problems

CC @dunkOnIT

@dunkOnIT
Copy link
Contributor

dunkOnIT commented Feb 5, 2026

Efforts to use this PR fail here:

ActiveRecord::Base.connection.exec("SOURCE #{DbDumpHelper::DEVELOPER_EXPORT_SQL}")

Minor issue - .exec is not valid AR syntax. However, changing to .execute yields this error:

Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SOURCE wca-developer-database-dump.sql' at line 1 (Mysql2::Error)

Talking to ChatGPT suggests that we have to pipe that command via MySQL, not AR. I dipped my toes in by trying to change it to DatabaseDumper.mysql(), which got me past that line of code but nuked my db in the process - I wasn't using reload[1].

I'm now reloading my dev db, and will modify the dev dump with a local parameter[2] and use that + LIMIT 100 to generate a dev dump I can use to test the new load.

[1] I figured that if I just had a file that inserted a line, I shouldn't use reload - which would create an unpopulated temp db - and should instead just have it applied directly on the existing database. That logic was probably flawed :P
[2] similar to how I did for the results dump

@dunkOnIT
Copy link
Contributor

dunkOnIT commented Feb 6, 2026

@thewca-bot deploy staging

@dunkOnIT
Copy link
Contributor

dunkOnIT commented Feb 6, 2026

Worked locally using my latest push, deploying to staging now to try it out there

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