touchlab-lab / knarch.db

K(otlin)N(ative)A(rchitecture) Database
https://touchlab.co/
Apache License 2.0
90 stars 9 forks source link

What is the difference between this solution and interfaces solution? #48

Open amorenew opened 6 years ago

amorenew commented 6 years ago

Hello, what would be the difference between this approach and using an interface for SQLite commands then you can use a different SQLite library but through the same interface? I hope my question is clear ..English is not my native language. 1_6w0p-kijnc-ezqjxpaz7ha

kpgalligan commented 6 years ago

That's kind of what it is. The "Kotlin Multi" layer doesn't implement much, and eventually I'd like to be able to swap it out with SQLCipher (or something similar). It is very "Android-like", but delegates to the underlying implementation. That layer, though, is on the list to review. It was done pretty quickly after the iOS implementation to support initial release.

Is that what you're asking?

amorenew commented 6 years ago

What I mean like React Native cross libraries For example, a pop dialog is working in android and ios native then react native interface just make a code that matches for both platforms and you can use it same like these libraries https://github.com/jacklam718/react-native-popup-dialog https://github.com/andpor/react-native-sqlite-storage

amorenew commented 6 years ago
interface NetworkHelper {
    override fun get(url: String?): String
    override fun post(url: String?, params :String?): String
}

41905364-fe6873b2-794b-11e8-9689-c8a5f32874fe

kpgalligan commented 6 years ago

Unless I misunderstand what the libraries do, that’s what this is. A common library that renders to the native platforms.

On Tue, Jun 26, 2018 at 2:17 PM Amr Abd El Wahab El Desouky < notifications@github.com> wrote:

What I mean like React Native cross libraries For example, a pop dialog is working in android and ios native then react native interface just make a code that matches for both platforms and you can use it same like these libraries https://github.com/jacklam718/react-native-popup-dialog https://github.com/andpor/react-native-sqlite-storage

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/touchlab/knarch.db/issues/48#issuecomment-400286313, or mute the thread https://github.com/notifications/unsubscribe-auth/AAELIN3heqvsWUhuSAnAwqE5bugD2cLqks5uAiY8gaJpZM4U3p9y .

-- Kevin Galligan https://twitter.com/kpgalligan

amorenew commented 6 years ago

exactly it uses native code for every platform