This is the implementation of the SQLite data handler for MindsDB.

SQLite is an in-process library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. The code for SQLite is in the public domain and is thus free to use for either commercial or private purpose. SQLite is the most widely deployed database in the world with more applications than we can count, including several high-profile projects.


This handler is implemented using the standard sqlite3 library that comes with Python.

The only required argument to establish a connection is db_file that points to the database file that the connection is to be made to.

Optionally, this may also be set to :memory: to create an in-memory database.


In order to make use of this handler and connect to the SQLite database in MindsDB, the following syntax can be used:

CREATE DATABASE sqlite_datasource
    engine = 'sqlite',
    parameters = {
        "db_file": "example.db"

You can use this established connection to query your table as follows:

FROM sqlite_datasource.example_tbl;