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

Support \x for Expanded Display #19

Closed
jackmaney opened this issue Jan 6, 2015 · 15 comments
Closed

Support \x for Expanded Display #19

jackmaney opened this issue Jan 6, 2015 · 15 comments

Comments

@jackmaney
Copy link

The tabulate output looks very pretty, but a feature I love from psql is the expanded display option (\x) for looking at rows in really wide tables (ie tables with rows that are too big to fit in one line on the terminal). However, this isn't yet supported in pgcli:

$ pgcli
[dbname]> \x
syntax error at or near "\"
LINE 1: \x
        ^
@jaytaylor
Copy link

+1

@amjith
Copy link
Member

amjith commented Jan 6, 2015

This was requested by a few people. Need to look at how to do this effectively.

@treystout
Copy link

+1

4 similar comments
@cezio
Copy link

cezio commented Jan 6, 2015

+1

@jc21
Copy link

jc21 commented Jan 6, 2015

+1

@stedi67
Copy link

stedi67 commented Jan 7, 2015

+1

@binarysource
Copy link

+1

@amjith
Copy link
Member

amjith commented Jan 9, 2015

Merged in PR #63 that adds \x support to master.

This currently fails on Python 3, but that will be fixed before the next release.

Can someone install the latest master and try it out?

You can install the latest master using the following command.

pip install -e git+git@github.com:amjith/pgcli.git#egg=pgcli

@jackmaney
Copy link
Author

It mostly works, but it seems to be printing extra information:

$ pgcli
[dbname]> \x
Expanded display is on.
Expanded display is on.
[dbname]> select generate_series(1,5);
-[ RECORD 0 ]---+--
generate_series | 1
-[ RECORD 1 ]---+--
generate_series | 2
-[ RECORD 2 ]---+--
generate_series | 3
-[ RECORD 3 ]---+--
generate_series | 4
-[ RECORD 4 ]---+--
generate_series | 5

SELECT 5
+-------------------+
|   generate_series |
|-------------------|
|                 1 |
|                 2 |
|                 3 |
|                 4 |
|                 5 |
+-------------------+
SELECT 5

@jackmaney
Copy link
Author

Whoah...it's not just with \x. I'm seeing double (blarg is just a test table):

$ pgcli
[dbname]> select * from blarg;
+-----------+
|         x |
|-----------|
|         2 |
|         3 |
| -17171717 |
+-----------+
SELECT 3
+-----------+
|         x |
|-----------|
|         2 |
|         3 |
| -17171717 |
+-----------+
SELECT 3

@amjith
Copy link
Member

amjith commented Jan 9, 2015

@jackmaney Fixed. Can you try again?

@amjith
Copy link
Member

amjith commented Jan 9, 2015

9a62921 - fixes the double printing of output.

@jackmaney
Copy link
Author

That did it. 😄

@jaytaylor
Copy link

Awesome work everybody!

On Fri, Jan 9, 2015 at 1:05 AM, Jack Maney notifications@github.com wrote:

That did it. [image: 😄]


Reply to this email directly or view it on GitHub
#19 (comment).

@amjith
Copy link
Member

amjith commented Jan 10, 2015

This is now available in the release version 0.11.0

https://pypi.python.org/pypi?:action=display&name=pgcli&version=0.11.0

@amjith amjith closed this as completed Jan 10, 2015
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

No branches or pull requests

8 participants