Hi, I am using wrapper for SqlBrite for DAO objects - https://github.com/sockeqwe/sqlbrite-dao and this library creates its own SQLiteOpenHelper that is provided to SqlBrite. I dont have access to this helper and neither to SQLiteDatabase object and I cannot therefore create instance of generated SqlDelightCompiledStatement.Insert because it accepts SQLiteDatabase in constructor. Is there any way how to use only BriteDatabase instance and perform compiled inserts etc.? I looked at the example but this project does not have SqlBrite dependency and SqlBrite does not have dependency for SqlDelight (for obvious reason).
I saw that SqlBrite in the latest version supports execution of compiled statements but I dont really know how to get this statement without using deprecated API of SqlDelight
I would continue to use the deprecated API's for now since I don't think you have a choice and urge sqlbrite-dao to expose some method to compile statements since you're losing efficiency otherwise. That might be unlikely since they've probably explicitly hidden the db to get rid of any leaky abstraction - that's essentially what we're doing but in the opposite direction where we abstract over sqlite strings instead of the db.
And yea unfortunately there's no dependency between SQLBrite and SQLDelight so we can't use the OpenHelper that SQLBrite wraps.
SQLBrite now exposes getWritableDatabase and getReadableDatabase in version 1.1.0 which can be passed to SQLDelight compiled statement constructors :+1:
Fantastic! Thanks Alec!
Most helpful comment
SQLBrite now exposes
getWritableDatabaseandgetReadableDatabasein version 1.1.0 which can be passed to SQLDelight compiled statement constructors :+1: