Vaibhav Jaiswal
03/31/2024, 2:42 PMitemCount
is 0
• loadState.mediator
is null
When i change the dispatcher passed in collectAsLazyPagingitems()
to Main.immediate
, I dont see loadState being null, but still my whole screen scroll state is lost
Only happens when some item gets added or updated in the other screen
Link to Discussion - https://github.com/cashapp/sqldelight/discussions/5103Richard Glen
04/03/2024, 6:30 AMSean Proctor
04/06/2024, 1:37 PMTolriq
04/08/2024, 11:13 AMErnest Zamelczyk
04/08/2024, 2:27 PMquery:
SELECT station.* FROM keyword LEFT JOIN station
ON keyword.station_id = station.id
I would like for it to just return the same type that the station table contains but it creates the exact duplicate under the name Query.Garret Yoder
04/09/2024, 2:16 AMDaniele B
04/09/2024, 7:54 AMpablisco
04/09/2024, 1:20 PMRohan Maity
04/09/2024, 3:23 PMWilliam Reed
04/09/2024, 7:25 PMSoundlicious
04/09/2024, 7:31 PMcommonDB
with several table shared between my clients and my server. On the server side, I have some triggers created for those table that shouldn't exist on the client side. For this reason, the sq file with all the triggers is in server
module.
Within my server
module, I can do my insert on the table from commonDB
. I have a lot of error from the IDE saying that the tables can't be found but it compile and the insert happen at runtime.
When I add my triggers in the server
module however, I do have the same errors in the IDE of table from commonDB
not found, but sadly it fails at compilation here.
"No table found with name ..."
Anyone has encounter an issue like that and solved it ?
EDIT: Solved -> Colum name typo in one of my triggers generating a lot of noisembonnin
04/10/2024, 4:53 PM@Test
fun test() = runBlocking {
flow {
emit(1)
// This delay makes the test pass while it fails with 'Unconsumed events' otherwise
delay(1000)
}.test {
awaitItem()
}
}
Colton Idle
04/10/2024, 9:18 PMval ds = HikariDataSource()
ds.driverClassName = "org.postgresql.Driver"
ds.jdbcUrl = "jdbc:<postgresql://blah:52289/railway>"
ds.username = "postgres"
ds.password = "password"
var driver: SqlDriver? = null
driver = ds.asJdbcDriver()
try {
MyDb.Schema.create(driver)
} catch (e: Exception) {
//Already created
}
database = MyDb(driver)
Daniele B
04/11/2024, 5:53 AMkrzysztof
04/11/2024, 10:50 PMtypealias Fn0<R> = () -> R
and changing it className (via ::class.toClassName
), results in actual usage of kotlin.Function0
Tech
04/14/2024, 11:33 PM{
id: <INCREMENT>,
kind: "TEST" | "TEST_2",
value: 1
}
And I wanted to make kind
a enum to hopefully make indexing in the future faster but it doesn't seem to be supported by SQLDelight.Rohan Maity
04/15/2024, 4:58 AMMateu
04/16/2024, 9:54 AMCREATE TABLE highScore (
id INTEGER NOT NULL,
name TEXT NOT NULL,
points INTEGER NOT NULL
);
mySelect:
SELECT
name,
RANK () OVER (
ORDER BY points DESC
) rank
FROM highScore
;
With potsgresql I get:
Compiling with dialect app.cash.sqldelight.dialects.postgresql.PostgreSqlDialect
file.sq: (29, 15): ',', <compound operator real>, FOR, FROM, GROUP, HAVING, LIMIT, OFFSET, ORDER or WHERE expected, got '('
27 SELECT
28 name,
29 RANK () OVER (
^
30 ORDER BY points DESC
31 ) rank
32 FROM highScore
With sqlite:
Failed to compile SqlCompoundSelectStmtImpl(COMPOUND_SELECT_STMT): [] :
SELECT
name,
row_number() OVER (ORDER BY points DESC) AS rank
FROM highScore
Is there something else that need to be done to support window functions?leonhardt
04/19/2024, 2:11 PMursus
04/19/2024, 11:21 PMjdbc
driver for sqldelight in unit tests - do I need to close the driver on test teardown?
I currently do close it, but sometimes I see some cryptic errors about not being abke to open a database.
Simply not closing seems to help, but it feels wrong. Am I leaking something?Tech
04/20/2024, 3:40 PMjessewilson
04/20/2024, 8:00 PMRichard Glen
04/22/2024, 6:15 AMMatas Lauzadis
04/23/2024, 1:54 PMYuvaraj
04/23/2024, 5:15 PMSystem.loadLibrary("sqlcipher");
String password = "Password1!";
File databaseFile = context.getDatabasePath("demo.db");
SupportOpenHelperFactory factory = new SupportOpenHelperFactory("password.getBytes(StandardCharsets.UTF_8));
db = Room.databaseBuilder(context, AppDatabase.class, databaseFile.getAbsolutePath())
.openHelperFactory(factory).build();
Aditya Kurkure
04/23/2024, 8:43 PMursus
04/24/2024, 10:50 PMAfterVersion ...
varargs)
The docs (https://cashapp.github.io/sqldelight/2.0.2/jvm_sqlite/migrations/) say
val driver: SqlDriver = JdbcSqliteDriver(
url = "jdbc:sqlite:test.db",
properties = Properties(),
schema = Database.Schema,
callbacks = arrayOf(
AfterVersion(3) { driver -> driver.execute(null, "INSERT INTO test (value) VALUES('hello')", 0) }
)
)
just to stick the same AfterVersion
object's I already have for android driver and pass them here.
However build fails due to schema
& callbacks
being unknown. Looking at sources (2.0.2) there's no such constructor.Soundlicious
04/25/2024, 2:27 PMAndroid Poet
04/25/2024, 3:12 PMfun getFilesList() = Pager(
PagingConfig(
pageSize = 10,
enablePlaceholders = false,
initialLoadSize = 10,
),
) {
QueryPagingSource(
countQuery = appDatabase.countFileInformation(),
transacter = appDatabase,
context = <http://Dispatchers.IO|Dispatchers.IO>,
queryProvider = appDatabase::fileInformationList,
)
}.flow.pagingMap(FileInformation::asModel)
This code keeps refreshing the same list again and again when updating any single item. Is there any solution?Julius
04/25/2024, 9:34 PMSELECT * FROM users;
and consuming that as a flow, but I'm a little worried about memory usage.
Can I somehow use the flow emission without loading the emitted data into memory?