-
Notifications
You must be signed in to change notification settings - Fork 650
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
Synchronization overwrite mode for geocoding only #14991
Conversation
This is just an experiment. It may require far more than the automated tests in this repository, yet worth a try.
This also solves an inconsistency between first and subsequent syncs
Table indices and privileges need not be replicated now since the table is preserved
There is a slight difference between the previous overwrite by replacement and the new one: The |
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.
LGTM
# Conflicts: # lib/sql
spec/requests/carto/api/custom_visualizations_controller_spec.rb
Outdated
Show resolved
Hide resolved
spec/requests/carto/api/custom_visualizations_controller_spec.rb
Outdated
Show resolved
Hide resolved
app/controllers/carto/api/public/custom_visualizations_controller.rb
Outdated
Show resolved
Hide resolved
Notice: before merging this, a new release of the extension is needed. Don't forget to update the lib/sql submodule and the version references in the code before merging. |
This is for testing purposes (with the branch in the lib/sql submodule)
sanitize(column_names) | ||
end | ||
|
||
|
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.
Extra blank line detected.
|
||
sanitize(column_names) | ||
# Already done by Table#sanitize_columns in app/models/table.rb | ||
#sanitize_columns! |
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.
Missing space after #.
@@ -187,6 +267,10 @@ def import_cleanup(schema_name, table_name) | |||
qualified_table_name = "\"#{schema_name}\".#{table_name}" | |||
|
|||
user.db_service.in_database_direct_connection(statement_timeout: STATEMENT_TIMEOUT) do |user_database| | |||
|
|||
# For consistency with regular imports, also eases testing | |||
Table.sanitize_columns(table_name, {database_schema: schema_name, connection: user_database}) |
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.
Space inside { missing.
Redundant curly braces around a hash parameter.
Space inside } missing.
ee142c1
to
9f2814b
Compare
# Conflicts: # app/controllers/home_controller.rb # app/models/user/db_service.rb # lib/sql
This includes minimal modifications to choose between overwriting by replacement or synchronization.
The the new sync mode is used only for tables that have a
carto_geocode_hash
column, i.e. tables processed by the geocoder analysis. This is so to be able to put this in production in the safest way: regular syncs, in particular all existing syncs shouldn't be affected.This would benefit from cleaning up Table/TableSetup/Adapter redundancies, specially import_cleanup, but we'll keep that separate.
Note that this build upon the work in #14937