SQLite Import, Export, and Backup Cheatsheet/Import CSV with mode and separator

Set shell parsing options before import.

Section: Move data in and out

Import CSV with mode and separator

text
text
.mode csv
.import ./users.csv users
Explanation

A reliable shell pattern when loading CSV into an existing table.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Move data in and out
Export a query result to CSV
Write selected rows to a CSV file.
OpenIn sheettextsame section
Dump one table
Export only selected table schema and data.
OpenIn sheettextsame section
Load data from an SQL file
Execute inserts and DDL from a seed script.
OpenIn sheetbashsame section
Use the shell backup command
Create a backup from inside sqlite3.
OpenIn sheettext1 tag match
Create a compact backup with VACUUM INTO
Write a fresh copy of the database to a new file.
Run VACUUM
Rebuild the database file and reclaim free space.