SQLite
SQLite is a database engine written in the C programming language. It is not a standalone app; rather, it is a library that software developers embed in their apps. As such, it belongs to the family of embedded databases. It is the most widely deployed database engine, as it is used by several of the top web browsers, operating systems, mobile phones, and other embedded systems.
See Sqlite on Wikipedia.
Getting started
Brap is pre-configured with SQLite.
To check the version of SQLite, run:
sqlite3 --version
To create or open an existing SQLite database file, run:
sqlite3 myblog.db
To create a table, run:
CREATE table posts(id integer NOT NULL, title text NOT NULL);
To insert values into a table, run:
INSERT INTO posts VALUES (1, "This is my first blog");
INSERT INTO posts VALUES (2, "This is my second blog");
INSERT INTO posts VALUES (3, "This is my third blog");
To read the values of a table, run:
SELECT * FROM posts;
To exit the SQLite prompt, run .quit
or press CTRL + D
:
.quit
Screenshot: SQLite running in VS Code terminal
Keywords
- sqlite
- sqlite3
- sql
- database
- db
- data