SQLDelight in Android: Getting Started

Aug 3 2021 · Kotlin 1.4, Android 11, Android Studio 4.1

Part 1: Preparation & Setup

02. Configure SQLDelight

Episode complete

Play next episode

Next
About this episode
Leave a rating/review
See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 01. Prepare Your Project Next episode: 03. Add Tables to the Database

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

As soon as we add the SQLDelight plugin to our project, it applies a configuration that covers the most common use cases with some sane default values. Let’s go over how this configuration can be tweaked for customization or advanced usage.

sqldelight {
    Database {

    }
}
sqldelight {
    Database {
+       packageName = "${appPackageName}.db"
    }
}
sqldelight {
    Database {
        packageName = "${appPackageName}.db"

+       sourceFolders = ["sqldelight"]
    }
}
sqldelight {
    Database {
        packageName = "${appPackageName}.db"

        sourceFolders = ["sqldelight"]

+       schemaOutputDirectory = file("src/main/sqldelight/schemas")
    }
}
sqldelight {
    Database {
        packageName = "${appPackageName}.db"

        sourceFolders = ["sqldelight"]

        schemaOutputDirectory = file("src/main/sqldelight/schemas")

+       dialect = "mysql"
-       dialect = "mysql"
    }
}
sqldelight {
    Database {
        packageName = "${appPackageName}.db"

        sourceFolders = ["sqldelight"]

        schemaOutputDirectory = file("src/main/sqldelight/schemas")

+       dependency project(":library1")
-       dependency project(":library1")
    }
}