saket
04/29/2020, 10:36 PMColton Idle
05/01/2020, 4:40 AMYang
05/02/2020, 10:14 AMworkflow
today and noticed that workflow-ui/core-android
has both Rx and Coroutines dependencies, are there plans to remove Rx from this artifact?Yang
05/03/2020, 8:09 AMworkflow
, what’s the idiomatic / recommended way to handle transient events (a.ka. the single live event issue 😂)?ahmad
05/04/2020, 12:52 PMinterface Service {
@GET("topics/{id}")
suspend fun topic(): NetworkResponse<Topic, CommentsError>
}
class Repository {
val tpoic = service.getTopic()
when (tpoic) {
is NetworkResponse.Success -> // request succeded
is NetworkResponse.ApiError -> // request failed
is NetworkResponse.NetworkError -> // network error
is NetworkResponse.UnknownError -> // unknown error happened
}
}
https://medium.com/@melegy/create-retrofit-calladapter-for-coroutines-to-handle-response-as-states-c102440de37aYang
05/05/2020, 2:18 PMFlow
worker go beyond a single Action
? I want to subscribe to a Flow
for the lifetime of a workflow, but it looks like any subsequent action
would cancel the Flow
immediately and you have to re-subscribe to the flow
in the next render
call. I remember reading that it’s possible to subscribe to external event sources, but this is not how I expect Flow
worker to work so I’m probably doing something wrong.Zac Sweers
05/08/2020, 8:37 PMjw
05/11/2020, 6:06 PMdimsuz
05/12/2020, 11:52 AMsqldelight 1.3.0
I have this gradle error:
More than one file was found with OS independent path 'META-INF/runtime.kotlin_module'
Searching through build folder reveals that sqldelight and 2 other libraries provide this file. SO is full of advices to exclude these from packaging options, but people also note that this would break reflection. I'm a bit hesitant to do that.
Is this really a best solution? Should I file a bug somewhere?Fabian de Almeida Ramos
05/12/2020, 8:11 PMCREATE TABLE Recipe (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT NOT NULL,
duration TEXT NOT NULL,
difficulty TEXT NOT NULL,
calories INTEGER AS Int NOT NULL
);
insert:
INSERT INTO Recipe (title, duration, difficulty, calories)
VALUES (?, ?, ?, ?);
now, when I call recipeQueries.insert
, I get a NOT NULL constraint failed: Recipe.id
.. I’ve been looking around SQLite docs as well, but still can’t figure it out..Elka
05/15/2020, 10:17 AMWITH
clause?
Trying to do something like this:
WITH existingUser AS (SELECT * FROM user WHERE isRemoved = 0);
Dariusz Kuc
05/15/2020, 4:13 PMPropertySpec.builder("myProp", ClassName(LIBRARY_PACKAGE, "MyClass")
how to update it so I end up with
myProp: MyClass<*>
Tried using parameterizedBy
with WildcardTypeName
but it looks like it assumes concrete typesdimsuz
05/17/2020, 11:42 PMsealed class MyAppError : Throwable { ... }
).
I can't find a good place to hook this up. Initially I thought I'd write a CallAdapter.Factory
which simply wraps every adapter, but it needs to somehow get adapter from all other installed factories (itself included) and this'll create a endless recursion.jw
05/18/2020, 2:29 PMTolriq
05/18/2020, 2:42 PMTolriq
05/18/2020, 3:36 PMbasher
05/18/2020, 9:52 PMpvasa
05/19/2020, 6:05 PMSELECT *
on either but when I try to use MATCH
on fts table, it always returns empty dataset.
Is there any extra step required to enable fts?
Am I missing something for the setup?
Below are the queries I use to setup tables
Create content table
CREATE TABLE dbBook (
isbn INTEGER NOT NULL PRIMARY KEY,
title TEXT NOT NULL,
subtitle TEXT NOT NULL DEFAULT '',
coverUrl TEXT DEFAULT NULL,
summary TEXT NOT NULL DEFAULT '',
authorIds TEXT AS List<Long> NOT NULL,
revisions TEXT AS List<Long> NOT NULL DEFAULT '',
publishedOn INTEGER as Date DEFAULT NULL,
addedAt INTEGER as DateTime NOT NULL DEFAULT ((julianday('now') - 2440587.5) * 86400.0 * 1000)
);
Create fts table
CREATE VIRTUAL TABLE dbBookFts
USING FTS4(
tokenize=porter,
content=dbBook,
isbn INTEGER NOT NULL,
title TEXT NOT NULL,
subtitle TEXT NOT NULL,
summary TEXT NOT NULL
);
Triggers to update fts table
-- Triggers to keep the FTS index up to date.
CREATE TRIGGER dbBook_bu BEFORE UPDATE ON dbBook BEGIN
DELETE FROM dbBookFts WHERE isbn=old.isbn;
END;
CREATE TRIGGER dbBook_bd BEFORE DELETE ON dbBook BEGIN
DELETE FROM dbBookFts WHERE isbn=old.isbn;
END;
CREATE TRIGGER dbBook_au AFTER UPDATE ON dbBook BEGIN
INSERT INTO dbBookFts(isbn, title, subtitle, summary)
VALUES(new.isbn, new.title, new.subtitle, new.summary);
END;
CREATE TRIGGER dbBook_ai AFTER INSERT ON dbBook BEGIN
INSERT INTO dbBookFts(isbn, title, subtitle, summary)
VALUES(new.isbn, new.title, new.subtitle, new.summary);
END;
Query for searching
SELECT dbBook.*
FROM dbBookFts
JOIN dbBook ON dbBookFts.isbn = dbBook.isbn
WHERE dbBookFts MATCH :query;
Even a simple MATCH query is empty
SEELCT * FROM dbBookFts WHERE dbBookFts MATCH :query;
jw
05/20/2020, 11:28 PMElka
06/05/2020, 11:25 AMTemp Views
?Sam Garfinkel
06/12/2020, 3:03 PMTypes
and Elements
classes? There’s some reusable functionality that would be nice, such as an isSubtypeOf(t1: KmType, t2: KmType
.jw
06/13/2020, 12:13 AMjw
06/13/2020, 12:13 AMBruno Kongawi
06/14/2020, 7:10 AMshowRendering
click listeners are set (as below).
override fun showRendering(rendering: Rendering) {
messageView.setOnClickListener { rendering.onClick(Unit) }
}
This means it will be set (unnecessarily) at every Rendering
state change. I don't imagine click listeners to be dynamic very often. What is the reasoning?alec
06/17/2020, 6:53 PMalec
06/17/2020, 7:57 PMandev
06/19/2020, 4:13 PMval schema = object : SqlDriver.Schema by Database.Schema {
override fun migrate(driver: SqlDriver, oldVersion: Int, newVersion: Int) {
appContext.deleteDatabase("mydatabase.db")
Database.Schema.create(driver)
}
}
Throws this:
W/SQLiteLog: (28) file unlinked while open: /path/to/mydatabase.db
android.database.sqlite.SQLiteReadOnlyDatabaseException: attempt to write a readonly database (code 1032)
at android.database.sqlite.SQLiteConnection.nativeExecuteForChangedRowCount(Native Method)
at android.database.sqlite.SQLiteConnection.executeForChangedRowCount(SQLiteConnection.java:736)
at android.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.java:754)
at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:64)
at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1756)
at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1683)
at android.database.sqlite.SQLiteDatabase.setVersion(SQLiteDatabase.java:950)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:341)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:238)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableSupportDatabase(FrameworkSQLiteOpenHelper.java:145)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase(FrameworkSQLiteOpenHelper.java:106)
at com.squareup.sqldelight.android.AndroidSqliteDriver$database$2.invoke(AndroidSqliteDriver.kt:30)
at com.squareup.sqldelight.android.AndroidSqliteDriver$database$2.invoke(AndroidSqliteDriver.kt:19)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at com.squareup.sqldelight.android.AndroidSqliteDriver.getDatabase(Unknown Source:2)
at com.squareup.sqldelight.android.AndroidSqliteDriver.newTransaction(AndroidSqliteDriver.kt:82)
at com.squareup.sqldelight.TransacterImpl.transactionWithWrapper(Transacter.kt:208)
at com.squareup.sqldelight.TransacterImpl.transaction(Transacter.kt:197)
at com.squareup.sqldelight.Transacter$DefaultImpls.transaction$default(Transacter.kt:82)
Myroslav Kolodii
06/26/2020, 2:26 PMandev
06/26/2020, 3:01 PMThat's a bug
Pls file an issue
can anyone create that issue for me, pleasejw
07/01/2020, 5:18 PMwithContext
jw
07/01/2020, 5:18 PMwithContext
Mustafa Ozhan
07/19/2022, 9:13 AMfun getActiveCurrencies() = currencyQueries
.getActiveCurrencies()
.asFlow()
.flowOn(ioDispatcher)
.mapToList(ioDispatcher)
be enough ? or should we still call with withContext
like this?
suspend fun getActiveCurrencies() = withContext(ioDispatcher) {
currencyQueries
.getActiveCurrencies()
.asFlow()
.flowOn(ioDispatcher)
.mapToList(ioDispatcher)
}
jw
07/19/2022, 12:58 PMMustafa Ozhan
08/07/2022, 10:54 PMwithContext
and suspend
makes perfect sense, but I confused about removing the flowOn(ioDispatcher)
is SQLDelight emitting value changes on IO thread ?jw
08/07/2022, 10:56 PMMustafa Ozhan
08/07/2022, 11:00 PM