mirror of
https://github.com/Brandon-Rozek/website.git
synced 2024-11-09 10:40:34 -05:00
New Post
This commit is contained in:
parent
4258447bca
commit
dfbe00a293
2 changed files with 41 additions and 0 deletions
41
content/blog/dbcli.md
Normal file
41
content/blog/dbcli.md
Normal file
|
@ -0,0 +1,41 @@
|
|||
---
|
||||
title: "Dbcli"
|
||||
date: 2020-02-29T18:45:51-05:00
|
||||
draft: false
|
||||
tags: ["python", "database"]
|
||||
---
|
||||
|
||||
The [DBLCI](https://www.dbcli.com/) 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](https://litecli.com/) client.
|
||||
|
||||
First to install,
|
||||
|
||||
```bash
|
||||
pip install litecli
|
||||
```
|
||||
|
||||
I created a sqlite database and populated it with the following code
|
||||
|
||||
```sqlite
|
||||
.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](/files/images/20200229185045757.png)
|
BIN
static/files/images/20200229185045757.png
Normal file
BIN
static/files/images/20200229185045757.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
Loading…
Reference in a new issue