https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
c

cafonsomota

09/02/2019, 4:49 PM
hello all, I’m trying to use sqldelight both on Android and iOS - but although everything is working fine on Android side, it seems when I attempt to generate the framework for iOS I’ve got a couple of errors on the generated db impl: example of generated insert method:
Copy code
override fun insertItem(city_name: String, country: String?) {
        driver.execute(117,
                """INSERT OR FAIL INTO locationModel(city_name, country) VALUES (?1, ?2)""", 2) {
            bindString(1, city_name)
            bindString(2, country)
        }
        notifyQueries(database.locationModelQueries.selectAll)
    }
and error:
Copy code
e: ...DbImpl.kt: (163, 23): Type mismatch: inferred type is MutableList<Query<*>> but Int was expected
e: ...DbImpl.kt: (163, 62): No value passed for parameter 'queryList'
and the .sq example that I’m trying to run is from a sample:
Copy code
CREATE TABLE locationModel (
    id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
    city_name TEXT NOT NULL,
    country TEXT
);


insertItem:
INSERT OR FAIL INTO locationModel(city_name, country) VALUES (?, ?);


selectAll:
SELECT *
FROM locationModel;

deleteItem:
DELETE FROM locationModel WHERE city_name = ?;
any ideia what I might be doing wrong?
m

mbonnin

09/02/2019, 5:08 PM
You'll might have more luck in #squarelibraries
c

cafonsomota

09/02/2019, 5:32 PM
thank you! it seems I was able to fix it anyway 🙂 I was using 1.1.3 on iOS and 1.1.4 on android - everything is working fine now x)
9 Views