Dot Commands
5 methodssqlite3 shell commands prefixed with a dot.
.open [file]Closes the current database and opens the given file; ':memory:' for an in-memory database.
Parameters
| Name | Type | Description |
|---|---|---|
| file | string | Database file path or ':memory:'. |
Returns
void
Example
sqlite
.open ./app.db.dump [tbl]Renders the entire database (or a single table) as SQL text suitable for backup or migration.
Parameters
| Name | Type | Description |
|---|---|---|
| tbl | string | Optional table name to dump. |
Returns
void
Example
sqlite
.dump users > users.sql.import file tableImports CSV or text data from file into the named table.
Parameters
| Name | Type | Description |
|---|---|---|
| file | string | Input file path. |
| table | string | Target table name. |
Returns
void
Example
sqlite
.mode csv
.import users.csv users.schema [tbl]Shows the CREATE statements for the database or for the named table.
Parameters
| Name | Type | Description |
|---|---|---|
| tbl | string | Optional table name. |
Returns
void
Example
sqlite
.schema users.tables [pattern]Lists table names in the database, optionally filtered by a LIKE pattern.
Parameters
| Name | Type | Description |
|---|---|---|
| pattern | string | Optional LIKE pattern. |
Returns
void
Example
sqlite
.tables user%