Skip to content
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

Auto-complete double quotes for tables/columns with capital letters #67

Closed
kmatzen opened this issue Jan 7, 2015 · 7 comments
Closed

Comments

@kmatzen
Copy link

kmatzen commented Jan 7, 2015

Is it easy to include double quotes around tables or columns that contain capital letters for auto-complete? If quotes are not included, then postgres takes that name, puts it in all lowercase, does a case-sensitive comparison, and does not find the column or table. Put it in quotes, it skips the lowercase step and finds it.

@amjith
Copy link
Member

amjith commented Jan 7, 2015

Yes it would be a useful feature and I want to do it.

It's hard to tell if it'll be easy to do or not. It'll require some parsing changes to parse_utils file.

https://github.com/amjith/pgcli/blob/master/pgcli/packages/parseutils.py#L11

You're welcome to take a stab at it.

@qwesda
Copy link
Contributor

qwesda commented Jan 8, 2015

hi,
i submitted a pull request (#83) that adds double quote escapes for table/column names with spaces, symbols, non-ascii chars and mixed-cased letters.

@amjith
Copy link
Member

amjith commented Jan 9, 2015

PR #83 overlaps with this feature request. It add auto-escaping to the columns/tables that are keywords or Uppercased or spaces. But it doesn't do auto-completion if the user opens a double quote.

So I'm leaving this issue open to track that feature. :)

Cheers!

@qwesda
Copy link
Contributor

qwesda commented Jan 9, 2015

Hi,

yes I noticed this too but I wasn't sure what had to changed. Maybe just the cleanup_regex in parseutils.py?
If it's something that requires more work you could give me some pointers an i'll look into it ... but maybe your quicker doing it yourself.

@amjith
Copy link
Member

amjith commented Jan 9, 2015

I think it should be a as simple as adding/removing stuff in the cleanup_regex.

I haven't had time to deep dive into the code since I announced it. Barely keeping up with reviewing PRs and answering Issues. You're welcome to take a stab at it, otherwise I hope to spend some time this weekend to work on it. :)

Cheers!

@amjith
Copy link
Member

amjith commented Jan 12, 2015

This commit afef77a fixes the auto-completion for quoted tables/columns that are auto-escaped.

@amjith
Copy link
Member

amjith commented Jan 13, 2015

This is now released in v0.12.0.

https://pypi.python.org/pypi/pgcli/0.12.0

@amjith amjith closed this as completed Jan 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants