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
0
votes
1 answer

SQLDelight - java.lang.UnsatisfiedLinkError: couldn't find "libsqlitejdbc.so"

Runtime Environment SQLDelight version: 1.4.3 Application OS: Android Bug Description I'm trying to create SQLDelight in library level as kotlin multiplatform library and deploy it as android library... Then when I added it as dependencies in my…
0
votes
1 answer

SQLDelight FTS5 insert trouble

I created a table in DBBrowser: CREATE VIRTUAL TABLE IF NOT EXISTS Students USING FTS5 ( GroupId UNINDEXED, StudentName ); and insert values to it. After that I add DB with this table to my project. It is declaration of this table…
Grigorii
  • 43
  • 6
0
votes
2 answers

SQLdelight drop all tables

I'm using SQLDelight in the Kotlin/Native project (iOS & Android), and I'm looking for the best way to drop DB (all tables). User case: use log out from the app. So, I was looking for a way to erase data from all tables. So far I tried this, but I…
ilbets
  • 710
  • 1
  • 9
  • 35
0
votes
1 answer

SQLDelight - Emit on Parent Tables when Child Tables are Modified

I haven't come across an obvious way to emit notifications on parent tables when child tables are updated with SQLDelight. Here is an E/R Diagram roughly outlining the structure I have in play: Which translates roughly to the following database…
AvlWx
  • 291
  • 3
  • 9
0
votes
1 answer

sqldelight: How to ensure that `create` is only called once

How can I make sure that Database.Schema.create() is only called once when using the application? You could add ...IF NOT EXISTS... to the table definition, then the SQL instructions are executed during every startup but no tables are created after…
matthjes
  • 671
  • 7
  • 20
0
votes
1 answer

How to setup sqldelight in a kotlin multiplatform project with android, iOS and unsupported targets like mingwX64?

In the past we are working on a kotlin multiplatform project for mobile devices which uses sqldelight for database access. Now we want to add some native desktop targets like mingwX64 and linuxX64 but currently sqldelight doesn't available for these…
0
votes
2 answers

Using SQLDelight JVM Driver on Android

Is it possible to use the SQLDelight JVM driver on a pure Java/Kotlin module which is later going to be consumed on an Android module? Just wondering because I like the idea of having the persistency layer of my app on its Domain module, which…
mradzinski
  • 614
  • 1
  • 8
  • 21
0
votes
3 answers

Is there any limitations for "WHERE IN" clause in sqlite on Android?

I'm getting such error sometimes when I querying a table by ids: Caused by android.database.sqlite.SQLiteException: variable number must be between ?1 and ?999 (Sqlite code 1 SQLITE_ERROR): , while compiling: SELECT * FROM chat_ads WHERE _id…
ar-g
  • 3,417
  • 2
  • 28
  • 39
0
votes
1 answer

Errors when testing database repository - SQLBrite, SQLDelight

When testing my DB I get the following errors: SQLiteDiskIOException: disk I/O error (HTC Desire 620) SQLiteReadOnlyDatabaseException: attempt to write a read-only database (Moto g2) Depending apparently on the device I test it on. The error…
Lukasz
  • 2,257
  • 3
  • 26
  • 44
0
votes
1 answer

Problems setting up SQLDelight

I'm trying to use SQLDelight in my project. Everything seems to be working alright in respect of code generation. Unfortunately I can't use the interfaces generated under /build/generated/source/sqldelight/... in my project. When I try to create a…
Lukasz
  • 2,257
  • 3
  • 26
  • 44
0
votes
1 answer

SqlDelight not generating SQL Query String for SQL Statement

In the example in the SqlDelight documentation, the HockeyPlayerModel generated by SqlDelight from a HockeyPlayer.sq file is implemented in an abstract class public abstract class HockeyPlayer implements HockeyPlayerModel In this class, the string…
0
votes
1 answer

SQLite Foreign Keys | Different SQ files

I have an Android project that includes a local database written in SQLite. There exists an sqldelight folder which contains a .sq file for every table in the database (User.sq, Routine.sq ...). I am able to access/use the tables and procedures…
0
votes
0 answers

Generating Abstract Classes in Android

I'm making an application that requires an online and local database. I have a lot working, but I have a list of things I need for "setup" for each database table. I'm using SQLDelight and so I need a class (for each database table) like this…
0
votes
1 answer

createQuery useage trouble about SQLBrite and SQLdelight

I use SQLdelight to create sql code,Like SELECT * FROM CoachService WHERE shop_id in (?) and brand_id = ? and I query Like: briteDatabase.createQuery(CoachService.TABLE_NAME, CoachService.GETBYBRANDIDANDSHOPS, "'1','5','11'","2"); but result is…
paperhs
  • 194
  • 2
  • 6
0
votes
1 answer

Sqlite insert lines bug

I am stuck on a really weird bug. I have a table followers, and when I insert datas, it works except for th me first entry. The first time I call the function, nothing is thrown and the insert function return as expected 1. But when I call the…
1 2 3
8
9