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

SQL Delight FTS5 MATCH gives no results

I have the following table: CREATE TABLE IF NOT EXISTS "note" ( "noteid" INTEGER NOT NULL, "title" TEXT NOT NULL, "description" TEXT NOT NULL, PRIMARY KEY("noteid") ); Then I execute: CREATE VIRTUAL TABLE IF NOT EXISTS NoteFts…
0
votes
2 answers

Is the a way for SQLDelight to allow unrecognized expression?

I use SQLDelight's MySQL dialect on my server. Recently I plan to migrate a table to combine many fields into a JSON field so the server code no longer needs to know the complex data structure. As part of the migration, I need to do something like…
Merlin Ran
  • 403
  • 4
  • 8
0
votes
1 answer

SqlDelight ON CONFLICT DO UPDATE throws near "ON": syntax error (code 1 SQLITE_ERROR)

I'm using SqlDelight in a KMM project. I'm having problems when using the INSERT ON CONFLICT DO UPDATE command. After some investigation, I found that I needed to update my dialect version of SqlDelight to 3.25 which I did and it works fine, except…
Saul
  • 91
  • 2
  • 14
0
votes
1 answer

Unable to inject sqlDelight in Kmm project

I'm working in a small project trying to implement Kmm. The isse I got is with Koin, where I'm not able to inject DatabaseDriverFactory class in Android (where basically I need a Context). This is my code: // This code is in "commonMain" interface…
Nicote Ool
  • 121
  • 8
0
votes
0 answers

Time complexity of lookup using SQLDelight

I am using SQLDelight in my mobile app. The items which are being stored in the table have an id parameter. Say the count of items can go upto a few hundred, how expensive can the lookup for a particular item by its id will be? Is this strategy to…
0
votes
0 answers

SqlDelight: "No table found with name"

I am having trouble with what seems like to be with the SqlDelight intellij plugin. I am trying to write the migrations in one place and not use CREATE statements at all inside the .sq files. This is my setup: src/main/sqldelight: ├── com │   └──…
andras
  • 3,305
  • 5
  • 30
  • 45
0
votes
0 answers

SQLDelight just generated IOS Database generated classes, but android doesn't. Kmm proyect

I was developing an Kotlin Multiplatform App, using as base, the generated Architectured by Android Studio. My problem, comes when I try to implement the SQLDelight plugins into my app, because the plugin just generated iOS classes as you can see in…
Manuel Lucas
  • 636
  • 6
  • 17
0
votes
1 answer

Unresolved reference: squareup in iosMain directory after adding dependencies

I am trying to use SQLDelight in a Kotlin Multiplatform project for android and iOS. I have followed the documentation found here. The project builds successfully, but I can't access com.squareup.* anywhere inside the shared/iosMain folder. Below…
Olu Udeh
  • 1,031
  • 1
  • 10
  • 20
0
votes
1 answer

using string as id

I am making a KMM app using SQLDelight for the cache and recently I changed my database entities to use Text(String) for the id field instead of Int, now i am getting an error when inserting, I might just be missing some sqlDelight knowledge here is…
0
votes
0 answers

SQLDelight batch insert list

I'm having a problem inserting many rows with SQLDelight. I'm not sure if the query is deadlocked, or just taking many minutes. I'm inserting about 10k rows in two different tables. Both have a .sq file like: save: INSERT OR REPLACE INTO TableA…
Sean
  • 2,632
  • 2
  • 27
  • 35
0
votes
0 answers

Check if array param is not null in SQLDelight (PostgreSQL)

I've tested that select with PostgreSQL and it seems to work fine - return a list of items with resourceId mentioned in :resourceIdList (if any). If :resourceIdList is null - then return all of them. select b.resourceid, b.datecreatedutc as…
P. Savrov
  • 1,064
  • 4
  • 17
  • 29
0
votes
0 answers

Where to store photos in android application

I'd like to do in my android application access to camera and option to take photos. Where is the best way to store photos? On device in library? And save path to them In localdatabase in blob column? (SqlDelight) Other way? Thanks a lot.
mlody92
  • 83
  • 1
  • 6
0
votes
1 answer

How to delete a list of rows from a table using composite primary keys in Sqldelight?

I would like to delete rows in the tables given a list of as_counter,t_ms and the values as_counter and t_ms exists in the list. Database CREATE TABLE Event( as_counter TEXT NOT NULL, t_ms TEXT NOT NULL, event_map TEXT NOT NULL, …
chia yongkang
  • 786
  • 10
  • 20
0
votes
1 answer

Sqldelight and Postgres Column Adapter for Timestamp

Using this createdAt TIMESTAMP AS LocalDateTime NOT NULL, compiles but the Adapter never converts from localdatetime to TIMESTAMP in postgres. Instead I receive Exception in thread "AWT-EventQueue-0" org.postgresql.util.PSQLException: ERROR:…
BbopLifa
  • 131
  • 2
  • 5
0
votes
1 answer

SQLDelight multiplatform not generating schema if it is in a separate module

I have modularized my shared code, so currently I have a shared module (kmp), and inside this module I have shared:core and shared:database (both multiplatform too). If I set up the database in the shared module it works: I place my AppDatabase.sq…
1 2 3
8 9