jw
02/25/2019, 10:18 PMjw
02/25/2019, 10:18 PM@JvmOverloads
bdawg.io
02/25/2019, 10:23 PM@JvmOverloads
can’t be used on interfaces. I’ll look into if Kotlin creates an overloaded default implementation or if uses some sort of companion object that has the implementation with default parametersbdawg.io
02/25/2019, 10:27 PMMyService.DefaultImpls.foo$default
method on a nested static class. I’ll try it out, but we might get default parameters for freejw
02/25/2019, 10:30 PMbdawg.io
02/25/2019, 10:34 PMDefaultImpls
which takes the service as a parameter and applies the default parameters.
When I create a stubbed implementing class of the service, there’s only one method to override suspend fun foo(Int, FooPayload): FooResult
jw
02/25/2019, 10:39 PMbdawg.io
02/27/2019, 5:43 PMnull
for non-nullable fields, but that leaves me empty-handed for nullable fieldsbdawg.io
02/27/2019, 6:30 PMOmittable
type sealed class Omittable<out T> {
abstract val omitted: Boolean
abstract val value: T
object Missing : Omittable<Nothing>() {
override val omitted = true
override val value get() = error("you can't do that")
}
class Provided<out T>(override val value: T) : Omittable<T>() {
override val omitted = false
}
}
and then my deserialized data classes default to Omittable.Missing
for those propertiesjw
02/27/2019, 6:32 PMjw
02/27/2019, 6:38 PMval omitted get() = this is Missing
Daniel Eke
02/28/2019, 9:12 AMSQLDelight
in Android and iOS with kotlin-multiplatform
and looking for a way to somehow encrypt the underlying database file.
Has anyone here done something like this before?
I don’t have much experience with SQLite
, but as I’ve noticed there are ways to encrypt the stored data with SQLCipher
but apart from this old issue I couldn’t find any clues how I could integrate it with `SQLDelight`: https://github.com/square/sqldelight/issues/566
Also I’m thinking that maybe in my use-case it wouldn’t be too important to encrypt every row, it’s enough if I could just secure the database file. By somehow making sure that only the database driver can open the file. Or maybe loading it in memory from an encrypted file and storing it back after a transaction is finished.
I don’t know if that makes sense, I’m just looking for the easiest way to provide some security for the database.alec
02/28/2019, 10:20 AMSupportSQLite
implementation for SqlCipher on android, but there wont be anything like that for native right nowDaniel Eke
02/28/2019, 10:49 AMSQLDelight
. I guess the SQLiteDatabase
can be passed to the driver, I’ll try it later.alec
02/28/2019, 11:21 AMalec
02/28/2019, 11:21 AMalec
02/28/2019, 11:21 AMDaniel Eke
02/28/2019, 11:29 AMPavel.AZ
02/28/2019, 11:30 AMNikky
03/01/2019, 1:10 PMjw
03/01/2019, 1:30 PMNikky
03/01/2019, 4:35 PM.asTypeName()
on the KType and it did not find anything to import, then after a 5 min break it didjw
03/01/2019, 4:35 PMjw
03/01/2019, 4:36 PMAllan Wang
03/05/2019, 5:33 AMval driver: SqlDriver = AndroidSqliteDriver(Database.Schema, context, "test.db")
I don’t see how it selects which .sq
files to use per driver. I have an app where I only want to backup part of the db, so usually I set rules within fullBackupContent
to exclude certain filesalec
03/05/2019, 1:44 PMsqldelight {
DatabaseA {
packageName = "com.sample.databasea"
sourceFolders = ["databasea"]
}
DatabaseB {
packageName = "com.sample.databaseb"
sourceFolders = ["databaseb"]
}
}
this means the .sq files in src/main/databasea
are used for DatabaseA
and the .sq files in src/main/databaseb
are used for DatabaseB
, and you can make different drivers when instantiating the two databases if you wantpaulblessing
03/05/2019, 5:06 PMCAST
in SqlDelight? Trying to use a CAST
as obviously the SqlDelight compiler isn't going to know the result type of myfunction
. This generates the bar
as ByteArray
but it needs to be ByteArray?
for my usage.
CREATE TABLE example (
foo TEXT
);
selectWithCast:
SELECT
foo,
CAST(myfunction(foo) AS BLOB) AS bar
FROM example;
alec
03/05/2019, 5:07 PMpaulblessing
03/05/2019, 5:13 PMalec
03/05/2019, 5:15 PM