Mastering SQLDelight Database in Android with Jetpack Compose

Delve into SQLDelight, a robust database library designed for Android projects. You’ll start by setting up SQLDelight in Android Studio and learn to define database schemas using .sq files for type-safe Kotlin mappings. From building tables and queries to managing relationships between entities, you’ll explore key concepts like SQL joins and CRUD operations. Along the way, you’ll implement reactive database interactions with Kotlin Coroutines and Flows, integrate SQLDelight into MVVM architecture with Jetpack Compose, and master techniques for testing and debugging your database. By the end, you’ll have the skills to build scalable, data-driven apps with SQLDelight.

Codelab Objectives

In this codelab, you’ll explore:

  • Understand SQLDelight and its advantages over Room for Android apps
  • Learn to set up SQLDelight with plugins and dependencies in Android Studio
  • Define database schemas using .sq files with type-safe Kotlin mappings
  • Building tables, entities, and database queries with SQLDelight
  • Relationships between objects in database tables/entities
  • Write SQLDelight queries for CRUD operations like Insert, Select, Update, Delete
  • Understanding SQL Joins for handling relational data across tables
  • Testing and Debugging SQLDelight Database
  • Implement reactive database operations with Kotlin Coroutines and Flows
  • Integrate SQLDelight with MVVM architecture and Jetpack Compose UI design

Codelab Content

Meet the instructor

Kaaveh Mohamedi

Content Author & Course Instructor

More courses by the instructor

We use cookies to provide you with an optimal experience and relevant communication. Learn more or accept individual cookies.

Necessary

Necessary cookies (First Party Cookies) are sometimes called "strictly necessary" as without them we cannot provide the functionality that you need to use this website. For example, essential cookies help remember your preferences as you navigate through the online school.

Functional

During your interaction with this website, cookies are used to remember information you have entered or choices you make (such as your username or preferences for personalizing your account). These preferences are remembered, through the use of the persistent cookies, and the next time you use the Website you will not have to set them again.

Analytics

These cookies track information about visits to this Website so that we can make improvements and report our performance. For example: analyze User behavior so as to provide additional functionality or improve course contents. These cookies collect information about how visitors use the Website, which site or page they came from, the number of visits and how long a user stays on the Website.

Marketing

These cookies are used to deliver advertising materials relevant to you and your interests. They are also used to limit the number of times you see an advertisement as well as help measure the effectiveness of campaigns. They are usually placed by advertising networks we work with with our permission. They remember that you have visited a website and this information is shared with other organizations such as advertisers.