~/Blog

Brandon Rozek

Photo of Brandon Rozek

PhD Student @ RPI studying Automated Reasoning in AI and Linux Enthusiast.

Dbcli

Published on

Updated on

The DBLCI project creates command line database clients with auto-completion and syntax highlighting. These clients are often nicer to work with than the one a database comes with. In this post we’re going to demo the LiteCLI client.

First to install,

pip install litecli

I created a sqlite database and populated it with the following code

.open test.db

CREATE TABLE Users (
  UserID INTEGER PRIMARY KEY,
  firstName TEXT NOT NULL,
  lastName TEXT NOT NULL
);

INSERT INTO Users (firstName, lastName) VALUES ("Pearl", "Perez");
INSERT INTO Users (firstName, lastName) VALUES ("Derrick", "Norton");
INSERT INTO Users (firstName, lastName) VALUES ("Joan", "Daniels");
INSERT INTO Users (firstName, lastName) VALUES ("Marian", "Lane");
INSERT INTO Users (firstName, lastName) VALUES ("Roland", "Gregory");
INSERT INTO Users (firstName, lastName) VALUES ("Charlene", "Baldwin");
INSERT INTO Users (firstName, lastName) VALUES ("Lester", "Kennedy");
INSERT INTO Users (firstName, lastName) VALUES ("Dan", "Vasquez");
INSERT INTO Users (firstName, lastName) VALUES ("Genevieve", "Dean");
INSERT INTO Users (firstName, lastName) VALUES ("Sue", "Bennett");

Now let’s open it up using litecli and show the syntax highlighting.

image-20200229185045757

Reply via Email Buy me a Coffee
Was this useful? Feel free to share: Hacker News Reddit Twitter