# SQLite

> For the complete documentation index, see [llms.txt](https://kotlin.github.io/dataframe/llms.txt).

Kotlin DataFrame supports reading from an [SQLite](https://www.sqlite.org) database using JDBC.

API reference: [Sqlite](https://kotlin.github.io/dataframe/api-docs/dataframe-jdbc/org.jetbrains.kotlinx.dataframe.io.db/-sqlite/index.html), [readSqlTable](https://kotlin.github.io/dataframe/api-docs/dataframe-jdbc/org.jetbrains.kotlinx.dataframe.io/read-sql-table.html)

Requires the [dataframe-jdbc module](modules.html#dataframe-jdbc), which is included by default in the general [dataframe artifact](modules.html#dataframe-general) and in [%use dataframe](setupkotlinnotebook.html#integrate-kotlin-dataframe) for Kotlin Notebook.

You’ll also need the [SQLite JDBC driver](https://github.com/xerial/sqlite-jdbc):

Gradle project:

```KOTLIN
dependencies {
    implementation("org.xerial:sqlite-jdbc:$version")
}
```

Kotlin Notebook:

```KOTLIN
USE {
    dependencies("org.xerial:sqlite-jdbc:$version")
}
```

The actual Maven Central driver version can be found [here](https://mvnrepository.com/artifact/org.xerial/sqlite-jdbc).

## Read

A [DataFrame](dataframe.html) can be loaded from a database in several ways:

* a user can read data from a SQL table by a given name ([readSqlTable](readsqldatabases.html)),

* as a result of a user-defined SQL query ([readSqlQuery](readsqldatabases.html)), or

* from a given `ResultSet` ([readResultSet](readsqldatabases.html)). It is also possible to load all data from non-system tables, each into a separate `DataFrame` ([readAllSqlTables](readsqldatabases.html)).

See [Read from SQL databases](readsqldatabases.html) for more details.

```KOTLIN
val url = "jdbc:sqlite:testDatabase.db"

val dbConfig = DbConnectionConfig(url)

val tableName = "Customer"

val df = DataFrame.readSqlTable(dbConfig, tableName)
```

