consbio / pg-database-utils

A suite of utilities for PostgreSQL database queries and operations built on sqlalchemy
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Quote column name in `drop_column` query #5

Closed nikmolnar closed 3 years ago

nikmolnar commented 3 years ago

The drop_column function fails for a column name with any upper case letters. This PR quotes the column name in the query so that it will work with column names including upper case letters.

This fix is high priority for the CRP project.

In the process of adding a test for dropping a column with upper-case letters, I discovered another test failure with upper-case columns. This led me to also fix the Values clause for upper-case column names.

dharvey-consbio commented 3 years ago

After merging these changes I am creating a new minor version on pypi.