ClickHouse/docs/en/engines/database-engines/sqlite.md
Anna 62f0517e31
Update docs/en/engines/database-engines/sqlite.md
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
2021-08-19 07:27:24 +03:00

1.7 KiB

toc_priority toc_title
32 SQLite

SQLite

Allows to connect to SQLite database.

Creating a Database

    CREATE DATABASE sqlite_database 
    ENGINE = SQLite('db_path')

Engine Parameters

  • db_path — Path to SQLite file with the database.

Data Types Support

EngineName ClickHouse
INTEGER Int32
REAL Float32
TEXT String
BLOB String

Specifics and recommendations

SQLite stores the entire database (definitions, tables, indices, and the data itself) as a single cross-platform file on a host machine. It is locking the entire database file during writing. SQLite read operations can be multitasked, though writes can only be performed sequentially. SQLite does not require service management (such as startup scripts) or access control based on GRANT and passwords. Access control is handled by means of file-system permissions given to the database file itself.

Usage Example

Database in ClickHouse, exchanging data with the SQLite:

CREATE DATABASE sqlite_db ENGINE = SQLite('sqlite.db');
SHOW TABLES FROM sqlite_db;

Result:

┌──name───┐
│ table1  │
│ table2  │  
└─────────┘