Skip to content

Replace || use in Query.duplicate for mysql compatibility #77

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

Closed
wants to merge 1 commit into from
Closed

Replace || use in Query.duplicate for mysql compatibility #77

wants to merge 1 commit into from

Conversation

ssweber
Copy link
Collaborator

@ssweber ssweber commented Feb 17, 2023

Mysql doesn't use || for concat, unless set as a mode.

Cleaned up code here.

Mysql doesn't use || for concat, unless set as a mode.

Cleaned up code here.
Comment on lines -1230 to +1233
q = f'UPDATE tmp SET {self.description_column} = "Copy of " || {self.description_column}'
q = f'UPDATE tmp SET {self.description_column} = "Copy of {description}"'
Copy link
Collaborator Author

@ssweber ssweber Feb 17, 2023

Choose a reason for hiding this comment

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

I don't understand how this was working before.

self.description_column was returning 'name' on the first call, but then in the 2nd f-string, it was returning the actual description, for instance 'Bill'. At first I changed it to just "Copy of {self.description_column}" to remove the ||. but then it returned 'name'.

You probably understand why. But I think grabbing the actually description at first is more explicit.

@ssweber
Copy link
Collaborator Author

ssweber commented Feb 17, 2023

this relates to #74

@ssweber
Copy link
Collaborator Author

ssweber commented Feb 18, 2023

Closing this for now, since you’ll be reworking a lot of these direct queries.

@ssweber ssweber closed this Feb 18, 2023
@ssweber ssweber deleted the mysql-compatibility branch February 21, 2023 21:48
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.

1 participant