I’m trying to write a Multiplatform wrapper for co...
# ios
a
I’m trying to write a Multiplatform wrapper for couchbase lite, but when importing the cocoapod for couchbaselite(objective-c), it seems to not be generating anything in the cocoapod import/commonizer. I have ran all the cocoapod tasks in gradle and it is successful but then when i look inside the build folder, it doesnt look like anything is imported in. I have created a public repo with the issue: https://github.com/MyUNiDAYS/couchbaselite-kotlin-sdk It seems like when the import happens, there is no headers for it to generate from 🧐
Actually digging through, i see there is this in the log and is classed as none fatal.
Copy code
Exception in thread "main" java.lang.IllegalArgumentException: 'CBLQueryMeta' is going to be declared twice
a
thanks @a-dd
j
I'm going to be releasing my Couchbase Lite KMP library soon.
a
is it open source?
can i clone and run locally?
j
I haven't made it public yet, but plan to. The only blocker is that it still depends on an internal build/implementation of some Okio extensions for
NSInputStream
.
I've got a couple PRs that are nearly across the finish line: https://github.com/Kotlin/kotlinx-io/pull/174 https://github.com/square/okio/pull/1123
a
nice, well done, thats alot of work but sounds like you are close
j
Yeah, I've been working on it on and off for a couple years, while using it in some projects. I was hoping to have it released by now. My goal was around the Kotlin 1.9 release, since it brought some fixes. It's really close now though. I'll make it available soon.
a
great, i am just doing some research into potential multiplatform database solutions. I didnt want to use realm, and wanted it to be a nosql solution. Kodein-db is no more too.
j
I've liked using Couchbase myself. It'll be good to have another KMP database option. My library's API aligns with the CBL Android-KTX SDK. So it should be easy to migrate existing Kotlin code using CBL already.
a
i would like a multiplatform database solution which can use kotlin serialisation(hence the nosql) and needs to be a local database
so firebase firestore would work but its not suposed to be used in a solely offline state
j
Yeah, Firebase isn't truly offline first, which ruled it out for me as well. Couchbase works well standalone or offline first replicated through Couchbase Sync Gateway.
👍 1
Right now I need to decide if I should switch to using kotlinx-io instead of Okio, now that it's been revived and based on Okio, and will likely become the KMP i/o standard library. But Okio is already somewhat standard itself. My other API dependencies are kotlinx-datetime and kotlinx-coroutines.
a
well this is what semantic versioning is for
you can always use the okio for now and then switch over at a later date
j
Yes, I've thought about that. At some point there will likely be adapters between the two. And could always deprecate the old API in favor of the new. It's only really used in the blob API anyway, so not as widely used as things like date, which is using kotlinx-datetime's
Instant
instead of Java's
Date
.
a
I know you have done most of the api, but i had a spare few moments so wrote this lightweight wrapper. https://github.com/MyUNiDAYS/couchbaselite-kotlin-sdk
i will publish it when i get time
j
Cool. My library is based on the CBL 3.0 SDK. I'll be adding support for 3.1 scopes and collections soon after I release.
👍 1