Differences from Java SDK
Kotbase's API aligns with the Couchbase Lite Java and Android KTX SDKs. Migrating existing Kotlin code can be
as straightforward as changing the import package from
kotbase, with some exceptions:
- Java callback functional interfaces are implemented as Kotlin function types.
URIAPIs are represented as strings.
DateAPIs use kotlinx-datetime's
InputStreamAPIs use kotlinx-io's
ExecutorAPIs use Kotlin's
- Certificate APIs are available as raw
ByteArrays or in platform-specific code.
- There's no need to explicitly call
CouchbaseLite.init(). Initialization functions can still be called with custom parameters in JVM and Android platform code.
- Efforts have been made to detect and throw Kotlin exceptions for common error conditions, but
NSErrormay still leak through on Apple platforms. Please report any occurrences that may deserve addressing.
- Some deprecated APIs are omitted.
- While not available in the Java SDK, as Java doesn't support operator overloading,
Fragmentsubscript APIs are available in Kotbase, similar to Swift, Objective-C, and .NET.