
Sensible Defaults - amjith
https://www.pgcli.com/sensible-defaults.html
======
eriknstr
Filling the indent area with dots is not a sensible default IMO. Often when I
work on a query I am going to reuse it in an application. If PgAdmin III or
psql filled the indent area with dots then they would be included when I
copied the query I'd written.

Even though I always reformat the query, and even though the text editor I use
-- vim / neo-vim -- supports rectangular text selection, I would be annoyed at
such dots.

~~~
amjith
That's good to know. Perhaps I should replace the dots with empty space. I'll
do that if we get more requests for it.

Thank you for the feedback.

~~~
spion
Or alternatively the prompt character could start on a new line. That way you
can have smaller windows fit more query per line with less space wasted on
white-space.

~~~
eriknstr
But in return you might use more vertical space, and with a terminal size of
80x24, vertical space is more precious.

~~~
coldtea
With the "newline after prompt" scheme, you only get one extra line per query.

Which, if the query is long (e.g. longer than 20+ lines) it's not gonna make
any difference anyway -- it's not like it matters if you can fit e.g. 24 or 23
lines of a 30 line query (besides, the result rows are gonna take much more
vertical space, further making the measly 1 extra line issue moot).

As for for multiple small queries (and one extra line after each of those
prompts), you can always scroll. And, again, the results are gonna take far
more vertical space than the single extra line per prompt.

And, of course, with the full horizontal space available (and not half wasted
by dots) you get to fit more characters in each line, and thus your queries
will probably end up using FEWER lines.

So, not only the extra line from the "newline after prompt" is no big deal
vertical-space wise, but the dot scheme wastes MORE vertical space AND renders
queries unpastable.

------
oftenwrong
Beyond "sensible defaults", it's also important to have the defaults specified
sensibly. For robust application development, mainly when working with large
software systems, I find it best to disallow "unset" configuration options and
the implicit behaviour they entail. That is, every option must have its
setting explicitly specified in the configuration. The defaults should exist
as a "full" configuration, similar to the configuration file pgcli comes with.
Unset configuration options result in a runtime error during application
startup.

Also, I believe I first heard of pgcli from an HN comment, and since then I
have been a daily user of it.

------
flgr

      Expanded mode in psql is a way to output the results of a
      query if the output is too wide to fit in the screen when
      shown as a table. This can be toggled by \x on or \x off.
      
      [...] In pgcli, we have the ability to do this but this is
      not enabled by default. It has to be enabled via the config
      file (~/.config/pgcli/config) by the user.
      
      I don't think we'll change this behavior.
    

Why not? Seems quite sensible a thing to do when the output otherwise wouldn't
fit.

~~~
amjith
The reason being the format change will be jarring to someone who is not used
to seeing the expanded mode.

But you bring up a good point. I'm not mired by maintaining legacy, so I could
take this as an opportunity to educate users about the \x auto by enabling it
as default.

------
logicallee
This is a serious, genuinely curious and open-ended comment - I'm not arguing
for a position here or making a point and can accept any response.

Do people here think the world would be a better place if installing something
didn't require reading any documentation (not even 45 minutes of it) or
necessarily spend any time making choices?

For example, if it were possible to requisition a new AWS instance and install
a Ruby on Rails configuration with "sensible" defaults on it, in, say, < 30
seconds, and it being secure and properly configured so that a newbie without
any experience can immediately deploy apps on it securely and without
understanding the parts involved or making choices?

I can see arguments for both sides.

~~~
dredmorbius
"Make a system any idiot can use and any idiot will."

The floor in user capabilities is _low_.

[https://www.reddit.com/r/dredmorbius/comments/69wk8y/the_tyr...](https://www.reddit.com/r/dredmorbius/comments/69wk8y/the_tyranny_of_the_minimum_viable_user/)

Also:
[http://wiki.c2.com/?IdiotProofProcess](http://wiki.c2.com/?IdiotProofProcess)

------
gleenn
Actually a really nice command-line interface with autocomplete to postgres.
I'm usually rapidly dissappointed with all the GUI offerings to Postgres so
this is a breath of fresh air. Defaults definitely seemed reasonable as per
TFA

~~~
_pmf_
I still think a Mathematica-eque workbook format (manipulable inline graphics
and objects interspersed with regular REPL) would be the best of two worlds.

~~~
nerdponx
I think there are SQL backends for Jupyter and Zeppelin notebooks.

------
Animats
Oh, for a command-line SQL client.

I was expecting this to be about web pages.

"Yes, of course I want to sign up for your "newsletter" offering me the latest
deals every hour on the hour!" Click on the invisible x to opt out. (Very
Facebook.)

