pgclihttps://www.pgcli.com/2020-02-24T00:00:00-08:00Welcome IRedis2020-02-24T00:00:00-08:002020-02-24T00:00:00-08:00Amjithtag:www.pgcli.com,2020-02-24:welcome-iredis.html<p>We are happy to welcome <a href="https://iredis.io">IRedis</a> to the <a href="https://www.dbcli.com">dbcli</a> org. </p>
<p>IRedis is A Terminal Client for Redis with AutoCompletion and Syntax Highlighting. </p>
<p align="center" style="margin-top: 37px">
<object data="/images/iredis.svg"></object>
</p>
<p>IRedis is written in python using the wonderful <a href="https://github.com/prompt-toolkit/python-prompt-toolkit">prompt-toolkit</a> library. It is cross-platform compatible and it is tested on Linux, MacOS and Windows.</p>
<p>IRedis ships with a lot of user-friendly <a href="https://iredis.io/show/">features</a>. One new innovative feature is the ability to pipe the output of a redis command to a unix command. Here's an example of piping JSON to <code>jq</code>: </p>
<p align="center" style="margin-top: 37px">
<object data="/images/pipeline.svg"></object>
</p>
<p>The project is lead by <a href="https://github.com/laixintao/">赖信涛</a>. </p>
<p><strong>IRedis</strong> is the latest addition to the <a href="https://www.dbcli.com">DBCLI</a> suite of tools. </p>Release v2.1.02019-04-05T00:00:00-07:002019-04-05T00:00:00-07:00Irina Truongtag:www.pgcli.com,2019-04-05:v2.1.0.html<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can install this version using:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<p>This version comes with quite a few fixes and a couple of nice usability improvements, including automatic reconnect.</p>
<div class="section" id="features">
<h2>Features:</h2>
<ul class="simple">
<li>Keybindings for closing the autocomplete list. (Thanks: <a class="reference external" href="https://github.com/verfriemelt-dot-org">easteregg</a>)</li>
<li>Reconnect automatically when server closes connection. (Thanks: <a class="reference external" href="https://github.com/808sAndBR">Scott Brenstuhl</a>)</li>
</ul>
</div>
<div class="section" id="bug-fixes">
<h2>Bug fixes:</h2>
<ul class="simple">
<li>Avoid error message on the server side if hstore extension is not installed in the current database (#991). (Thanks: <a class="reference external" href="https://github.com/saper">Marcin Cieślak</a>)</li>
<li>All pexpect submodules have been moved into the pexpect package as of version 3.0. Use pexpect.TIMEOUT (Thanks: <a class="reference external" href="https://github.com/saper">Marcin Cieślak</a>)</li>
<li>Resizing pgcli terminal kills the connection to postgres in python 2.7 (Thanks: <a class="reference external" href="https://blog.amjith.com">Amjith Ramanujam</a>)</li>
<li>Fix crash retrieving server version with <tt class="docutils literal"><span class="pre">--single-connection</span></tt>. (Thanks: <a class="reference external" href="https://github.com/j-bennet">Irina Truong</a>)</li>
<li>Cannot quit application without reconnecting to database (#1014). (Thanks: <a class="reference external" href="https://github.com/j-bennet">Irina Truong</a>)</li>
<li>Password authentication failed for user "postgres" when using non-default password (#1020). (Thanks: <a class="reference external" href="https://github.com/j-bennet">Irina Truong</a>)</li>
</ul>
</div>
<div class="section" id="internal">
<h2>Internal:</h2>
<ul class="simple">
<li>(Fixup) Clean up and add behave logging. (Thanks: <a class="reference external" href="https://github.com/saper">Marcin Cieślak</a>, <a class="reference external" href="https://github.com/meeuw">Dick Marinus</a>)</li>
<li>Override VISUAL environment variable for behave tests. (Thanks: <a class="reference external" href="https://github.com/saper">Marcin Cieślak</a>)</li>
<li>Remove build dir before running sdist, remove stray files from wheel distribution. (Thanks: <a class="reference external" href="https://github.com/meeuw">Dick Marinus</a>)</li>
<li>Fix unit tests, unhashable formatted text since new python prompttoolkit version. (Thanks: <a class="reference external" href="https://github.com/meeuw">Dick Marinus</a>)</li>
</ul>
</div>
Launching LiteCLI2019-01-03T00:00:00-08:002019-01-03T00:00:00-08:00Amjithtag:www.pgcli.com,2019-01-03:launching-litecli.html<p>Today we are happy to announce the launch of <a href="https://github.com/dbcli/litecli">LiteCLI</a>!</p>
<p>LiteCLI is a user-friendly CommandLine client for SQLite database. </p>
<p><img src='https://litecli.com/images/litecli.png' width=750px align=center alt='litecli'/></p>
<p>It is based on the popular <a href="https://www.pgcli.com">pgcli</a> and <a href="https://www.mycli.net">mycli</a> projects.</p>
<p>LiteCLI is written in python using the wonderful <a href="https://github.com/prompt-toolkit/python-prompt-toolkit">prompt-toolkit</a> library. It is
cross-platform compatible and it is tested on Linux, MacOS and Windows.</p>
<p>It is developed by a team of core devs from around the world. We are friendly
and welcoming to newcomers. </p>
<p>The project is lead by <a href="https://github.com/delgermurun">Delgermurun</a>. The
core team includes <a href="https://github.com/j-bennet">Irina Truong</a>,
<a href="https://github.com/meeuw">Dick Marinus</a>, <a href="https://github.com/zzl0">Zhaolong Zhu</a> and <a href="https://github.com/amjith">Amjith</a></p>
<p>If you're interested in using the project, check out the quick start guide or the installation guide. </p>
<ul>
<li><a href="https://www.litecli.com">QuickStart</a></li>
<li><a href="https://www.litecli.com/install">Installation</a></li>
</ul>
<p>If you're interested in helping us develop litecli you can find the code hosted
on <a href="https://github.com/dbcli/litecli/">github</a>. </p>
<p>Check out our <a href="https://github.com/dbcli/litecli/blob/master/CONTRIBUTING.md">contributing
document</a>. </p>
<p><strong>LiteCLI</strong> is the latest addition to the <a href="https://www.dbcli.com">DBCLI</a> suite of tools. </p>Release v2.0.22019-01-02T00:00:00-08:002019-01-02T00:00:00-08:00Irina Truongtag:www.pgcli.com,2019-01-02:v2.0.2.html<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can install this version using:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<p>After the update of <tt class="docutils literal">pgcli</tt> to use <tt class="docutils literal"><span class="pre">prompt-toolkit</span> 2.0</tt>, there were quite a few complaints
about performance, in particular, slow autocompletions. This release attempts to address
the problem. Additionally, thanks to our newest contributor <a class="reference external" href="https://github.com/igncampa">Ignacio Campabadal</a>, it is
now possible to supply username with a <tt class="docutils literal"><span class="pre">-u</span></tt> flag, same as <tt class="docutils literal">mycli</tt>.</p>
<div class="section" id="features">
<h2>Features:</h2>
<ul class="simple">
<li>Allows passing the <tt class="docutils literal"><span class="pre">-u</span></tt> flag to specify a username. (Thanks: <a class="reference external" href="https://github.com/igncampa">Ignacio Campabadal</a>)</li>
<li>Fix for lag in v2 (#979). (Thanks: <a class="reference external" href="https://github.com/j-bennet">Irina Truong</a>)</li>
</ul>
</div>
Release v2.0.02018-09-28T00:00:00-07:002018-09-28T00:00:00-07:00Irina Truongtag:www.pgcli.com,2018-09-28:v2.0.0.html<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can install this version using:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<p>This <tt class="docutils literal">pgcli</tt> release has only one feature in it: migration to <a class="reference external" href="https://github.com/jonathanslenders/python-prompt-toolkit">Python Prompt Toolkit</a> 2.0. The
migration was non-trivial, because prompt-toolkit was reworked almost from the ground up, and 2.0
is not compatible with 1.x. But now, <tt class="docutils literal">pgcli</tt> can finally use those <a class="reference external" href="https://python-prompt-toolkit.readthedocs.io/en/master/pages/upgrading.html#some-new-features">exciting new features</a> that
prompt-toolkit 2.0 has.</p>
<p>Many thanks to <a class="reference external" href="https://github.com/jonathanslenders">Jonathan Slenders</a> and <a class="reference external" href="https://github.com/meeuw">Dick Marinus</a>, who worked hard on the
migration!</p>
<div class="section" id="things-to-be-aware-of">
<h2>Things to be aware of</h2>
<ul class="simple">
<li><tt class="docutils literal">mycli</tt> did not yet migrate to prompt-toolkit 2.0. Until it does,
<tt class="docutils literal">pgcli</tt> and <tt class="docutils literal">mycli</tt> can't be installed into the same venv.</li>
<li>Same goes for <tt class="docutils literal">ipython</tt>. It already migrated, but is not yet released.
To install <tt class="docutils literal">ipython</tt> into the same venv as <tt class="docutils literal">pgcli</tt>, you'll have to
do it from master:</li>
</ul>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>git+https://github.com/ipython/ipython.git
</pre>
<p>As always, we are here to help in case of any issues with the new release:</p>
<p><a class="reference external" href="https://github.com/dbcli/pgcli/issues">https://github.com/dbcli/pgcli/issues</a></p>
</div>
Release v1.11.02018-09-24T00:00:00-07:002018-09-24T00:00:00-07:00Irina Truongtag:www.pgcli.com,2018-09-24:v1.11.0.html<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can install this version using:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<p>A very small release this time, but coming next is <tt class="docutils literal">pgcli</tt> migration to <a class="reference external" href="https://github.com/jonathanslenders/python-prompt-toolkit">Python Prompt Toolkit</a> 2.0.</p>
<div class="section" id="features">
<h2>Features:</h2>
<ul class="simple">
<li>Respect <tt class="docutils literal">\pset pager on</tt> and use pager when output is longer than terminal height (Thanks: <a class="reference external" href="https://github.com/maxrothman">Max Rothman</a>)</li>
</ul>
</div>
Release v1.10.02018-07-14T00:00:00-07:002018-07-14T00:00:00-07:00Irina Truongtag:www.pgcli.com,2018-07-14:v1.10.0.html<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can install this version using:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<p>This release adds new special commands <tt class="docutils literal">\ev</tt> and <tt class="docutils literal">\ef</tt>, more table formats,
and a <tt class="docutils literal"><span class="pre">--user</span></tt> alias for <tt class="docutils literal"><span class="pre">--username</span></tt> option, to be compatible with psql. <tt class="docutils literal">Pgcli</tt>
also sets <tt class="docutils literal">application_name</tt> to identify itself within postgres. Multiple bugs
were fixed.</p>
<p>This release was very special because we had a lot of first-time contributors, thanks
to <a class="reference external" href="https://github.com/amjith">Amjith</a> leading a sprint on pgcli during PyCon 2018! It's wonderful to see that
spike of commits in mid-may:</p>
<img alt="" src="/images/pgcli-commits-2018.png" />
<p>Our huge thanks to all the new contributors!</p>
<div class="section" id="features">
<h2>Features:</h2>
<ul class="simple">
<li>Add quit commands to the completion menu. (Thanks: <a class="reference external" href="https://github.com/jrib">Jason Ribeiro</a>)</li>
<li>Add table formats to <tt class="docutils literal">\T</tt> completion. (Thanks: <a class="reference external" href="https://github.com/jrib">Jason Ribeiro</a>)</li>
<li>Support <cite>\ev`</cite>, <tt class="docutils literal">\ef</tt> (#754). (Thanks: <a class="reference external" href="https://github.com/catherinedevlin">Catherine Devlin</a>)</li>
<li>Add <tt class="docutils literal">application_name</tt> to help identify pgcli connection to database (issue #868) (Thanks: <a class="reference external" href="https://github.com/fpietka">François Pietka</a>)</li>
<li>Add <cite>--user</cite> option, duplicate of <cite>--username</cite>, the same cli option like <cite>psql</cite> (Thanks: <a class="reference external" href="https://github.com/oivoodoo">Alexandr Korsak</a>)</li>
</ul>
</div>
<div class="section" id="internal-changes">
<h2>Internal changes:</h2>
<ul class="simple">
<li>Mark tests requiring a running database server as dbtest (Thanks: <a class="reference external" href="https://github.com/meeuw">Dick Marinus</a>)</li>
<li>Add an is_special command flag to MetaQuery (Thanks: <a class="reference external" href="https://github.com/RishiRamraj">Rishi Ramraj</a>)</li>
<li>Ported Destructive Warning from mycli.</li>
<li>Refactor Destructive Warning behave tests (Thanks: <a class="reference external" href="https://github.com/meeuw">Dick Marinus</a>)</li>
</ul>
</div>
<div class="section" id="bug-fixes">
<h2>Bug Fixes:</h2>
<ul class="simple">
<li>Disable pager when using watch (#837). (Thanks: <a class="reference external" href="https://github.com/jrib">Jason Ribeiro</a>)</li>
<li>Don't offer to reconnect when we can't change a param in realtime (#807). (Thanks: <a class="reference external" href="https://github.com/amjith">Amjith Ramanujam</a> and <a class="reference external" href="https://github.com/saifelse">Saif Hakim</a>)</li>
<li>Make keyring optional. (Thanks: <a class="reference external" href="https://github.com/meeuw">Dick Marinus</a>)</li>
<li>Fix ipython magic connection (#891). (Thanks: <a class="reference external" href="https://github.com/j-bennet">Irina Truong</a>)</li>
<li>Fix not enough values to unpack. (Thanks: <a class="reference external" href="https://github.com/gma2th">Matthieu Guilbert</a>)</li>
<li>Fix unbound local error when destructive_warning is false. (Thanks: <a class="reference external" href="https://github.com/gma2th">Matthieu Guilbert</a>)</li>
<li>Render tab characters as 4 spaces instead of <cite>^I</cite>. (Thanks: <a class="reference external" href="https://github.com/arturbalabanov">Artur Balabanov</a>)</li>
</ul>
</div>
DBCLI demos at PyCon2018-05-09T00:00:00-07:002018-05-09T00:00:00-07:00Amjithtag:www.pgcli.com,2018-05-09:pycon-2018.html<p><img src='/images/syntax/light/tango.png' width=750px align=center alt='screenshot'/></p>
<p>Do you love colorful, terminal applications?</p>
<p>Are you going to Pycon this year?</p>
<p>You can't afford to miss the DBCLI booth at PyCon.</p>
<p>We are an OpenSource org that builds commandline database clients with modern
features. Auto-completion, syntax highlighting and friendly UI.</p>
<p><a href="https://www.dbcli.com">DBCLI</a> is the umbrella org that builds
<a href="https://www.pgcli.com">pgcli</a>, <a href="https://www.mycli.net">mycli</a> and
<a href="https://github.com/dbcli/mssql-cli">mssql-cli</a> projects.</p>
<ul>
<li><a href="https://www.pgcli.com">pgcli</a> - Postgres commandline client with auto-completion and syntax highlighting.</li>
<li><a href="https://www.mycli.net">mycli</a> - A better MySQL terminal client with auto-completion and syntax highlighting.</li>
<li><a href="https://github.com/dbcli/mssql-cli">mssql-cli</a> - MSSQL commandline client with auto-completion and syntax highlighting.</li>
</ul>
<p>This year (2018) we are qualified as an OpenSource sponsor for PyCon. We will
have a booth and will be showing demos of pgcli, mycli and mssql-cli at the
booth. The core devs from all the projects will be available to answer
questions and help you get setup if you're interested. </p>
<p>Engineers from Microsoft who built the mssql-cli will also be hanging out in
the booth to show you the awesome features of the tool.</p>
<p>If you are curious to find out why you should use these tools instead of the
default clients, swing by our booth. We'll be happy to convince you why these
tools are awesome!</p>
<p><strong>We have stickers and t-shirts. Above all we're a bunch of Python geeks who'd love
to shoot the shit with you.</strong></p>Release v1.9.0, pgspecial 1.10.02018-03-02T00:00:00-08:002018-03-02T00:00:00-08:00Irina Truongtag:www.pgcli.com,2018-03-02:v1.9.0.html<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can install this version using:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<p>This release adds <tt class="docutils literal">\pset pager</tt> and <tt class="docutils literal">\T</tt> to control output, as well as <tt class="docutils literal"><span class="pre">--list-dsn</span></tt>, and we
just welcomed a new contributor, <a class="reference external" href="https://github.com/fraoustin">Frederic Aoustin</a>. Updated <tt class="docutils literal">pgspecial</tt> includes <tt class="docutils literal">\dD</tt>
command, and <tt class="docutils literal">$1</tt> syntax for favorite query parameters.</p>
<div class="section" id="features">
<h2>Features:</h2>
<ul class="simple">
<li>Manage pager by <tt class="docutils literal">\pset pager</tt> and add <tt class="docutils literal">enable_pager</tt> to the config file (Thanks: <a class="reference external" href="https://github.com/fraoustin">Frederic Aoustin</a>).</li>
<li>Add support for <tt class="docutils literal">\T</tt> command to change format output. (Thanks: <a class="reference external" href="https://github.com/fraoustin">Frederic Aoustin</a>).</li>
<li>Add option <tt class="docutils literal"><span class="pre">--list-dsn</span></tt> (Thanks: <a class="reference external" href="https://github.com/fraoustin">Frederic Aoustin</a>).</li>
</ul>
</div>
<div class="section" id="internal-changes">
<h2>Internal changes:</h2>
<ul class="simple">
<li>Removed support for Python 3.3. (Thanks: <a class="reference external" href="https://github.com/j-bennet">Irina Truong</a>)</li>
</ul>
<p>This release also bumps <tt class="docutils literal">pgspecial</tt> requirement to 1.10.0. The new version of <tt class="docutils literal">pgspecial</tt>
adds:</p>
</div>
<div class="section" id="features-1">
<h2>Features:</h2>
<ul class="simple">
<li>Add support for <tt class="docutils literal">\dD</tt> command. (Thanks: <a class="reference external" href="https://github.com/lelit">Lele Gaifax</a>).</li>
<li>Add support for parameters <tt class="docutils literal"><span class="pre">$1...$n</span></tt> in query (Thanks: <a class="reference external" href="https://github.com/fraoustin">Frederic Aoustin</a>).</li>
</ul>
</div>
<div class="section" id="bug-fixes">
<h2>Bug fixes:</h2>
<ul class="simple">
<li>Fix listing of table inheritance in <tt class="docutils literal">\d</tt> command. (Thanks: <a class="reference external" href="https://github.com/lelit">Lele Gaifax</a>).</li>
</ul>
</div>
Release v1.8.22017-12-22T00:00:00-08:002017-12-22T00:00:00-08:00Irina Truongtag:www.pgcli.com,2017-12-22:v1.8.2.html<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can install this version using:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<div class="section" id="features">
<h2>Features:</h2>
<ul class="simple">
<li>Use other prompt (prompt_dsn) when connecting using --dsn parameter. (Thanks: <a class="reference external" href="https://github.com/msztolcman">Marcin Sztolcman</a>)</li>
<li>Include username into password prompt. (Thanks: <a class="reference external" href="https://github.com/delicb">Bojan Delić</a>)</li>
</ul>
</div>
<div class="section" id="internal-changes">
<h2>Internal changes:</h2>
<ul class="simple">
<li>Use temporary dir as config location in tests. (Thanks: <a class="reference external" href="https://github.com/oxitnik">Dmitry B</a>)</li>
<li>Fix errors in the <tt class="docutils literal">tee</tt> test (#795 and #797). (Thanks: <a class="reference external" href="https://github.com/j-bennet">Irina Truong</a>)</li>
<li>Increase timeout for quitting pgcli. (Thanks: <a class="reference external" href="https://github.com/meeuw">Dick Marinus</a>)</li>
</ul>
</div>
<div class="section" id="bug-fixes">
<h2>Bug Fixes:</h2>
<ul class="simple">
<li>Do NOT quote the database names in the completion menu (Thanks: <a class="reference external" href="https://github.com/amjith">Amjith Ramanujam</a>)</li>
<li>Fix error in <tt class="docutils literal">unix_socket_directories</tt> (#805). (Thanks: <a class="reference external" href="https://github.com/j-bennet">Irina Truong</a>)</li>
<li>Fix the --list command line option tries to connect to 'personal' DB (#816). (Thanks: <a class="reference external" href="https://github.com/isank">Isank</a>)</li>
</ul>
</div>
Introducing mssql-cli - A query tool for SQL Server2017-12-12T00:00:00-08:002017-12-12T00:00:00-08:00Amjithtag:www.pgcli.com,2017-12-12:mssql-cli.html<p>We are excited to welcome <code>mssql-cli</code> to the <a href="https://github.com/dbcli">dbcli</a>
org. This new command line query tool for Microsoft's SQL
Server is developed by Microsoft.</p>
<p><img src='/images/mssql-cli.gif' width=750px align=center alt='mssql-cli'/></p>
<p>Microsoft's engineers reached out to the dbcli team and pitched the idea of
writing a tool for SQL Server based on <code>pgcli</code> and <code>mycli</code>. The new tool named
<code>mssql-cli</code> will live in the <code>dbcli</code> org in github.</p>
<p><code>mssql-cli</code> will ship with context-aware auto-completion, syntax highlighting,
alias support, paged output and so on. Essentially all the niceties of <code>pgcli</code>
that works with SQL Server.</p>
<p>Here's the <a href="https://blogs.technet.microsoft.com/dataplatforminsider/2017/12/12/try-mssql-cli-a-new-interactive-command-line-tool-for-sql-server/">official announcement</a> from Microsoft.</p>
<h1>Backstory:</h1>
<p>A couple of months ago, I received an email from a Microsoft PM asking me about
pgcli and dbcli org in github. I hopped on a skype call with the PM and a few
of the MS engineers. They seemed genuinely impressed by the feature set of
<code>pgcli</code> and <code>mycli</code>. I got to see a little demo of the prototype in action. </p>
<p>I was flattered when asked if the tool could be part of the dbcli suite.
Microsoft created the tool and offered to maintain it, but it will be under the
dbcli org in github. </p>
<p>Now the tool and the code are available for <a href="https://github.com/dbcli/mssql-cli">public preview</a>.</p>Release v1.8.02017-09-14T00:00:00-07:002017-09-14T00:00:00-07:00Irina Truongtag:www.pgcli.com,2017-09-14:v1.8.0.html<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can install this version using:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<div class="section" id="features">
<h2>Features:</h2>
<ul class="simple">
<li>Add fish-style auto-suggestion from history. (Thanks: <a class="reference external" href="https://github.com/amjith">Amjith Ramanujam</a>)</li>
<li>Improved formatting of arrays in output (Thanks: <a class="reference external" href="https://github.com/koljonen">Joakim Koljonen</a>)</li>
<li>Don't quote identifiers that are non-reserved keywords. (Thanks: <a class="reference external" href="https://github.com/koljonen">Joakim Koljonen</a>)</li>
<li>Remove the <tt class="docutils literal">...</tt> in the continuation prompt and use empty space instead. (Thanks: <a class="reference external" href="https://github.com/amjith">Amjith Ramanujam</a>)</li>
<li>Add conninfo and handle more parameters with c (issue #716) (Thanks: <a class="reference external" href="https://github.com/fpietka">François Pietka</a>)</li>
</ul>
</div>
<div class="section" id="internal-changes">
<h2>Internal changes:</h2>
<ul class="simple">
<li>Preliminary work for a future change in outputting results that uses less memory. (Thanks: <a class="reference external" href="https://github.com/meeuw">Dick Marinus</a>)</li>
<li>Remove import workaround for OrderedDict, required for python < 2.7. (Thanks: <a class="reference external" href="https://github.com/AndrewSpeed">Andrew Speed</a>)</li>
<li>Use less memory when formatting results for display (Thanks: <a class="reference external" href="https://github.com/meeuw">Dick Marinus</a>).</li>
<li>Port auto_vertical feature test from mycli to pgcli. (Thanks: <a class="reference external" href="https://github.com/meeuw">Dick Marinus</a>)</li>
<li>Drop wcwidth dependency (Thanks: <a class="reference external" href="https://github.com/meeuw">Dick Marinus</a>)</li>
</ul>
</div>
<div class="section" id="bug-fixes">
<h2>Bug Fixes:</h2>
<ul class="simple">
<li>Fix the way we get host when using DSN (issue #765) (Thanks: <a class="reference external" href="https://github.com/fpietka">François Pietka</a>)</li>
<li>Add missing keyword COLUMN after DROP (issue #769) (Thanks: <a class="reference external" href="https://github.com/fpietka">François Pietka</a>)</li>
<li>Don't include arguments in function suggestions for backslash commands (Thanks: <a class="reference external" href="https://github.com/koljonen">Joakim Koljonen</a>)</li>
<li>Optionally use POSTGRES_USER, POSTGRES_HOST POSTGRES_PASSWORD from environment (Thanks: <a class="reference external" href="https://github.com/meeuw">Dick Marinus</a>)</li>
</ul>
</div>
Sensible Defaults2017-07-16T00:00:00-07:002017-07-16T00:00:00-07:00Amjith Ramanujamtag:www.pgcli.com,2017-07-16:sensible-defaults.html<p>When I first set out to create <a href="https://www.pgcli.com">pgcli</a>, my goal was to
design a Postgresql client that shipped with sensible defaults. It shouldn't
require fiddling with config files to enable features.</p>
<p>How did we do on that goal? This is one of those subjective goals that is not
so easy to measure. But fortunately, <a href="http://www.craigkerstiens.com">Craig</a>
posted a useful
<a href="https://www.citusdata.com/blog/2017/07/16/customizing-my-postgres-shell-using-psqlrc/">blogpost</a>
that shows how to configure your <code>psql</code> shell to make it powerful. </p>
<p>I figured I'll use that as a scoring card to see how many of those features
are shipped by default in pgcli.</p>
<h2>Prompt</h2>
<p>One of the things covered in the blogpost is customizing the prompt to show the
server name and the database name.</p>
<p>Pgcli ships with a default prompt that has <code>user@host:dbname></code>. When you're
writing a multi-line query the subsequent lines will be indented and filled
with <code>.....</code>.</p>
<p><img src='/images/prompt.png' width=750px align=center alt='prompt'/></p>
<p>Both of these can be overridden via the config file (~/.config/pgcli/config)
but you hardly ever have to change the defaults. </p>
<h2>Null values</h2>
<p>By default <code>psql</code> won't show the NULL values in a table. You could force psql
to show a placeholder value via <code>pset null</code>. In <code>pgcli</code> the null values are
always shown and they are show as <code><null></code>.</p>
<p><img src='/images/null.png' width=750px align=center alt='null'/></p>
<p>Once again this can be overridden to any character of your preference via the
config file.</p>
<h2>Timing</h2>
<p>You can time your sql queries by enabling <code>\timing</code> in psql. This is enabled by
default in pgcli. Every query is timed and the results are displayed at the
bottom of the output.</p>
<h2>History</h2>
<p>History in pgcli is unlimited. But pgcli has no option to separate the history
for different databases. </p>
<p>The feature described in the blogpost talks about a cool feature to store the
history of a session scoped to a database. This is an awesome feature that we
might adopt in pgcli in the future versions.</p>
<h2>Output Formatting</h2>
<p>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
<code>\x on</code> or <code>\x off</code>.</p>
<p>The <code>\x auto</code> command in <code>psql</code> will intelligently choose between the table
format or the expanded format based on the screen width. </p>
<p>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.</p>
<p>I don't think we'll change this behavior. </p>
<h2>Keyword Casing</h2>
<p>One of the psql options is to choose either the upper case or lower case for
keyword completion. So when you type <code>sel</code> and then hit tab, psql will
auto-complete <code>SELECT</code> if upper-case was chosen as the option. </p>
<p>In pgcli we have those explicit 'upper' and 'lower' options. In addition we
have an 'auto' option which is set as default. This will choose the casing
based on what the user has typed so far. So if you type <code>sel</code> and hit tab,
pgcli will suggest <code>select</code>, whereas if you type <code>SEL</code> and hit tab it will
suggest <code>SELECT</code>. I'm sure there is a way achieve this in psql, but this is the
option that pgcli ships with.</p>
<h2>Conclusion</h2>
<p>We have plenty of other config options that ship with default values. You can
see a list of all the config values in <code>~/.config/pgcli/config</code> if you have
pgcli installed or you can checkout the
<a href="https://github.com/dbcli/pgcli/blob/master/pgcli/pgclirc">pgclirc</a> file for a
quick view. <a href="https://github.com/dbcli/pgcli/issues">Let us know</a> how we did.</p>Release v1.7.02017-07-15T00:00:00-07:002017-07-15T00:00:00-07:00Irina Truongtag:www.pgcli.com,2017-07-15:v1.7.0.html<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can install this version using:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<div class="section" id="features">
<h2>Features:</h2>
<ul class="simple">
<li>Refresh completions after <cite>COMMIT</cite> or <cite>ROLLBACK</cite>. (Thanks: <a class="reference external" href="https://github.com/j-bennet">Irina Truong</a>)</li>
<li>Use dbcli's Homebrew tap for installing pgcli on macOS (issue #718) (Thanks: <a class="reference external" href="https://github.com/tsroten">Thomas Roten</a>).</li>
<li>Only set <cite>LESS</cite> environment variable if it's unset. (Thanks: <a class="reference external" href="https://github.com/j-bennet">Irina Truong</a>)</li>
<li>Quote schema in <cite>SET SCHEMA</cite> statement (issue #469) (Thanks: <a class="reference external" href="https://github.com/j-bennet">Irina Truong</a>)</li>
<li>Use CLI Helpers for pretty printing query results (Thanks: <a class="reference external" href="https://github.com/tsroten">Thomas Roten</a>).</li>
<li>Skip serial columns when expanding * for <cite>INSERT INTO foo(*</cite> (Thanks: <a class="reference external" href="https://github.com/koljonen">Joakim Koljonen</a>).</li>
<li>Command line option to list databases (issue #206) (Thanks: <a class="reference external" href="https://github.com/fpietka">François Pietka</a>)</li>
</ul>
</div>
<div class="section" id="bug-fixes">
<h2>Bug Fixes:</h2>
<ul class="simple">
<li>Fixed DSN aliases not being read from custom pgclirc (issue #717). (Thanks: <a class="reference external" href="https://github.com/j-bennet">Irina Truong</a>).</li>
</ul>
</div>
Release v1.4.02017-01-11T00:00:00-08:002017-01-11T00:00:00-08:00Irina Truongtag:www.pgcli.com,2017-01-11:v1.4.0.html<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can install this version using:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<p>Check <a class="reference external" href="https://www.pgcli.com/install">detailed instructions</a> if you're having difficulty.</p>
<div class="section" id="features">
<h2>Features:</h2>
<ul class="simple">
<li>Search table suggestions using initialisms. (Thanks: <a class="reference external" href="https://github.com/koljonen">Joakim Koljonen</a>).</li>
<li>Support for table-qualifying column suggestions. (Thanks: <a class="reference external" href="https://github.com/koljonen">Joakim Koljonen</a>).</li>
<li>Display transaction status in the toolbar. (Thanks: <a class="reference external" href="https://github.com/koljonen">Joakim Koljonen</a>).</li>
<li>Display vi mode in the toolbar. (Thanks: <a class="reference external" href="https://github.com/koljonen">Joakim Koljonen</a>).</li>
<li>Added --prompt option. (Thanks: <a class="reference external" href="https://github.com/j-bennet">Irina Truong</a>).</li>
</ul>
</div>
<div class="section" id="bug-fixes">
<h2>Bug Fixes:</h2>
<ul class="simple">
<li>Fix scoping for columns from CTEs. (Thanks: <a class="reference external" href="https://github.com/koljonen">Joakim Koljonen</a>)</li>
<li>Fix crash after <cite>with</cite>. (Thanks: <a class="reference external" href="https://github.com/koljonen">Joakim Koljonen</a>).</li>
<li>Fix issue #603 (<cite>i</cite> raises a TypeError). (Thanks: <a class="reference external" href="https://github.com/lelit">Emanuele Gaifas</a>).</li>
</ul>
</div>
<div class="section" id="internal-changes">
<h2>Internal Changes:</h2>
<ul class="simple">
<li>Set default data_formatting to nothing. (Thanks: <a class="reference external" href="https://github.com/amjith">Amjith Ramanujam</a>).</li>
<li>Increased minimum prompt_toolkit requirement to 1.0.9. (Thanks: <a class="reference external" href="https://github.com/j-bennet">Irina Truong</a>).</li>
</ul>
</div>
New Maintainer for pgcli - Irina2016-11-20T00:00:00-08:002016-11-20T00:00:00-08:00Amjithtag:www.pgcli.com,2016-11-20:irina.html<p>About 2 years ago I (Amjith) made a modest announcement about launching <code>pgcli</code> a CLI
client for Postgres with auto-completion. Since then <code>pgcli</code> has grown at a
tremendous pace. We have over 4900 stars on github, released 39 versions,
merged 320 pull requests from over 60 different contributors. We established a
core team which has 7 team members and we're always looking for interested
folks to join the team. Our only requirement is "be nice and welcoming to
everyone".</p>
<p><img src='/images/irina.png' width=750px align=center alt='Irina'/></p>
<p>I'm happy to announce that <a href="https://github.com/j-bennet">Irina</a> has volunteered
to take over the role of maintaining the pgcli project. I will be staying as
part of the core team but Irina will be in charge of the direction of the
project. </p>
<p>A little bit about Irina, she is the earliest contributor of pgcli. In fact she
started contributing even before it was announced publicly. She's a personal
friend and a great programmer. She's also the creator of the tremendously
useful docker tool <a href="http://wharfee.com/">wharfee</a>.</p>
<p>Why am I stepping down? There are two reasons, one I have a six month old baby
at home and I'm sleep deprived and tired all the time. Second, I've done
everything I can to make pgcli a success but I think I've depleted my ideas and
I've become stagnant. It is time to bring a fresh perspective to the project.</p>
<p>I want to thank Irina for stepping up and the rest of the core team for their
support.</p>Release v1.0.02016-06-28T00:00:00-07:002016-06-28T00:00:00-07:00Amjithtag:www.pgcli.com,2016-06-28:v1.0.0.html<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can install this version using:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<p>Check <a class="reference external" href="https://www.pgcli.com/install">detailed instructions</a> if you're having difficulty.</p>
<p>This is a major update with a ton of new features a lot of bug fixes. Some of
the highlights include support for Redshift and Postgres 8.x versions. Added
meta commands such as <tt class="docutils literal">\copy</tt>, <tt class="docutils literal">\o</tt>, <tt class="docutils literal">\dx</tt> path completion for <tt class="docutils literal">\i</tt>.
The completions for JOIN and COLUMN were enhanced.</p>
<p>Please file any bug reports to github issues: <a class="reference external" href="https://github.com/dbcli/pgcli/issues">https://github.com/dbcli/pgcli/issues</a></p>
<div class="section" id="features">
<h2>Features:</h2>
<ul class="simple">
<li>Upgrade to prompt-toolkit 1.0.0. (Thanks: <a class="reference external" href="https://github.com/jonathanslenders">Jonathan Slenders</a>).</li>
<li>Add support for <cite>o</cite> command to redirect query output to a file. (Thanks: <a class="reference external" href="https://github.com/Gollum999">Tim Sanders</a>).</li>
<li>Add <cite>i</cite> path completion. (Thanks: <a class="reference external" href="https://github.com/ajlai">Anthony Lai</a>).</li>
<li>Connect to a dsn saved in config file. (Thanks: <a class="reference external" href="https://github.com/roramirez">Rodrigo Ramírez Norambuena</a>).</li>
<li>Upgrade sqlparse requirement to version 0.1.19. (Thanks: <a class="reference external" href="FernandoL.Canizo">Fernando L. Canizo</a>).</li>
<li>Add timestamptz to DATE custom extension. (Thanks: <a class="reference external" href="https://github.com/fernandomora">Fernando Mora</a>).</li>
<li>Ensure target dir exists when copying config. (Thanks: <a class="reference external" href="DavidSzotten">David Szotten</a>).</li>
<li>Handle dates that fall in the B.C. range. (Thanks: <a class="reference external" href="https://github.com/stuartquin">Stuart Quin</a>).</li>
<li>Pager is selected from config file or else from environment variable. (Thanks: <a class="reference external" href="https://github.com/fernandomora">Fernando Mora</a>).</li>
<li>Add support for Amazon Redshift. (Thanks: <a class="reference external" href="TimothyCleaver">Timothy Cleaver</a>).</li>
<li>Add support for Postgres 8.x. (Thanks: <a class="reference external" href="TimothyCleaver">Timothy Cleaver</a> and <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>)</li>
<li>Don't error when completing parameter-less functions. (Thanks: <a class="reference external" href="DavidSzotten">David Szotten</a>).</li>
<li>Concat and return all available notices. (Thanks: <a class="reference external" href="https://github.com/stuartquin">Stuart Quin</a>).</li>
<li>Handle unicode in record type. (Thanks: <a class="reference external" href="https://github.com/amjith">Amjith Ramanujam</a>).</li>
<li>Added humanized time display. Connect #396. (Thanks: <a class="reference external" href="https://github.com/j-bennet">Irina Truong</a>).</li>
<li>Add EXPLAIN keyword to the completion list. (Thanks: <a class="reference external" href="https://github.com/amjith">Amjith Ramanujam</a>).</li>
<li>Sort completions based on most recently used. (Thanks: <cite>Darik Gamble</cite>)</li>
<li>Expand '*' into column list during completion. This can be triggered by hitting <cite><tab></cite> after the '*' character in the sql while typing. (Thanks: <a class="reference external" href="https://github.com/koljonen">Joakim Koljonen</a>)</li>
<li>Add a limit to the warning about too many rows. This is controlled by a new config value in ~/.config/pgcli/config. (Thanks: <a class="reference external" href="https://github.com/Smotko">Anže Pečar</a>)</li>
<li>Improved argument list in function parameter completions. (Thanks: <a class="reference external" href="https://github.com/koljonen">Joakim Koljonen</a>)</li>
<li>Column suggestions after the COLUMN keyword. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>)</li>
<li>Filter out trigger implemented functions from the suggestion list. (Thanks: <a class="reference external" href="https://github.com/drocco007">Daniel Rocco</a>)</li>
<li>State of the art JOIN clause completions that suggest entire conditions. (Thanks: <a class="reference external" href="https://github.com/koljonen">Joakim Koljonen</a>)</li>
<li>Suggest fully formed JOIN clauses based on Foreign Key relations. (Thanks: <a class="reference external" href="https://github.com/koljonen">Joakim Koljonen</a>)</li>
<li>Add support for <cite>dx</cite> meta command to list the installed extensions. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>)</li>
<li>Add support for <cite>copy</cite> command. (Thanks: <a class="reference external" href="https://github.com/catherinedevlin">Catherine Devlin</a>)</li>
</ul>
</div>
<div class="section" id="bugs">
<h2>Bugs:</h2>
<ul class="simple">
<li>Fix bug where config writing would leave a '~' dir. (Thanks: <a class="reference external" href="https://github.com/jmunson">James Munson</a>).</li>
<li>Fix auto-completion breaking for table names with caps. (Thanks: <a class="reference external" href="https://github.com/ajlai">Anthony Lai</a>).</li>
<li>Fix lexical ordering bug. (Thanks: <a class="reference external" href="https://github.com/ajlai">Anthony Lai</a>).</li>
<li>Use lexical order to break ties when fuzzy matching. (Thanks: <a class="reference external" href="https://github.com/drocco007">Daniel Rocco</a>).</li>
<li>Fix the bug in auto-expand mode when there are no rows to display. (Thanks: <a class="reference external" href="https://github.com/amjith">Amjith Ramanujam</a>).</li>
<li>Fix broken <cite>i</cite> after #395. (Thanks: <a class="reference external" href="DavidSzotten">David Szotten</a>).</li>
<li>Fix multi-way joins in auto-completion. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>)</li>
<li>Display null values as <null> in expanded output. (Thanks: <a class="reference external" href="https://github.com/amjith">Amjith Ramanujam</a>).</li>
<li>Robust support for Postgres version less than 9.x. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>)</li>
</ul>
</div>
<div class="section" id="internal-changes">
<h2>Internal Changes:</h2>
<ul class="simple">
<li>Update config file location in README. (Thanks: <a class="reference external" href="AriSummer">Ari Summer</a>).</li>
<li>Explicitly add wcwidth as a dependency. (Thanks: <a class="reference external" href="https://github.com/amjith">Amjith Ramanujam</a>).</li>
<li>Add tests for the format_output. (Thanks: <a class="reference external" href="https://github.com/amjith">Amjith Ramanujam</a>).</li>
<li>Lots of tests for pgcompleter. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>).</li>
<li>Update pgspecial dependency to 1.4.0.</li>
<li>Added sdist upload to release script. (Thanks: <a class="reference external" href="https://github.com/j-bennet">Irina Truong</a>).</li>
</ul>
</div>
Launching 'vcli' for VerticaDB2015-11-24T00:00:00-08:002015-11-24T00:00:00-08:00Amjithtag:www.pgcli.com,2015-11-24:vcli.html<p>Today we're proud to announce a new project called <code>vcli</code>. This is a Command
Line tool for VerticaDB that is based on <a href="http://pgcli.com">pgcli</a>.</p>
<p>Source: <a href="https://github.com/dbcli/vcli">https://github.com/dbcli/vcli</a></p>
<p><img alt="vcli" src="https://www.pgcli.com/images/vcli.gif" /></p>
<h2>Who?</h2>
<p>The main author of <code>vcli</code> is <a href="https://github.com/eliangcs">Chang-Hung
Liang</a>. He took the source code for pgcli and
repurposed it to work with VerticaDB. The <code>vcli</code> project will be hosted under
the <code>dbcli</code> org in github. This enables us to share the code among the various
project easily and learn from each other.</p>
<h1>Features</h1>
<ul>
<li>Context sensitive auto-completion.</li>
<li>Fuzzy matching of table names and column names.</li>
<li>Syntax highlighting of SQL Statments.</li>
<li>Vi/Emacs mode for keybindings.</li>
<li>Intuitive UI design.</li>
</ul>
<p>Please feel free to report any bugs or feature requests on
<a href="https://github.com/dbcli/vcli/issues">Github</a>.</p>Release v0.20.12015-11-08T00:00:00-08:002015-11-08T00:00:00-08:00Iryna Cherniavskatag:www.pgcli.com,2015-11-08:v0.20.1.html<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can install this version by:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<p>Check <a class="reference external" href="https://www.pgcli.com/install">detailed instructions</a> if you're having difficulty.</p>
<p>This is a bug fix release to fix <tt class="docutils literal">pgcli</tt> crashing on startup in Windows.</p>
<div class="section" id="bug-fixes">
<h2>Bug Fixes:</h2>
<ul class="simple">
<li>Fixed logging in Windows by switching the location of log and history file based on OS. (Thanks: Amjith, <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>, <a class="reference external" href="https://github.com/j-bennet">Iryna Cherniavska</a>).</li>
</ul>
</div>
Release v0.20.02015-10-31T00:00:00-07:002015-10-31T00:00:00-07:00Amjithtag:www.pgcli.com,2015-10-31:v0.20.0.html<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can install this version by:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<p>Check <a class="reference external" href="https://www.pgcli.com/install">detailed instructions</a> if you're having difficulty.</p>
<p>This version adds support for <tt class="docutils literal">\\h</tt> command and <tt class="docutils literal">\x auto</tt> command. Two
very important commands that bring us close to being a total replacement for
psql. This version can also handle really large databases without trouble
thanks to asynchronous completion refresh. Full details below:</p>
<div class="section" id="features">
<h2>Features:</h2>
<ul>
<li><p class="first">Perform auto-completion refresh in background. (Thanks: Amjith, <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>, <a class="reference external" href="https://github.com/j-bennet">Iryna Cherniavska</a>).</p>
<p>When the auto-completion entries are refreshed, the update now happens in a
background thread. This means large databases with thousands of tables are
handled without blocking.</p>
</li>
<li><p class="first">Add support for <tt class="docutils literal">\h</tt> command. (Thanks: <a class="reference external" href="https://github.com/stuartquin">Stuart Quin</a>).</p>
<p>This is a huge deal. Users can now get help on an SQL command by typing:
<tt class="docutils literal">\h COMMAND_NAME</tt> in the pgcli prompt.</p>
</li>
<li><p class="first">Add support for <tt class="docutils literal">\x auto</tt>. (Thanks: <a class="reference external" href="https://github.com/stuartquin">Stuart Quin</a>).</p>
<p><tt class="docutils literal">\\x auto</tt> will automatically switch to expanded mode if the output is wider
than the display window.</p>
</li>
<li><p class="first">Don't hide functions from pg_catalog. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>).</p>
</li>
<li><p class="first">Suggest set-returning functions as tables. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>).</p>
<p>Functions that return table like results will now be suggested in places of tables.</p>
</li>
<li><p class="first">Suggest fields from functions used as tables. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>).</p>
</li>
<li><p class="first">Using <tt class="docutils literal">pgspecial</tt> as a separate module. (Thanks: <a class="reference external" href="https://github.com/j-bennet">Iryna Cherniavska</a>).</p>
</li>
<li><p class="first">Make "enter" key behave as "tab" key when the completion menu is displayed. (Thanks: <a class="reference external" href="MatheusRosa">Matheus Rosa</a>).</p>
</li>
<li><p class="first">Support different error-handling options when running multiple queries. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>).</p>
<p>When <tt class="docutils literal">on_error = STOP</tt> in the config file, pgcli will abort execution if one of the queries results in an error.</p>
</li>
<li><p class="first">Hide the password displayed in the process name in <tt class="docutils literal">ps</tt>. (Thanks: <a class="reference external" href="https://github.com/stuartquin">Stuart Quin</a>)</p>
</li>
<li><p class="first">Add <tt class="docutils literal">CONCURRENTLY</tt> to keyword completion. (Thanks: <a class="reference external" href="JohannesHoff">Johannes Hoff</a>).</p>
</li>
</ul>
</div>
<div class="section" id="bug-fixes">
<h2>Bug Fixes:</h2>
<ul class="simple">
<li>Fix the ordering bug in <cite>\d+</cite> display, this bug was displaying the wrong table name in the reference. (Thanks: <a class="reference external" href="https://github.com/TamasNo1">Tamas Boros</a>).</li>
<li>Only show expanded layout if valid list of headers provided. (Thanks: <a class="reference external" href="https://github.com/stuartquin">Stuart Quin</a>).</li>
<li>Fix suggestions in compound join clauses. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>).</li>
<li>Fix completion refresh in multiple query scenario. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>).</li>
<li>Fix the broken timing information.</li>
<li>Fix the removal of whitespaces in the output. (Thanks: <a class="reference external" href="https://github.com/d33tah">Jacek Wielemborek</a>)</li>
<li>Fix PyPI badge. (Thanks: <a class="reference external" href="https://github.com/ming13">Artur Dryomov</a>).</li>
</ul>
</div>
<div class="section" id="improvements">
<h2>Improvements:</h2>
<ul class="simple">
<li>Move config file to <cite>~/.config/pgcli/config</cite> instead of <cite>~/.pgclirc</cite> (Thanks: <a class="reference external" href="inkn">inkn</a>).</li>
<li>Move literal definitions to standalone JSON files. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>).</li>
</ul>
</div>
<div class="section" id="internal-changes">
<h2>Internal Changes:</h2>
<ul class="simple">
<li>Improvements to integration tests to make it more robust. (Thanks: <a class="reference external" href="https://github.com/j-bennet">Iryna Cherniavska</a>).</li>
</ul>
</div>
Pgspecial is now an independent module2015-09-22T00:00:00-07:002015-09-22T00:00:00-07:00Iryna Cherniavskatag:www.pgcli.com,2015-09-22:pgspecial-release.html<p>The pgspecial package is now independent and has its own place on PyPI:</p>
<h1><a href="https://pypi.python.org/pypi/pgspecial">pgspecial</a></h1>
<p>The package provides an API for developers who wish to run meta-commands on
PostgreSQL database without invoking the command line or rolling out their own
custom solution. It is easily extendable.</p>
<p>Here is an example of installing it and using it in in python REPL:</p>
<div class="highlight"><pre><span></span>$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>pgspecial
$<span class="w"> </span>python
Python<span class="w"> </span><span class="m">2</span>.7.3<span class="w"> </span><span class="o">(</span>default,<span class="w"> </span>Jun<span class="w"> </span><span class="m">22</span><span class="w"> </span><span class="m">2015</span>,<span class="w"> </span><span class="m">19</span>:33:41<span class="o">)</span><span class="w"> </span>
<span class="o">[</span>GCC<span class="w"> </span><span class="m">4</span>.6.3<span class="o">]</span><span class="w"> </span>on<span class="w"> </span>linux2
Type<span class="w"> </span><span class="s2">"help"</span>,<span class="w"> </span><span class="s2">"copyright"</span>,<span class="w"> </span><span class="s2">"credits"</span><span class="w"> </span>or<span class="w"> </span><span class="s2">"license"</span><span class="w"> </span><span class="k">for</span><span class="w"> </span>more<span class="w"> </span>information.
</pre></div>
<p>After you see the prompt:</p>
<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="kn">import</span> <span class="nn">psycopg2</span>
<span class="o">>>></span> <span class="kn">from</span> <span class="nn">pgspecial.main</span> <span class="kn">import</span> <span class="n">PGSpecial</span>
<span class="o">>>></span> <span class="n">p</span> <span class="o">=</span> <span class="n">PGSpecial</span><span class="p">()</span>
<span class="o">>>></span> <span class="n">conn</span> <span class="o">=</span> <span class="n">psycopg2</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="n">user</span><span class="o">=</span><span class="s1">'postgres'</span><span class="p">,</span> <span class="n">host</span><span class="o">=</span><span class="s1">'localhost'</span><span class="p">,</span> <span class="n">database</span><span class="o">=</span><span class="s1">'geo'</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">cur</span> <span class="o">=</span> <span class="n">conn</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="o">>>></span> <span class="k">for</span> <span class="n">title</span><span class="p">,</span> <span class="n">rows</span><span class="p">,</span> <span class="n">headers</span><span class="p">,</span> <span class="n">status</span> <span class="ow">in</span> <span class="n">p</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="n">cur</span><span class="p">,</span> <span class="s1">'</span><span class="se">\\</span><span class="s1">d city'</span><span class="p">):</span>
<span class="o">...</span> <span class="nb">print</span> <span class="n">title</span>
<span class="o">...</span> <span class="nb">print</span> <span class="n">headers</span>
<span class="o">...</span> <span class="k">for</span> <span class="n">row</span> <span class="ow">in</span> <span class="n">rows</span><span class="p">:</span>
<span class="o">...</span> <span class="nb">print</span> <span class="n">row</span>
<span class="o">...</span> <span class="nb">print</span> <span class="n">status</span>
<span class="o">...</span>
<span class="o">...</span>
<span class="p">[</span><span class="s1">'Column'</span><span class="p">,</span> <span class="s1">'Type'</span><span class="p">,</span> <span class="s1">'Modifiers'</span><span class="p">]</span>
<span class="p">[</span><span class="s1">'zip_code'</span><span class="p">,</span> <span class="s1">'character varying(5)'</span><span class="p">,</span> <span class="s1">' not null'</span><span class="p">]</span>
<span class="p">[</span><span class="s1">'name'</span><span class="p">,</span> <span class="s1">'character varying(28)'</span><span class="p">,</span> <span class="s1">' not null'</span><span class="p">]</span>
<span class="p">[</span><span class="s1">'abbreviation'</span><span class="p">,</span> <span class="s1">'character varying(13)'</span><span class="p">,</span> <span class="s1">''</span><span class="p">]</span>
<span class="n">Indexes</span><span class="p">:</span>
<span class="s2">"city_pkey"</span> <span class="n">PRIMARY</span> <span class="n">KEY</span><span class="p">,</span> <span class="n">btree</span> <span class="p">(</span><span class="n">zip_code</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span>
</pre></div>
<p>To learn more about the package or to contribute, follow the
<a href="https://github.com/dbcli/pgspecial">github</a> link.</p>Release v0.19.22015-08-30T00:00:00-07:002015-08-30T00:00:00-07:00Amjithtag:www.pgcli.com,2015-08-30:v0.19.2.html<div class="section" id="features">
<h2>Features:</h2>
<ul class="simple">
<li>Autocompletion for database name in c and connect. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>).</li>
<li>Improved multiline query support by correctly handling open quotes. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>).</li>
<li>Added pager command.</li>
<li>Enhanced i to run multiple queries and display the results for each of them</li>
<li>Added keywords to suggestions after WHERE clause.</li>
<li>Enabled autocompletion in named queries. (Thanks: <a class="reference external" href="https://github.com/j-bennet">Iryna Cherniavska</a>).</li>
<li>Path to .pgclirc can be specified in command line. (Thanks: <a class="reference external" href="https://github.com/j-bennet">Iryna Cherniavska</a>).</li>
<li>Added support for pg_service_conf file. (Thanks: <a class="reference external" href="https://github.com/j-bennet">Iryna Cherniavska</a>).</li>
<li>Added custom styles. (Contributor: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>).</li>
</ul>
</div>
<div class="section" id="internal-changes">
<h2>Internal Changes:</h2>
<ul class="simple">
<li>More completer test cases. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>).</li>
<li>Updated sqlparse version from 0.1.14 to 0.1.16. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>).</li>
<li>Upgraded to prompt_toolkit 0.46. (Thanks: <a class="reference external" href="https://github.com/jonathanslenders">Jonathan Slenders</a>).</li>
</ul>
</div>
<div class="section" id="bugfixes">
<h2>BugFixes:</h2>
<ul class="simple">
<li>Fixed the completer crashing on invalid SQL. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>).</li>
<li>Fixed unicode issues, updated tests and fixed broken tests.</li>
</ul>
</div>
Release v0.19.12015-08-04T00:00:00-07:002015-08-04T00:00:00-07:00Amjithtag:www.pgcli.com,2015-08-04:v0.19.1.html<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can install this version by:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<p>Check <a class="reference external" href="https://www.pgcli.com/install">detailed instructions</a> if you're having difficulty.</p>
<p>This is a minor bug fix release to fix a crashing bug during autocompletion.</p>
<div class="section" id="bug-fixes">
<h2>Bug Fixes:</h2>
<ul class="simple">
<li>Fix an autocompletion bug that was crashing the completion engine when unknown keyword is entered. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>)</li>
</ul>
</div>
Release v0.19.02015-08-03T00:00:00-07:002015-08-03T00:00:00-07:00Amjithtag:www.pgcli.com,2015-08-03:v0.19.0.html<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can install this version by:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<p>Check <a class="reference external" href="https://www.pgcli.com/install">detailed instructions</a> if you're having difficulty.</p>
<p>This release comes with metadata information in the completion menus. Now you
can see whether a completion suggestion is a table or a schema or a view.
New special command (<tt class="docutils literal">\i</tt>), latest prompt_toolkit with wider completion menus.</p>
<div class="section" id="features">
<h2>Features:</h2>
<ul>
<li><p class="first">Wider completion menus can be enabled via the config file. (Thanks: <a class="reference external" href="https://github.com/jonathanslenders">Jonathan Slenders</a>)</p>
<p>Open the config file (~/.pgclirc) and check if you have
<tt class="docutils literal">wider_completion_menu</tt> option available. If not add it in and set it to
<tt class="docutils literal">True</tt>.</p>
</li>
<li><p class="first">Completion menu now has metadata information such as schema, table, column, view, etc., next to the suggestions. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>)</p>
</li>
<li><p class="first">Customizable history file location via config file. (Thanks: <a class="reference external" href="https://github.com/cagatay">Çağatay Yüksel</a>)</p>
<p>Add this line to your config file (~/.pgclirc) to customize where to store the history file.</p>
</li>
</ul>
<pre class="literal-block">
history_file = /path/to/history/file
</pre>
<ul class="simple">
<li>Add support for running queries from a file using <tt class="docutils literal">\i</tt> special command. (Thanks: <a class="reference external" href="https://github.com/mikekaminsky">Michael Kaminsky</a>)</li>
</ul>
</div>
<div class="section" id="bug-fixes">
<h2>Bug Fixes:</h2>
<ul class="simple">
<li>Always use utf-8 for database encoding regardless of the default encoding used by the database.</li>
<li>Fix for None dereference on <tt class="docutils literal">\d schemaname.</tt> with sequence. (Thanks: <a class="reference external" href="https://github.com/nathanjhaveri">Nathan Jhaveri</a>)</li>
<li>Fix a crashing bug in the autocompletion engine for some <tt class="docutils literal">JOIN</tt> queries.</li>
<li>Handle KeyboardInterrupt in pager and not quit pgcli as a consequence.</li>
</ul>
</div>
<div class="section" id="internal-changes">
<h2>Internal Changes:</h2>
<ul class="simple">
<li>Added more behavioral tests (Thanks: <a class="reference external" href="https://github.com/j-bennet">Iryna Cherniavska</a>)</li>
<li>Added code coverage to the tests. (Thanks: <a class="reference external" href="https://github.com/j-bennet">Iryna Cherniavska</a>)</li>
<li>Run behavioral tests as part of TravisCI (Thanks: <a class="reference external" href="https://github.com/j-bennet">Iryna Cherniavska</a>)</li>
<li>Upgraded prompt_toolkit version to 0.45 (Thanks: <a class="reference external" href="https://github.com/jonathanslenders">Jonathan Slenders</a>)</li>
<li>Update the minumum required version of click to 4.1.</li>
</ul>
</div>
Release v0.18.02015-06-16T00:00:00-07:002015-06-16T00:00:00-07:00Amjithtag:www.pgcli.com,2015-06-16:v0.18.0.html<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can install this version by:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<p>Check <a class="reference external" href="https://www.pgcli.com/install">detailed instructions</a> if you're having difficulty.</p>
<p>This release comes with the ability to save favorite queries, fuzzy matching in
auto-completion, new special commands (<tt class="docutils literal">\#</tt>), fix unicode issues in Windows and
lot more. Thanks to the many contributors.</p>
<div class="section" id="features">
<h2>Features:</h2>
<ul>
<li><p class="first">Add fuzzy matching for the table names and column names.</p>
<p>Matching very long table/column names are now easier with fuzzy matching. The
fuzzy match works like the fuzzy open in SublimeText or Vim's Ctrl-P plugin.</p>
<p>eg: Typing <tt class="docutils literal">djmiviw</tt> will match <strong>dj</strong>ango_<strong>mi</strong>gration_<strong>vi</strong>ews since it is able to
match parts of the input to the full table name.</p>
</li>
<li><p class="first">Timing information is now shown in seconds.</p>
<p>The <tt class="docutils literal">Command Time</tt> and <tt class="docutils literal">Format Time</tt> are now displayed in seconds instead
of a unitless number displayed in scientific notation.</p>
</li>
<li><p class="first">Support for named queries (favorite queries). (Thanks: <a class="reference external" href="https://github.com/brettatoms">Brett Atoms</a>)</p>
<p>Frequently typed queries can now be saved and recalled using a name using
newly added special commands (<tt class="docutils literal"><span class="pre">\n[+]</span></tt>, <tt class="docutils literal">\ns</tt>, <tt class="docutils literal">\nd</tt>).</p>
<p>eg:</p>
</li>
</ul>
<pre class="literal-block">
# Save a query
pgcli> \ns simple select * from foo
saved
# List all saved queries
pgcli> \n+
# Execute a saved query
pgcli> \n simple
# Delete a saved query
pgcli> \nd simple
</pre>
<ul class="simple">
<li>Pasting queries into the pgcli repl is orders of magnitude faster. (Thanks: <a class="reference external" href="https://github.com/jonathanslenders">Jonathan Slenders</a>)</li>
<li>Add support for PGPASSWORD environment variable to pass the password for the
postgres database. (Thanks: <a class="reference external" href="https://github.com/j-bennet">Iryna Cherniavska</a>)</li>
<li>Add the ability to manually refresh autocompletions by typing <tt class="docutils literal">\#</tt> or
<tt class="docutils literal">\refresh</tt>. This is useful if the database was updated by an external means
and you'd like to refresh the auto-completions to pick up the new change.</li>
</ul>
</div>
<div class="section" id="bug-fixes">
<h2>Bug Fixes:</h2>
<ul class="simple">
<li>Fix an error when running <tt class="docutils literal">\d table_name</tt> when running on a table with rules. (Thanks: <a class="reference external" href="https://github.com/sancopanco">Ali Kargın</a>)</li>
<li>Fix a pgcli crash when entering non-ascii characters in Windows. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>, <a class="reference external" href="https://github.com/jonathanslenders">Jonathan Slenders</a>)</li>
<li>Faster rendering of expanded mode output by making the horizontal separator a fixed length string.</li>
<li>Completion suggestions for the <tt class="docutils literal">\c</tt> command are not auto-escaped by default.</li>
</ul>
</div>
<div class="section" id="internal-changes">
<h2>Internal Changes:</h2>
<ul class="simple">
<li>Complete refactor of handling the back-slash commands. It is now easier to
add new special back-slash commands using a decorator.</li>
<li>Upgrade prompt_toolkit to 0.42. (Thanks: <a class="reference external" href="https://github.com/jonathanslenders">Jonathan Slenders</a>)</li>
<li>Change the config file management to use ConfigObj.(Thanks: <a class="reference external" href="https://github.com/brettatoms">Brett Atoms</a>)</li>
<li>Add integration tests using <tt class="docutils literal">behave</tt>. (Thanks: <a class="reference external" href="https://github.com/j-bennet">Iryna Cherniavska</a>)</li>
</ul>
</div>
Release v0.17.02015-05-26T00:00:00-07:002015-05-26T00:00:00-07:00Amjithtag:www.pgcli.com,2015-05-26:v0.17.0.html<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can install this version by:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<p>Check <a class="reference external" href="https://www.pgcli.com/install">detailed instructions</a> if you're having difficulty.</p>
<p>This release comes with the latest version of prompt_tookit, improved
auto-completion support, better matching algorithm in auto-completion, new
special commands (<tt class="docutils literal">\e</tt>, <tt class="docutils literal">\dT</tt>), fix CJK dispaly and a lot more. Thanks to
the many contributors.</p>
<div class="section" id="features">
<h2>Features:</h2>
<ul>
<li><p class="first">Add support for auto-completing view names. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>)</p>
</li>
<li><p class="first">Add subsequence matching for completion. (Thanks: <a class="reference external" href="https://github.com/drocco007">Daniel Rocco</a>)
Previously completions only matched a table name if it started with the
partially typed word. Now completions will match even if the partially typed
word is in the middle of a suggestion.</p>
<p>eg: When you type 'mig', 'django_migrations' will be suggested.</p>
</li>
<li><p class="first">Completion for built-in tables and temporary tables are suggested after entering a prefix of <tt class="docutils literal">pg_</tt>. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>)</p>
</li>
<li><p class="first">Add place holder doc strings for special commands that are planned for implementation. (Thanks: <a class="reference external" href="https://github.com/j-bennet">Iryna Cherniavska</a>)</p>
</li>
<li><p class="first">Updated version of prompt_toolkit, now matching braces are highlighted. (Thanks: <a class="reference external" href="https://github.com/jonathanslenders">Jonathan Slenders</a>)</p>
</li>
<li><p class="first">Added support for <tt class="docutils literal">\e</tt> command. Queries can be edited in an external editor. (Thanks: <a class="reference external" href="https://github.com/j-bennet">Iryna Cherniavska</a>)</p>
<p>eg: When you type <tt class="docutils literal">SELECT * FROM \e</tt> it will be opened in an external editor.</p>
</li>
<li><p class="first">Add special command <tt class="docutils literal">\dT</tt> to show datatypes. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>)</p>
</li>
<li><p class="first">Add auto-completion support for datatypes in CREATE, SELECT etc. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>)</p>
</li>
<li><p class="first">Improve the auto-completion in WHERE clause with logical operators. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>)</p>
</li>
</ul>
</div>
<div class="section" id="bug-fixes">
<h2>Bug Fixes:</h2>
<ul class="simple">
<li>Fix the table formatting while printing multi-byte characters (Chinese, Japanese etc). (Thanks: <a class="reference external" href="https://github.com/xalley">蔡佳男</a>)</li>
<li>Fix a crash when pg_catalog was present in search path. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>)</li>
<li>Fixed a bug that broke <tt class="docutils literal">\e</tt> when prompt_tookit was updated. (Thanks: <a class="reference external" href="https://github.com/fpietka">François Pietka</a>)</li>
<li>Fix the display of triggers as shown in the <tt class="docutils literal">\d</tt> output. (Thanks: <a class="reference external" href="https://github.com/droustchev">Dimitar Roustchev</a>)</li>
<li>Fix broken auto-completion for INNER JOIN, LEFT JOIN etc. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>)</li>
<li>Fix incorrect super() calls in pgbuffer, pgtoolbar and pgcompleter. No change in functionality but protects against future problems. (Thanks: <a class="reference external" href="https://github.com/drocco007">Daniel Rocco</a>)</li>
<li>Add missing schema completion for CREATE and DROP statements. (Thanks: <a class="reference external" href="https://github.com/darikg">Darik Gamble</a>)</li>
<li>Minor fixes around cursor cleanup.</li>
</ul>
</div>
Integrating pgcli with heroku toolbelt2015-05-06T00:00:00-07:002015-05-06T00:00:00-07:00Amjithtag:www.pgcli.com,2015-05-06:heroku-pgcli.html<p>Heroku is a popular PAAS provider that offers managed Postgres database. Heroku provides a convenience command to connect to the postgres database, which will launch <code>psql</code>. Now it is possible to launch <code>pgcli</code> instead of the default <code>psql</code> for heroku Postgres by installing the <a href="https://github.com/chrisanderton/heroku-pg-pgcli">heroku-pg-pgcli</a> plugin for heroku tool belt.</p>
<h3>Installation</h3>
<p>Make sure pgcli is installed. If it is not installed check the installation <a href="http://pgcli.com/install">instructions</a>. Typically it is:</p>
<p>Either:</p>
<div class="highlight"><pre><span></span> $ brew install pgcli # Only on OS X
</pre></div>
<p>or </p>
<div class="highlight"><pre><span></span> $ pip install pgcli # Python package installation
</pre></div>
<p>Then install the heroku plugin</p>
<div class="highlight"><pre><span></span><span class="w"> </span><span class="err">$</span><span class="w"> </span><span class="n">heroku</span><span class="w"> </span><span class="nl">plugins</span><span class="p">:</span><span class="n">install</span><span class="w"> </span><span class="n">git</span><span class="nv">@github</span><span class="p">.</span><span class="nl">com</span><span class="p">:</span><span class="n">chrisanderton</span><span class="o">/</span><span class="n">heroku</span><span class="o">-</span><span class="n">pg</span><span class="o">-</span><span class="n">pgcli</span><span class="p">.</span><span class="n">git</span>
</pre></div>
<h3>Usage</h3>
<p>Run this from within a Heroku app directory</p>
<div class="highlight"><pre><span></span> $ heroku pg:pgcli
</pre></div>
<p>That will launch pgcli with the appropriate database credentials, taken from heroku DATABASE_URL for that application.</p>
<p>That's it. </p>
<h3>Credit</h3>
<p>Thanks to <a href="https://github.com/chrisanderton">Chris Anderton</a> for creating this heroku plugin. </p>A Better CLI for MySQL - Kickstarter Success2015-05-05T00:00:00-07:002015-05-05T00:00:00-07:00Amjithtag:www.pgcli.com,2015-05-05:mysql-cli-kickstarter-success.html<p>About a month ago, I started a new <a href="https://www.kickstarter.com/projects/1839007321/mysql-cli">kickstarter
project</a> to create a
MySQL client that can do auto-completion and syntax highlighting.</p>
<p>An equivalent of <a href="http://pgcli.com">pgcli</a> for the MySQL database.</p>
<p>Today I'm happy to announce that the kickstarter has reached it's <a href="https://www.kickstarter.com/projects/1839007321/mysql-cli">goal</a> and it's
strongly marching towards the stretch goal. </p>
<p>Thank you everyone for pitching in and helping me reach the goal.</p>
<p>This is the last day to back the project, if you'd like to get early access to the app.</p>
<p>I would like to extend my thanks to the first Gold sponsor
<a href="https://jweiland.net/">jweiland.net</a>. The boost from their generous
contribution gave me the confidence that we'll reach the goal.</p>
<p>Thanks to all the supporters who spread the word and pitched in. I appreciate it very much.</p>Introducing the core devs of pgcli2015-04-28T00:00:00-07:002015-04-28T00:00:00-07:00Amjithtag:www.pgcli.com,2015-04-28:core-1.html<p>It is my pleasure to announce the core devs of the pgcli project. </p>
<h1><a href="https://github.com/drocco007">Daniel Rocco</a></h1>
<p>Daniel made pgcli handle JSON, bytea, and large decimal values correctly. He improved the completion matching by adding sub-string matching. His creative solution to reducing completion noise is extremely useful. He also added numerous tests to cover a lot more branches in the code path.</p>
<p>Daniel loves Python and is a frequent speaker at PyAtl on introductory topics, testing, design, and shiny things; he loves seeing the spark of wonder and delight in people's eyes when someone shares a novel, surprising, or beautiful idea. He lives in Atlanta with a microbiologist and four aspiring rocketeers.</p>
<h1><a href="https://github.com/darikg">Darik Gamble</a></h1>
<p>Darik is a prolific committer who is credited for numerous feature additions in pgcli. He single handedly made pgcli <a href="https://www.pgcli.com/embedding-pgcli-in-ipython.html">embeddable inside IPython</a>, which still blows my mind. He made pgcli behave more like psql, added schema support to completion (this is huge), view name completion, auto-escaping of tables/columns and numerous special command (<code>\dv, \df, \dn</code>). Darik's feature additions are creative and well-thought out.</p>
<h1><a href="https://github.com/j-bennet">Iryna Cherniavska</a></h1>
<p>Iryna is one of the earliest contributors to the project. She is credited for adding a rich set of tests to the completion engine and brought in mocks to test some of the tricky bits. She also added many of the special commands such as <code>\dv, \di, \e</code> and contributed to the <a href="https://github.com/dbcli/pgcli/blob/master/DEVELOP.rst#adding-postgresql-special-meta-commands">developer document</a>. Favorite editor: PyCharm (yes, spoiled by JetBrains products). Favorite feature of pgcli: syntax highlighting. Random tidbit of information: started her acquaintance with the WWW through FIDOnet.</p>
<h1><a href="https://github.com/macobo">Karl-Aksel Puulmann</a></h1>
<p>Karl fixed some of the critical issues early on in the project, which paved the way to get this project widely accepted. Karl made pgcli handle unicode. He created robust testing fixtures to make it easy for contributors to add tests. Thanks to Karl, it is now possible to cancel queries that are in flight using Ctrl-C.</p>
<p>He also created an experimental <a href="https://github.com/macobo/sqlcomplete">SQL completion engine</a> that can provide accurate suggestions based on actual grammar instead of the heuristics. It is still in the experimental phase and we hope to use it in pgcli in the future.</p>
<h1>Thanks</h1>
<p>I'm extremely grateful to all of the core devs for their contributions so far and their willingness to play the role of core dev in the project. I'm quite lucky to be working with such amazing devs.</p>Django Integration of pgcli2015-04-25T00:00:00-07:002015-04-25T00:00:00-07:00Amjithtag:www.pgcli.com,2015-04-25:django-pgcli.html<p>Django web framework has a rich set of management commands. One of them is <code>python manage.py dbshell</code>. This will launch the default database repl and connect to the appropriate database for the web application.</p>
<p>Now it is possible to launch <code>pgcli</code> instead of the default <code>psql</code> for Postgres by installing the <a href="https://github.com/ashchristopher/django-pgcli">django-pgcli</a> python package.</p>
<h3>Installation</h3>
<p>Install it using <code>pip</code>:</p>
<div class="highlight"><pre><span></span> $ pip install django-pgcli
</pre></div>
<p>Then add <code>django_pgcli</code> to the list of INSTALLED_APPS in your project's settings.py.</p>
<div class="highlight"><pre><span></span> INSTALLED_APPS = [
...,
'django_pgcli',
]
</pre></div>
<h3>Usage</h3>
<p>Launch the <code>dbshell</code> through the management command. </p>
<div class="highlight"><pre><span></span> $ python manage.py dbshell
</pre></div>
<p>That will launch pgcli with the appropriate database credentials. </p>
<p>That's it. </p>
<h3>Credit</h3>
<p>My personal thanks to <a href="https://github.com/ashchristopher/">Ash Christopher</a> for taking the initiative to create this package. It was a well requested feature of pgcli, you just made a lot of people happy. </p>dbcli - a new github org2015-04-18T00:00:00-07:002015-04-18T00:00:00-07:00Amjithtag:www.pgcli.com,2015-04-18:dbcli.html<p>I'm officially moving the <a href="https://github.com/dbcli/pgcli">pgcli</a> project into
the <a href="https://github.com/dbcli">dbcli</a> org in github.</p>
<h2>Why?</h2>
<ul>
<li>pgcli is a community project now and having an organization helps solidify that.</li>
<li>More peope will now have write access to the repo. Watch for the announcement of the core-devs of pgcli.</li>
<li>It's a better home for similar projects in the future, such as mysql-cli, sqlite-cli etc.</li>
<li>pgcli has a few subpackages that should be individual projects (sqlcompelter.py, pgspecial.py etc) so it can be repurposed in other projects. They will be broken out into separate repos and pulled into pgcli as dependencies in the future.</li>
</ul>
<h2>How does it affect users?</h2>
<ul>
<li>The changes to the code base will be peer reviewed by more than one person. Result: Improved stability, Less bugs.</li>
<li>Quicker turn around on bug reports and feature requests, since more people will feel the ownership towards the project instead of that one guy.</li>
</ul>Screencast: pgcli basics2015-04-06T00:00:00-07:002015-04-06T00:00:00-07:00Amjithtag:www.pgcli.com,2015-04-06:pgcli-basics-screencast.html<p>I created a screencast to showcase some of the basic features of <a href="http://pgcli.com">pgcli</a>.</p>
<p>pgcli is a client for postgres that can do autocompletion and syntax highlighting.</p>
<p>This video covers:</p>
<ul>
<li>Installation</li>
<li>Launching pgcli</li>
<li>Switching databases</li>
<li>Basic auto-completion for SELECT, CREATE, INSERT and JOIN statements.</li>
<li>Expanded output</li>
<li>Multi-line mode </li>
</ul>
<p>Video:</p>
<iframe src="https://player.vimeo.com/video/124125257" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<p>If there is enough interest, I'll produce a few more screencasts of other
features available in <a href="http://pgcli.com">pgcli</a>. Please reach me via
<a href="https://twitter.com/amjithr">twitter</a> or <a href="mailto:amjith.r@gmail.com">email</a> to
provide feedback.</p>
<p>I'm also working on a new project called <a href="http://mysql-cli.com">mysql-cli</a>.
I've launched a
<a href="https://www.kickstarter.com/projects/1839007321/mysql-cli">kickstarter</a>
campaign for that project and I'd like your support. Please forward the
<a href="http://mysql-cli.com">project</a> to your friends and coworkers.</p>Kickstarter: mysql-cli2015-04-05T00:00:00-07:002015-04-05T00:00:00-07:00Amjithtag:www.pgcli.com,2015-04-05:mysql-cli-kickstarter.html<p>I'm starting a project called <a href="http://mysql-cli.com">mysql-cli</a>.</p>
<p><a href="http://mysql-cli.com">mysql-cli</a> will be a command line client for MySQL, with
auto-completion and syntax highlighting. An equivalent of
<a href="http://pgcli.com">pgcli</a> for MySQL database.</p>
<p>I'm raising funds for the project through <a href="http://mysql-cli.com">kickstarter</a>.
The goal is to compensate for the development time and resources (hosting,
testing infrastructure, etc) as well as motivate me to keep going.</p>
<iframe src="https://player.vimeo.com/video/124121398" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<p>When I launched pgcli earlier this year I had high hopes for it. I anticipated
that I might reach a hundred users and even a couple of contributions. I
announced it on
<a href="https://twitter.com/amjithr/status/552491986255896576">Twitter</a> and HackerNews
and it took about an hour to reach 100 stars. By the second day it was a top
trending repo in all of Github. Right now it is hovering near the 1600 mark for
the number of stars, with more than 70 pull requests (merged). </p>
<p>During the first week of launch, I slept about 3 hours each night because the
pull requests and issues came flooding. I made a personal resolve to answer
every communique within 24 hours. This meant answering personal emails,
responding to issues filed, reviewing pull requests etc. I
<a href="http://pgcli.com/about">vowed</a> to be polite and respectful to my users and
contributors and I've had nothing but pleasant interactions with them. </p>
<p>My hope is to provide the same level of dedication and support to
<a href="http://mysql-cli.com">mysql-cli</a>. There is definitely a need for it, since
every time I use the default MySQL client I want to scream obscenities at my
computer and I can't be the only one. :)</p>
<p>The plan is to launch <a href="http://mysql-cli.com">mysql-cli</a> in July 2015 and open
up the repo to public. If you want to get involved sooner, please back the
project on <a href="http://mysql-cli.com">kickstarter</a> and I'll add you to the early access list. :)</p>Release v0.16.32015-04-02T00:00:00-07:002015-04-02T00:00:00-07:00Amjithtag:www.pgcli.com,2015-04-02:v0.16.3.html<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can install this version by:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<p>Check <a class="reference external" href="https://www.pgcli.com/install">detailed instructions</a> if you're having difficulty.</p>
<p>This is a minor bug-fix release that fixes the syntax-highlighting of various
Postgres specific keywords and adds the ability to surface messages thrown by
sql exceptions.</p>
<div class="section" id="bug-fixes">
<h2>Bug Fixes:</h2>
<ul class="simple">
<li>Add more SQL keywords for auto-complete suggestion.</li>
<li>Messages raised as part of stored procedures are no longer ignored.</li>
<li>Use postgres flavored syntax highlighting instead of generic ANSI SQL.</li>
</ul>
</div>
Release v0.16.22015-03-22T00:00:00-07:002015-03-22T00:00:00-07:00Amjithtag:www.pgcli.com,2015-03-22:v0.16.2.html<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can install this version by:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<p>Check <a class="reference external" href="https://www.pgcli.com/install">detailed instructions</a> if you're having difficulty.</p>
<p>This is a bug-fix release that improves auto-completion and formatting of large
numbers in the output.</p>
<div class="section" id="bug-fixes">
<h2>Bug Fixes:</h2>
<ul class="simple">
<li>Fix a bug where the schema qualifier was ignored by the auto-completion.
As a result the suggestions for tables vs functions are cleaner. (Thanks: <a class="reference external" href="https://github.com/darikg">darikg</a>)</li>
<li>Remove scientific notation when formatting large numbers. (Thanks: <a class="reference external" href="https://github.com/drocco007">Daniel Rocco</a>)</li>
<li>Add the FUNCTION keyword to auto-completion.</li>
<li>Display NULL values as <null> instead of empty strings.</li>
<li>Fix the completion refresh when <tt class="docutils literal">\connect</tt> is executed.</li>
</ul>
</div>
Release v0.16.12015-03-03T00:00:00-08:002015-03-03T00:00:00-08:00Amjithtag:www.pgcli.com,2015-03-03:v0.16.1.html<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can install this version by:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<p>Check <a class="reference external" href="https://www.pgcli.com/install">detailed instructions</a> if you're having difficulty.</p>
<p>This is a minor bug-fix release that fixes unicode issues with hstore.</p>
<div class="section" id="bug-fixes">
<h2>Bug Fixes:</h2>
<ul class="simple">
<li>Fix unicode issues with hstore. Previously the unicode type caster for hstore
was done via a hardcoded oid. This is wrong since the oid for hstore will
vary between different databases. Now the oid is determined at the time of
connection and a type caster is registered accordingly.</li>
<li>Fix an error when database is changed using \c.</li>
</ul>
</div>
Release v0.16.02015-03-01T00:00:00-08:002015-03-01T00:00:00-08:00Amjithtag:www.pgcli.com,2015-03-01:v0.16.0.html<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can install this version by:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<p>Check <a class="reference external" href="https://www.pgcli.com/install">detailed instructions</a> if you're having difficulty.</p>
<p>This release adds Vi-keybindings, improvements to special commands (new
additions ds and df) and fix a lot of annoyances. Many thanks to the
contributors.</p>
<div class="section" id="features">
<h2>Features:</h2>
<ul class="simple">
<li>Add ds special command to show sequences.</li>
<li>Add Vi mode for keybindings. This can be enabled by adding 'vi = True' in ~/.pgclirc. (Thanks: <a class="reference external" href="https://github.com/jayzeng">Jay Zeng</a>)</li>
<li>Add a -v/--version flag to pgcli.</li>
<li>Add completion for TEMPLATE keyword and smart-completion for
'CREATE DATABASE blah WITH TEMPLATE <tab>'. (Thanks: <a class="reference external" href="https://github.com/drocco007">Daniel Rocco</a>)</li>
<li>Add custom decoders to json/jsonb to emulate the behavior of psql. This
removes the unicode prefix (eg: u'Éowyn') in the output. (Thanks: <a class="reference external" href="https://github.com/drocco007">Daniel Rocco</a>)</li>
<li>Add df special command to show functions. (Thanks: <a class="reference external" href="https://github.com/darikg">darikg</a>)</li>
<li>Make suggestions for special commands smarter. eg: dn - only suggests schemas. (Thanks: <a class="reference external" href="https://github.com/darikg">darikg</a>)</li>
<li>Print out the version and other meta info about pgcli at startup.</li>
</ul>
</div>
<div class="section" id="bug-fixes">
<h2>Bug Fixes:</h2>
<ul class="simple">
<li>Fix a rare crash caused by adding new schemas to a database. (Thanks: <a class="reference external" href="https://github.com/darikg">darikg</a>)</li>
<li>Make dt command honor the explicit schema specified in the arg. (Thanks: <a class="reference external" href="https://github.com/darikg">darikg</a>)</li>
<li>Print BIGSERIAL type as Integer instead of Float.</li>
<li>Show completions for special commands at the beginning of a statement. (Thanks: <a class="reference external" href="https://github.com/drocco007">Daniel Rocco</a>)</li>
<li>Allow special commands to work in a multi-statement case where multiple sql
statements are separated by semi-colon in the same line.</li>
</ul>
</div>
Release v0.15.X2015-02-08T00:00:00-08:002015-02-08T00:00:00-08:00Amjithtag:www.pgcli.com,2015-02-08:v0.15.X.html<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can install this version by:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<p>Check <a class="reference external" href="https://www.pgcli.com/install">detailed instructions</a> if you're having difficulty.</p>
<p>This version adds more color schemes to the syntax highlighting. An attempt to
add support for PyPy by using psycopg2cffi failed. Python 3 support for
psycopg2cffi was only added recently and there are still a few corner cases
where it fails.</p>
<div class="section" id="features">
<h2>Features:</h2>
<ul class="simple">
<li>Add syntax color styles to config. Try <tt class="docutils literal">syntax_style=fruity</tt>. Availble themes
are <cite>manni</cite>, <cite>igor</cite>, <cite>xcode</cite>, <cite>vim</cite>, <cite>autumn</cite>, <cite>vs</cite>, <cite>rrt</cite>, <cite>native</cite>,
<cite>perldoc</cite>, <cite>borland</cite>, <cite>tango</cite>, <cite>emacs</cite>, <cite>friendly</cite>, <cite>monokai</cite>,
<cite>paraiso-dark</cite>, <cite>colorful</cite>, <cite>murphy</cite>, <cite>bw</cite>, <cite>pastie</cite>, <cite>paraiso-light</cite>,
<cite>trac</cite>, <cite>default</cite>, <cite>fruity</cite>.</li>
<li>Add auto-completion for COPY statements.</li>
</ul>
</div>
<div class="section" id="bug-fixes">
<h2>Bug Fixes:</h2>
<ul class="simple">
<li>Treat boolean values as strings instead of ints.</li>
<li>Make di, dv and dt to be schema aware. (Thanks: <a class="reference external" href="https://github.com/darikg">darikg</a>)</li>
<li>Make column name display unicode compatible.</li>
<li>Override the LESS options completely instead of appending to it.</li>
</ul>
</div>
Embedding pgcli in IPython2015-02-03T00:00:00-08:002015-02-03T00:00:00-08:00Amjithtag:www.pgcli.com,2015-02-03:embedding-pgcli-in-ipython.html<p><a href="http://ipython.org/">IPython</a> is an interactive shell for Python that is
well-suited to do data-analysis. It has integration for plotting, data-analysis
libraries, parallel computing etc. </p>
<p><a href="https://github.com/catherinedevlin/ipython-sql">IPython-sql</a> is an IPython
extension that provides an easy way to load data from a database into the
ipython environment to do the data-analysis. Here's an example. </p>
<div class="highlight"><pre><span></span><span class="n">In</span> <span class="p">[</span><span class="mi">1</span><span class="p">]:</span> <span class="o">%</span><span class="n">load_ext</span> <span class="n">sql</span>
<span class="n">In</span> <span class="p">[</span><span class="mi">2</span><span class="p">]:</span> <span class="o">%</span><span class="n">sql</span> <span class="n">postgres</span><span class="p">:</span><span class="o">//</span><span class="n">localhost</span><span class="p">:</span><span class="mi">5432</span><span class="o">/</span><span class="n">misago_testforum</span>
<span class="n">Out</span><span class="p">[</span><span class="mi">2</span><span class="p">]:</span> <span class="sa">u</span><span class="s1">'Connected: None@misago_testforum'</span>
<span class="n">In</span> <span class="p">[</span><span class="mi">3</span><span class="p">]:</span> <span class="o">%</span><span class="n">sql</span> <span class="n">select</span> <span class="o">*</span> <span class="n">FROM</span> <span class="n">django_migrations</span> <span class="n">where</span> <span class="nb">id</span> <span class="o">=</span> <span class="mi">5</span>
<span class="mi">1</span> <span class="n">rows</span> <span class="n">affected</span><span class="o">.</span>
<span class="n">Out</span><span class="p">[</span><span class="mi">3</span><span class="p">]:</span> <span class="p">[(</span><span class="mi">5</span><span class="p">,</span> <span class="sa">u</span><span class="s1">'admin'</span><span class="p">,</span> <span class="sa">u</span><span class="s1">'0001_initial'</span><span class="p">,</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="p">(</span><span class="mi">2014</span><span class="p">,</span> <span class="mi">11</span><span class="p">,</span> <span class="mi">24</span><span class="p">,</span> <span class="mi">14</span><span class="p">,</span> <span class="mi">26</span><span class="p">,</span> <span class="mi">43</span><span class="p">,</span> <span class="mi">625938</span><span class="p">,</span>
<span class="n">tzinfo</span><span class="o">=</span><span class="n">psycopg2</span><span class="o">.</span><span class="n">tz</span><span class="o">.</span><span class="n">FixedOffsetTimezone</span><span class="p">(</span><span class="n">offset</span><span class="o">=-</span><span class="mi">480</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="kc">None</span><span class="p">)))]</span>
</pre></div>
<p>We can now manipulate the data that was imported from the database. </p>
<p>The trouble is ipython doesn't have the ability to do auto-completion for the
sql statements. So it's a bit hard to iterate on the sql statement to get the
right data.</p>
<p><a href="http://pgcli.com">Pgcli</a> on the other hand is a postgres client that provides
auto-completion for SQL statements.</p>
<p>Thanks to <a href="https://github.com/darikg">Darik Gamble</a> we can now embed pgcli
directly inside the ipython console. We can iterate over the sql statements in
pgcli with the comfort of auto-completion and preview the results before
loading it into IPython. When we're satisfied with the results, all we do is
quit pgcli, and we'll drop back to IPython loaded with the results from the
last query.</p>
<p>Let's see how that works. </p>
<div class="highlight"><pre><span></span><span class="c1"># IPython Console</span>
<span class="n">In</span> <span class="p">[</span><span class="mi">2</span><span class="p">]:</span> <span class="o">%</span><span class="n">load_ext</span> <span class="n">pgcli</span><span class="o">.</span><span class="n">magic</span>
<span class="n">In</span> <span class="p">[</span><span class="mi">3</span><span class="p">]:</span> <span class="o">%</span><span class="n">pgcli</span> <span class="n">postgres</span><span class="p">:</span><span class="o">//</span><span class="n">localhost</span><span class="p">:</span><span class="mi">5432</span><span class="o">/</span><span class="n">misago_testforum</span>
<span class="n">Connected</span><span class="p">:</span> <span class="kc">None</span><span class="nd">@misago_testforum</span>
<span class="c1"># pgcli repl</span>
<span class="n">misago_testforum</span><span class="o">></span> <span class="n">SELECT</span> <span class="o">*</span> <span class="n">FROM</span> <span class="n">django_migrations</span> <span class="n">WHERE</span> <span class="nb">id</span> <span class="o">=</span> <span class="mi">5</span>
<span class="o">+------+-------+--------------+----------------------------------+</span>
<span class="o">|</span> <span class="nb">id</span> <span class="o">|</span> <span class="n">app</span> <span class="o">|</span> <span class="n">name</span> <span class="o">|</span> <span class="n">applied</span> <span class="o">|</span>
<span class="o">|------+-------+--------------+----------------------------------|</span>
<span class="o">|</span> <span class="mi">5</span> <span class="o">|</span> <span class="n">admin</span> <span class="o">|</span> <span class="mi">0001</span><span class="n">_initial</span> <span class="o">|</span> <span class="mi">2014</span><span class="o">-</span><span class="mi">11</span><span class="o">-</span><span class="mi">24</span> <span class="mi">14</span><span class="p">:</span><span class="mi">26</span><span class="p">:</span><span class="mf">43.625938</span><span class="o">-</span><span class="mi">08</span><span class="p">:</span><span class="mi">00</span> <span class="o">|</span>
<span class="o">+------+-------+--------------+----------------------------------+</span>
<span class="n">SELECT</span> <span class="mi">1</span>
<span class="n">misago_testforum</span><span class="o">></span> <span class="n">exit</span>
<span class="n">GoodBye</span><span class="err">!</span>
<span class="mi">1</span> <span class="n">rows</span> <span class="n">affected</span><span class="o">.</span>
<span class="c1"># Back on IPython Console. </span>
<span class="n">Out</span><span class="p">[</span><span class="mi">3</span><span class="p">]:</span> <span class="p">[(</span><span class="mi">5</span><span class="p">,</span> <span class="sa">u</span><span class="s1">'admin'</span><span class="p">,</span> <span class="sa">u</span><span class="s1">'0001_initial'</span><span class="p">,</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="p">(</span><span class="mi">2014</span><span class="p">,</span> <span class="mi">11</span><span class="p">,</span> <span class="mi">24</span><span class="p">,</span> <span class="mi">14</span><span class="p">,</span> <span class="mi">26</span><span class="p">,</span> <span class="mi">43</span><span class="p">,</span> <span class="mi">625938</span><span class="p">,</span>
<span class="n">tzinfo</span><span class="o">=</span><span class="n">psycopg2</span><span class="o">.</span><span class="n">tz</span><span class="o">.</span><span class="n">FixedOffsetTimezone</span><span class="p">(</span><span class="n">offset</span><span class="o">=-</span><span class="mi">480</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="kc">None</span><span class="p">)))]</span>
<span class="n">In</span> <span class="p">[</span><span class="mi">4</span><span class="p">]:</span> <span class="n">_</span>
<span class="n">Out</span><span class="p">[</span><span class="mi">4</span><span class="p">]:</span> <span class="p">[(</span><span class="mi">5</span><span class="p">,</span> <span class="sa">u</span><span class="s1">'admin'</span><span class="p">,</span> <span class="sa">u</span><span class="s1">'0001_initial'</span><span class="p">,</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="p">(</span><span class="mi">2014</span><span class="p">,</span> <span class="mi">11</span><span class="p">,</span> <span class="mi">24</span><span class="p">,</span> <span class="mi">14</span><span class="p">,</span> <span class="mi">26</span><span class="p">,</span> <span class="mi">43</span><span class="p">,</span> <span class="mi">625938</span><span class="p">,</span>
<span class="n">tzinfo</span><span class="o">=</span><span class="n">psycopg2</span><span class="o">.</span><span class="n">tz</span><span class="o">.</span><span class="n">FixedOffsetTimezone</span><span class="p">(</span><span class="n">offset</span><span class="o">=-</span><span class="mi">480</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="kc">None</span><span class="p">)))]</span>
</pre></div>
<p>That's it. So if you're using IPython for data-analysis and have your data
residing in a Database, you can easily import it in using ipython-sql and
pgcli.</p>
<h3>Installation</h3>
<p>Install pgcli and ipython-sql and you're all set to go. </p>
<div class="highlight"><pre><span></span>$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>pgcli<span class="w"> </span>ipython<span class="w"> </span>ipython-sql
</pre></div>
<p>If you have feedback, please reach out via
<a href="https://twitter.com/amjithr">twitter</a> or
<a href="https://github.com/amjith/pgcli/issues">github</a>. Thank you!</p>Release v0.14.02015-01-31T00:00:00-08:002015-01-31T00:00:00-08:00Amjithtag:www.pgcli.com,2015-01-31:v0.14.0.html<p>A huge release that adds completion support for schemas.</p>
<p><tt class="docutils literal">Pgcli</tt> is a command line interface for Postgres database that does
auto-completion and syntax highlighting. You can upgrade using:</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<p>Check <a class="reference external" href="https://www.pgcli.com/install">detailed instructions</a> if you're having difficulty.</p>
<div class="section" id="features">
<h2>Features:</h2>
<ul class="simple">
<li>Add alias completion support to ON keyword. (Thanks: <a class="reference external" href="https://github.com/j-bennet">Iryna Cherniavska</a>)</li>
<li>Add LIMIT keyword to completion.</li>
<li>Auto-completion for Postgres schemas. (Thanks: <a class="reference external" href="https://github.com/darikg">darikg</a>)</li>
<li>Better unicode handling for datatypes, dbname and roles.</li>
<li>Add timing command to time the sql commands.
This can be set via config file (~/.pgclirc) using <tt class="docutils literal">timing = True</tt>.</li>
<li>Add different table styles for displaying output.
This can be changed via config file (~/.pgclirc) using <tt class="docutils literal">table_format = fancy_grid</tt>.</li>
<li>Add confirmation before printing results that have more than 1000 rows.</li>
</ul>
</div>
<div class="section" id="bug-fixes">
<h2>Bug Fixes:</h2>
<ul class="simple">
<li>Performance improvements to expanded view display (x).</li>
<li>Cast bytea files to text while displaying. (Thanks: <a class="reference external" href="https://github.com/drocco007">Daniel Rocco</a>)</li>
<li>Added a list of reserved words that should be auto-escaped.</li>
<li>Auto-completion is now case-insensitive.</li>
<li>Fix the broken completion for multiple sql statements. (Thanks: <a class="reference external" href="https://github.com/darikg">darikg</a>)</li>
</ul>
</div>
Release v0.13.02015-01-14T00:00:00-08:002015-01-14T00:00:00-08:00Amjithtag:www.pgcli.com,2015-01-14:v0.13.0.html<p>A small release that gets <tt class="docutils literal">pgcli</tt> closer to being a drop in replacement for
<tt class="docutils literal">psql</tt>.</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<p>Check <a class="reference external" href="https://www.pgcli.com/install">detailed instructions</a> if you're having difficulty.</p>
<div class="section" id="features">
<h2>Features:</h2>
<ul class="simple">
<li>Add -d/--dbname option to the commandline.
eg: pgcli -d database</li>
<li>Add the username as an argument after the database.
eg: pgcli dbname user</li>
</ul>
</div>
<div class="section" id="bug-fixes">
<h2>Bug Fixes:</h2>
<ul class="simple">
<li>Fix the crash when \c fails.</li>
<li>Fix the error thrown by \d when triggers are present.</li>
<li>Fix broken behavior on \?. (Thanks: <a class="reference external" href="https://github.com/darikg">darikg</a>)</li>
</ul>
</div>
One week after launch2015-01-13T00:00:00-08:002015-01-13T00:00:00-08:00Amjithtag:www.pgcli.com,2015-01-13:post-launch.html<p>Pgcli was <a class="reference external" href="https://www.pgcli.com/launch.html">launched</a> approximately one week ago.</p>
<p>It was an extremely successful launch, beyond any of my wildest imaginations.</p>
<div class="section" id="obligatory-vanity-metrics">
<h2>Obligatory Vanity Metrics:</h2>
<ul class="simple">
<li>Google Analytics: 21K views and 12.2K users.</li>
<li><a class="reference external" href="https://twitter.com/amjithr/status/552491986255896576">Twitter</a>: 70 retweets, 68 favs.</li>
<li><a class="reference external" href="https://github.com/amjith/pgcli">Github</a>: 1,230 stars, 45 forks, 28 watchers.</li>
<li><a class="reference external" href="https://news.ycombinator.com/item?id=8844723">HackerNews</a>: 227 points</li>
</ul>
<p>Enough with the vanity.</p>
</div>
<div class="section" id="highlights">
<h2>Highlights</h2>
<p>Here are some metrics that I'm personally proud to present. Since launch.</p>
<ul class="simple">
<li>Pull Requests Opened: 40</li>
<li>Pull Requests Merged: 38</li>
<li>Issues Opened: 62</li>
<li>Issues Closed: 34</li>
</ul>
<p>Let's break it down a little bit more.</p>
<ul class="simple">
<li><strong>Number of Releases: 5</strong></li>
<li>Number of Features Added: 11</li>
<li>Features added by community: 11</li>
<li>Bugs fixed by community: 10</li>
<li>Features added by author: 1</li>
<li>Bugs fixed by author: 3</li>
</ul>
<p>I have not included the numerous typo fixes contributed by the community. (yes,
I'm a little bit ashamed by how many mistakes I make when I type).</p>
<p>I'm flattered by how many people pitched in to help fix bugs and add features.
At one point I found a bug and filed an issue to keep track of it and 5 minutes
later I got a pull request to fix it. I was completely floored by the
enthusiasm shown by the contributors.</p>
<p>I had an internal goal of responding to Pull Requests, Issues and emails within
24 hours. Even if I couldn't fix the issue or implement a requested feature, I
wanted to acknowledge it and give feedback about whether I'll do it or not. I
was able to keep that goal, as you'll see every <a class="reference external" href="https://github.com/amjith/pgcli/issues">issue</a> in Github right now has
a comment from me (except for the ones I filed myself).</p>
<p>I was also able to keep up the <a class="reference external" href="http://pgcli.com/about">responsibility</a> I outlined the about page.</p>
<p>Phew! What a week. I feel invigorated and refueled. Looking forward to working
through the issues and feature requests.</p>
</div>
Release v0.12.02015-01-13T00:00:00-08:002015-01-13T00:00:00-08:00Amjithtag:www.pgcli.com,2015-01-13:v0.12.0.html<p>A feature packed <a class="reference external" href="https://pypi.python.org/pypi/pgcli/0.12.0">release</a>. You can install/upgrade using</p>
<pre class="code bash literal-block">
$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pgcli
</pre>
<div class="section" id="section-1">
<h2>0.12.0</h2>
<div class="section" id="features">
<h3>Features:</h3>
<ul class="simple">
<li>Upgrade to prompt_toolkit version 0.26 (Thanks:<a class="reference external" href="https://github.com/macobo">Karl-Aksel Puulmann</a>)<ul>
<li>Adds Ctrl-left/right to move the cursor one word left/right respectively.</li>
<li>Internal API changes.</li>
</ul>
</li>
<li>IPython integration through <a class="reference external" href="https://github.com/catherinedevlin/ipython-sql">ipython-sql</a> (Thanks:<a class="reference external" href="https://github.com/darikg">darikg</a>)<ul>
<li>Add an ipython magic extension to embed pgcli inside ipython. (more details to follow)</li>
<li>Results from a pgcli query are sent back to ipython.</li>
</ul>
</li>
<li>Multiple sql statments in the same line separated by semi-colon. (Thanks:<a class="reference external" href="https://github.com/macobo">Karl-Aksel Puulmann</a>)</li>
</ul>
</div>
<div class="section" id="bug-fixes">
<h3>Bug Fixes:</h3>
<ul class="simple">
<li>Fix 'message' attribute not found exception in Python 3. (Thanks:<a class="reference external" href="https://github.com/GMLudo">Ludovic Gasc</a> )</li>
<li>Use the database username as the database name instead of defaulting to OS username. (Thanks:<a class="reference external" href="https://github.com/fpietka">François Pietka</a>)</li>
<li>Auto-completion for auto-escaped column/table names.</li>
<li>Fix i-reverse-search to work in prompt_toolkit version 0.26.</li>
</ul>
</div>
</div>
Launching pgcli2015-01-06T00:00:00-08:002015-01-06T00:00:00-08:00Amjithtag:www.pgcli.com,2015-01-06:launch.html<p><a class="reference external" href="http://pgcli.com">Pgcli</a> was launched today on <a class="reference external" href="https://news.ycombinator.com/item?id=8844723">HackerNews</a> and <a class="reference external" href="http://www.reddit.com/r/Python/comments/2riuj0/pgcli_a_cli_for_postgres_with_autocompletion_and/">Reddit</a>.</p>
<p><a class="reference external" href="http://pgcli.com">Pgcli</a> is a command line interface for Postgres database that can do
auto-completion and syntax-highlighting among other things. A list of <a class="reference external" href="http://pgcli.com/features">features</a>
with screenshots are available on the <a class="reference external" href="http://pgcli.com/features">features</a> page.</p>
<p>Source is available on github: <a class="reference external" href="http://github.com/amjith/pgcli">http://github.com/amjith/pgcli</a></p>