Thread
#multiplatform
    Niro

    Niro

    2 years ago
    Hey, Can I get an answer please to whether the database created by sqlDelight is not suppose to persist changes made due to the fact that the database is created using the platform specific SQL drivers. If that’s true is there a way to persist the changes to be seen by more than one platform?
    kpgalligan

    kpgalligan

    2 years ago
    Sqldelight changes are persistent to the platform you're on. Your question is confusing, though. Do you have some code to better explain the issue?
    Niro

    Niro

    2 years ago
    Ahh I see, Well I’m trying to do it so that both iOS and Android use the same db. If I make a change on Android that change should be reflected on iOS (and vice versa)
    eg
    init {
            GlobalScope.launch(ApplicationDispatcher) {
                if(getNotes().isEmpty()){
                    fetchAndStoreNotes()
                }
            }
        }
    If ran once on Android shouldn’t return empty on iOS. Ignore that I’m using global scope trying to just do a POC
    I’m assuming due to how sqldelight creates two versions for the two separate platforms this would not be possible
    kpgalligan

    kpgalligan

    2 years ago
    Sqlite is local to whatever device you're on. That's not a multiplatform thing
    Niro

    Niro

    2 years ago
    Ahh! Suspected as much
    Thank you