SQLite Installation Guide
This guide provides all the key information and getting-started instructions after a successful SQLite installation via DeploySage-CLI.
Getting Started
SQLite is a serverless, file-based database. To use it, you simply need to provide a filename to the sqlite3 command-line tool. If the file doesn't exist, it will be created.
# Create or open a database file named my_database.db
sqlite3 my_database.db
# Inside the SQLite shell:
# Create a new table
CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT);
# Insert some data
INSERT INTO users (name) VALUES ('Alice');
INSERT INTO users (name) VALUES ('Bob');
# Query the data
SELECT * FROM users;
# Exit the shell
.quit
Command-Line Shell
The sqlite3 shell has several useful "dot commands" for managing your database.
# List all tables in the database
.tables
# Show the schema of a specific table
.schema users
# Change the output mode to be more readable
.mode column
.headers on
# Export a table to a CSV file
.output data.csv
SELECT * FROM users;
.output stdout
Development Libraries
This installation includes the sqlite-devel package, which contains the necessary header files (sqlite3.h) and libraries for compiling applications that use SQLite.
| Item | Value |
|---|---|
| Header File | /usr/include/sqlite3.h |
| Library File | /usr/lib64/libsqlite3.so |