Raghav
05/16/2023, 8:12 AMRaghav
05/16/2023, 8:17 AMkotlin.collections.List
import as this is directly provided from Kotlin Standard library. Thanks @sakethfhbd
05/16/2023, 12:53 PMMarco Righini
05/17/2023, 11:29 PMval tables = driver.executeQuery(null, "SELECT name FROM sqlite_master WHERE type='table';", 0).use {
buildList {
while (it.next()) {
val name = it.getString(0)!!
if (name != "sqlite_sequence" && name != "android_metadata") {
add(name)
}
}
}
}
for (table in tables) {
driver.execute(null, "DROP TABLE $table", 0)
}
Database.Schema.create(driver)
We have the following doubts:
• Is this logic safe? Could be device or os dependent or be broken by library updates?
• What is the correspondent for ios?jw
05/18/2023, 12:54 AMRaghav
05/18/2023, 7:51 AMhfhbd
05/18/2023, 9:13 AMRaghav
05/18/2023, 11:44 AMimplementation("com.squareup.sqldelight:native-driver:$sqlDelightVersion")
Pablichjenkov
05/18/2023, 2:26 PMKamilH
05/18/2023, 6:46 PMRohan Maity
05/19/2023, 1:48 PMDerek Ellis
05/19/2023, 1:58 PMSean Wong
05/20/2023, 1:03 AMВиталий Перятин
05/20/2023, 10:18 AMColton Idle
05/23/2023, 1:27 PM{
"items": [
{ "x": { // bunch of properties} },
{ "y": { // bunch of properties, identical to above} },
{ "z": { // ^^^} },
]
}
So my problem is because I seemingly have the same Type going into items array, but I want to be able to dynamically chance the name of the item (x,y,z) at runtime, but name
isn't a property... its the object name itself?jw
05/23/2023, 1:29 PMMap<String, BunchOfProperties>
and runtime verify there's only a single entry. You could model it as data class Something(val name: String, val stuff: BunchOfProperties)
and write a custom serializer that emits it as an object with a single key/value pair using the provided name.Colton Idle
05/23/2023, 1:42 PMjw
05/23/2023, 1:48 PMJoel Denke
05/23/2023, 2:01 PMjw
05/23/2023, 2:02 PMhfhbd
05/25/2023, 8:17 AMMemberName("MyObject", "my-prop")
and I need carefully adopt my generator to use %N
. This is also affects %L
, which uses the same %M
escaping when passing MemberName
. Also related, %N
only writes the escaped property name, but does not include the class name, so I need to write the classname manually in another code block too.Colton Idle
05/25/2023, 9:42 PMjw
05/25/2023, 9:49 PMTolriq
05/27/2023, 7:39 PMWaitForOtherNonDaemonThreadsToExit
in each case I have an OkHttp thread running. Any knowledge about such kind of issues ?
Anr:
#00 pc 0x000000000004e8f0 /apex/com.android.runtime/lib64/bionic/libc.so (syscall+32)
#01 pc 0x00000000003a9ae4 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+140)
#02 pc 0x00000000007267c0 /apex/com.android.art/lib64/libart.so (art::ThreadList::WaitForOtherNonDaemonThreadsToExit(bool)+336)
#03 pc 0x000000000034dc20 /apex/com.android.art/lib64/libart.so (art::JII::DestroyJavaVM(_JavaVM*)+32)
#04 pc 0x00000000000ce520 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+1032)
#05 pc 0x0000000000002570 /system/bin/app_process64 (main+1304)
#06 pc 0x000000000004a7d4 /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+100)
Thread code in thread.Ahmad Hassan
05/28/2023, 6:43 PMactual fun Scope.createDriver(): SqlDriver {
val context = androidContext()
val fileName = "dbFileName"
val database: File = context.getDatabasePath(fileName)
if (!database.exists()) {
val inputStream = context.assets.open(fileName)
val outputStream = FileOutputStream(database.absolutePath)
inputStream.use { input ->
outputStream.use {
input.copyTo(it)
}
}
}
return AndroidSqliteDriver(NoteDatabase.Schema, context, fileName)
}
What are the steps for the iOS side..?
thanks!Jan Skrasek
05/31/2023, 11:38 AMjava.lang.IllegalStateException at MainDispatchers.kt:115
◦ Caused by: java.lang.IllegalStateException at MainDispatchers.kt:115
◦ Caused by: java.lang.IllegalStateException at HandlerDispatcher.kt:55
• Android Lint linting our dependencies (probably some classpath manipulation?)
◦ /builds/mobile/android/cache/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcpkix-jdk15on/1.67/5f48020a2a60a8d6bcbecceca23529d225b28efb/bcpkix-jdk15on-1.67.jar: Error: checkClientTrusted is empty, which could cause insecure network traffic due to trusting arbitrary TLS/SSL certificates presented by peers [TrustAllX509TrustManager]
So what approach you would suggest? We have tens of modules, so separating screenshot test to separate modules is not something we would prefer. We are considering JUnit suite or other filtering, but I guess this must be an issue for everybody. Thank you.Adam S
05/31/2023, 4:04 PMpeek()
past the BOM, Okio always throws an exception. There’s no KDoc so I’m not clear what it’s for.Marc
06/01/2023, 5:31 AMHåkon Pettersen
06/03/2023, 2:46 PMDatabase.Schema.migrate(
driver = driver,
oldVersion = 0,
newVersion = Database.Schema.version,
)
I assume that this won't work if the user is currently on version 2, and I am trying to migrate to version 3. I assume that I have to check which version of the database the user is currently on and only execute migration if it is lower than the latest version. If that's the case, how can I check the current database-verison that the user is on? (Also, If this is the wrong way to handle migrations, please elaborate).Nacho Ruiz Martin
06/05/2023, 4:45 PMdatabases {
create("X") {
... other config ...
sourceFolders.set(listOf("db"))
}
}
And the last line is throwing:
Function invocation 'sourceFolders(...)' expected
But, at the same time, sourceFolders
is a private function inside SqlDelightDatabase
sourceFolders
is supposed to be a public variable of type ListProperty<String>
.