
LiteCLI – A user-friendly command-line client for SQLite database - luord
https://www.pgcli.com/launching-litecli.html
======
keybits
Slightly off topic - one of the authors, Amjith Ramanujam who is active here,
gave a great talk at Pycon 2017:
[https://www.youtube.com/watch?v=hJhZhLg3obk](https://www.youtube.com/watch?v=hJhZhLg3obk)

It covers the powerful features of the prompt-toolkit library that is used to
make this client.

~~~
amjith
Thank you for the kind words. It's always nice to hear from happy customers .

------
CGamesPlay
Neat, this is much nicer than the stock sqlite3 CLI client! The pager behavior
is a bit annoying, actually, since if my SELECT has more columns than can fit
on screen, the pager switches to an alternate screen and when I quit, my
results are hidden from me. Is it possible to turn this behavior off?

[append] Off for a specific query, I mean. I think I'd prefer to leave it on
by default.

~~~
blattimwind
Doesn't seem to support sqlite3 dot commands such as
.mode/.separator/.import/.output/.headers... (these are really implemented in
sqlite3 CLI and not part of the sqlite library). These are, at least for me,
among the main reasons to use the CLI in conjunction with SQLite. (The SQLite
CLI is very good for massaging CSV data into the correct shape; as far as I
know there is no canonical file extension for CLI scripts, I use .sqs, and the
CLI has no parameter to run scripts directly, so you have to start the CLI
manually and do .read foo.sqs).

~~~
vram22
>and the CLI has no parameter to run scripts directly, so you have to start
the CLI manually and do .read foo.sqs).

It does work, but only sort of. Just did:

$ sqlite3 -init select_contact.sql test_sqlite.db

\-- Loading resources from select_contact.sql

Alan|Acre|50|Male|100.0

Betty|Smith|20|Female|200.0

Charlie|Copenhagen|30|Male|400.0

Dorothy|Delhi|80|Female|400.0

Edwin|Bombay|40|Male|100.0

Edwin|Pune|55|Female|110.0

SQLite version 3.8.11 2015-07-27 13:49:41

Enter ".help" for usage hints.

sqlite>

where select_contact.sql contains "select * from contact;"

So it can run a script given as a parameter.

But it leaves you in the CLI instead of cleanly exiting. And prints those
extra headers, etc. Not very Unix-philosophy-adherent, it seems.

Edit: formatting

------
purrcat259
Missed opportunity to call it CLite? :)

~~~
amjith
Damn it! :)

~~~
fxfan
Would you consider changing pip to pip3 in your command? Lead the way with
good practice?

~~~
wenc
I'm not sure how that is good practice?

~~~
TheGrassyKnoll
Its a Python3 script, shouldn't it use pip3 ?

    
    
      I installed it with: $ sudo pip3 install litecli
    
      (seemed to work)

~~~
j88439h84
Dont use sudo pip, it can break your system.

------
bhargav
I see that this is based off of pgcli and the link above is from pgcli's blog
page; presumably ownership is same between these two projects. What is the
difference between LiteCLI and pgcli? I could not find it in the blog post nor
the web page

~~~
amjith
DBCLI ([https://www.dbcli.com/](https://www.dbcli.com/)) is an open source org
that made pgcli, mycli, mssql-cli etc.

LiteCLI is part of that org. So you can think of it as a clone of mycli that
happens to work with SQLite.

The code base is largely similar between mycli and litecli. The changes are to
support the SQLite backend and to support the dot commands (like .tables,
.mode etc).

So the feature set should be same.

The DBCLI tools are not created by a single individual (anymore). We have a
team of core devs and the lead maintainer for pgcli, mycli and litecli are all
different people.

------
omeid2
I have been using pgcli itself for many years and it is a fantastic piece of
software. If you're a terminal user that deals with Postgresql, I highly
recommend you try out pgcli!

------
simonw
This is fantastic - really pleasant to use, and a very obvious upgrade to the
default client.

~~~
amjith
Thank you, Simon. That means a lot coming from the author of datasette. I love
your work.

------
starik36
Very cool. I tried it on Windows 8.1 and it works with some issues. For
instance, I downloaded the SQLite sample DB
([http://www.sqlitetutorial.net/sqlite-sample-
database/](http://www.sqlitetutorial.net/sqlite-sample-database/)). For some
tables (albums, artists), doing a select * from table results in :

 _' charmap' codec can't encode character u'\xe3' in position 2052: character
maps to <undefined>_

Feature request: allow for snippet expansion. For instance, when I type 'ssf'
\+ tab, it should expand to Select * From and show the table dropdown.

------
stef25
Looks like nice, will definitely use this.

Without knowing either program very well, how does it compare feature-wise to
"DB Browser for SQLite" (apart from the GUI) ?

------
CraftThatBlock
This is awesome! I use pgcli everyday and love it so much. This is gonna be a
great addition to my SQLite toolbelt!

------
skwb
Personally I like to use ptipython (think a better version of the CLI for
ipython) and SQLAlchemy whenever I'm debugging my SQLite databases. It's
light, can install most places, and has my JEDI autocomplete.

------
punnerud
«Lit»+Tab will now be one of my most used commands on Ubuntu. Thank you!

------
rmetzler
Looks great!

What would be neccessary if someone would like to integrate it with osqueryi?

------
stabbles
Ah, this is very nice! Also a great tool to teach people SQL :)

------
brian_herman__
Awesome I wanted to create something similar when I saw pgcli but it seems you
beat me to the punch!

------
evanwalters
Interesting. I love SQLite and this looks awesome :) Hopefully I'll report
back later with some criticism.

------
sugar_daddy
Awesome! Very clean design :)

------
apatters
Going to start using this every time I work with a sqlite database now!

------
hsnewman
Does this go through the same ridged testing as SQLite?

~~~
amjith
Haha. No.

We have a large set of tests, but the coverage is no where close to the level
that SQLite has.

~~~
blattimwind
AFAIK the CLI has tests but not to the depth and detail the main library is
tested. Makes sense, since the CLI is often not shipped in applications.

------
blumomo
Thanks for building this!

