-
Notifications
You must be signed in to change notification settings - Fork 38
Handle tables with custom fillfactor + add tests + add CI
#46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| dump.gsub!(/^-- Name: \w+; Type: INDEX\n+/, '') | ||
| indexes.each do |table, indexes_for_table| | ||
| dump.gsub!(/^(CREATE TABLE #{table}\b(:?[^;\n]*\n)+\);\n)/) { $1 + "\n" + indexes_for_table } | ||
| dump.gsub!(/^(CREATE TABLE #{table}\b(:?[^;\n]*\n)+\);*\n(?:.*);*)/) { $1 + "\n" + indexes_for_table } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this was already complex and is getting more complex, it would be nice if this regex could live as a variable and have a corresponding Ruby class that runs a test with the different table structure DDL dump variations you mentioned.
For example one without a fillfactor or other table params, and one with that set.
If you agree, maybe we could capture that in an issue for now, if you don't have time for the unit test now, and have tested this manually and it's working for you.
| columns = [] | ||
| result << source_line | ||
| elsif source_line.start_with?(");") | ||
| elsif source_line.start_with?(")") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| dump.gsub!(/^-- Name: \w+; Type: INDEX\n+/, '') | ||
| indexes.each do |table, indexes_for_table| | ||
| dump.gsub!(/^(CREATE TABLE #{table}\b(:?[^;\n]*\n)+\);\n)/) { $1 + "\n" + indexes_for_table } | ||
| dump.gsub!(/^(CREATE TABLE #{table}\b(:?[^;\n]*\n)+\);*\n(?:.*);*)/) { $1 + "\n\n" + indexes_for_table } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fillfactorfillfactor + add tests + add CI
|
I think you will need to enable github actions on this repo for the tests to run on PRs. It might only work after this is merged. |
|
Looks really good on a quick initial read. I'll let @lfittl chime in. Nice work! |
|
@ghiculescu I don't have the "settings" tab access where I'd expect to enable GH actions. Maybe @lfittl can do that. I did grab your branch and ran |


Fix: #45