Questions tagged [sqldelight]

SQLDelight generates Java models from your SQL statements. These models give you a typesafe API to read & write the rows of your tables. It helps you to keep your SQL statements together, organized, and easy to access from Java.

SQLDelight generates typesafe APIs from your SQL statements. It compile-time verifies your schema, statements, and migrations and provides IDE features like autocomplete and refactoring which make writing and maintaining SQL simple. SQLDelight currently supports the SQLite dialect and there are supported SQLite drivers on Android, JVM and iOS.

The premise of SQLDelight is unchanged: Write SQLite and let the Gradle plugin generate APIs to run your queries for you. SQLDelight files use the .sq extensions and are contained in your src/main/sqldelight folder in a Gradle module.

122 questions
1
vote
1 answer

KMM: sqldelight:coroutines-extensions sets kotlinx-coroutines-core version to 1.3.9

I have these dependencies in my build.gradle.kts file in share module. val coroutinesVersion = "1.3.9-native-mt" val serializationVersion = "1.0.1" val ktorVersion = "1.4.2" val sqlDelightVersion = "1.4.4" sourceSets { val commonMain by getting…
Marat
  • 6,142
  • 6
  • 39
  • 67
1
vote
2 answers

Update or add value with id

I am just learning SQLDelight and was hoping to find how to add an object with an ID if it doesn't exist already if it does exist then update that current object with the given id. currently, I am deleting the current object with id, then adding an…
Wazza
  • 1,725
  • 2
  • 17
  • 49
1
vote
1 answer

Cannot access generated Database Class from sqldelight v1.4.1

16:26 Duplicate content roots detected: Path [/Users/androiddeveloper/Documents/udux_android/SharedCode/build/generated/sqldelight/code/MyDatabase] of module [SharedCode_iosMain] was removed from modules [SharedCode_commonMain] Every time i…
1
vote
2 answers

SQLDelight: Unresolved reference AndroidSqliteDriver in Kotlin Multiplatform App

I try add sqldelight to my Kotlin Multiplatform App, but AndroidSqliteDriver unresolved reference. I dont understand why. I clear cache and regenerate all, but it dont work too. AndroidSqliteDriver: package com.rompos.deactivator import…
Diy2210
  • 19
  • 3
1
vote
0 answers

How do we write unit tests for application that uses SQLDelight?

I am writing a Kotlin JVM application that uses the SQLDelight to generate classes that needs to interact with a MySQL database. How can I write unit tests for classes/services that use the classes that SQLDelight library generated? For example,…
lawkai
  • 155
  • 1
  • 9
1
vote
0 answers

SQLDelight Schema Generation Failing

I'm using SQLDelight on Android and started reading about SQLDelight's Gradle DSL so that I could generate a database schema and prepare for a small migration. I've been working with pretty much all default configuration, so I added this very…
AvlWx
  • 291
  • 3
  • 9
1
vote
1 answer

SQLDelight v1.4 not generating interface

Since v1.4, SQLDelight generated data class only. Before, the tool generated interface and a default implementation of this interface. That was easy to compose objects with associated projections. Is there any change to get these interface back ?
1
vote
1 answer

Could not resolve com.squareup.sqldelight:native-driver:1.3.0

I am trying to build a Kotlin multiplatform project to serve as a shared module for iOS and Android app. I am trying to integrate SQLDelight but I am stuck with this error while syncing Gradle. The following are the error and the build.gradle file…
1
vote
1 answer

Update object data with Sqldelight

I am trying to figure out how you would write an Update query in the .sq files where you pass an object and it will update the whole row I know you can do a normal update statement where you set the columns with the values but is there a way to just…
tyczj
  • 71,600
  • 54
  • 194
  • 296
1
vote
0 answers

How Sqlbrite database uses schedulers

I am new to the sqlbrite database, while creating a database wrapper it asks for the rxjava Schedulers What i want to know is Is that schedulers which i passed in the wrapper is used to run insert,delete,update etc. query or Is it only used for…
Stack
  • 1,164
  • 1
  • 13
  • 26
1
vote
1 answer

SqlDelight/SQLite not executing joins properly?

I have added SqlDelight to my Multiplatform project and have created a few basic tables and queries. When I try to use more complex queries though, like JOINS the query still executes and the generated interfaces contain all the correct fields, but…
lyio
  • 1,237
  • 12
  • 13
1
vote
1 answer

Prefix getter and setter with sqldelight

Is it possible to configure sqldelight to prefix all the getters and setters? CREATE TABLE foo { bar TEXT } bar() -> getBar()
Tobias
  • 7,282
  • 6
  • 63
  • 85
0
votes
0 answers

SQLDelight: BLOB inserting large binary data

I stuck with problem. I need to insert large enough data to BLOB column using SQLDelight... In ordinary JDBC it could be done usually in a way like: val file = File("your_path") val inputStream = FileInputStream(file) val statement =…
Barmaley
  • 16,638
  • 18
  • 73
  • 146
0
votes
0 answers

Sqldelight not creating database tables

I am using sqldelight to persist items locally. This is the error i get when i run the test org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (no such table: LocalMember) It worked perfectly until now. I really should have…
ayitinya
  • 63
  • 1
  • 10
0
votes
0 answers

How to use SQLDelight together with SqlCipher (Kotlin Multiplatform)

I am trying to encrypt my SQLDelight database using SqlCipher. I've found one appropriate example on GitHub, however, it uses outdated cwac-saferoom which connects Room with SQLCipher for Android. The oudated library mentions to use SQLCipher for…
Captain Jacky
  • 888
  • 1
  • 12
  • 26
1 2 3
8 9