Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ Kotbase includes some convenient extensions on top of Couchbase Lite's official
### Kotbase KTX

The [KTX extensions](couchbase-lite-ktx/README.md) include the excellent [Kotlin extensions by MOLO17](https://github.com/MOLO17/couchbase-lite-kotlin),
as well as other convenience functions for composing queries, observing change `Flow`s, and creating indexes.
as well as other convenience functions for composing queries, mapping query results, creating documents, and observing
change `Flow`s.

#### Installation

Expand Down
12 changes: 2 additions & 10 deletions couchbase-lite-ee-ktx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
## Couchbase Lite Enterprise Edition – Kotlin Extensions

The KTX extensions include the excellent [Kotlin extensions by MOLO17](https://github.com/MOLO17/couchbase-lite-kotlin),
as well as other convenience functions for composing queries, observing change `Flow`s, and creating indexes.
as well as other convenience functions for composing queries, mapping query results, creating documents, and observing
change `Flow`s.

### Installation

Expand Down Expand Up @@ -177,15 +178,6 @@ val usersFlow: Flow<List<User>> = query.asObjectsFlow { json: String ->
}
```

##### Index creation

Kotbase KTX provides concise top-level functions for index creation:

```kotlin
collection.createIndex("typeNameIndex", valueIndex("type", "name"))
collection.createIndex("overviewFTSIndex", fullTextIndex("overview"))
```

##### Replicator extensions

For the Android platform, you can bind the `Replicator` `start()` and `stop()` methods to be performed automatically
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ class PredictiveQueryTest : BaseQueryTest() {
Database.prediction.unregisterModel(model)
}

// TODO: frequently crashes during query in mingw
@IgnoreMingw
@Test
fun testPredictionInputOutput() {
// Register echo model:
Expand Down
14 changes: 3 additions & 11 deletions couchbase-lite-ktx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
## Couchbase Lite Community Edition – Kotlin Extensions

The KTX extensions include the excellent [Kotlin extensions by MOLO17](https://github.com/MOLO17/couchbase-lite-kotlin),
as well as other convenience functions for composing queries, observing change `Flow`s, and creating indexes.
as well as other convenience functions for composing queries, mapping query results, creating documents, and observing
change `Flow`s.

### Installation

Expand Down Expand Up @@ -156,7 +157,7 @@ val usersFlow: Flow<List<User>> = query.asObjectsFlow(::User)

##### JSON deserialization

Kotbase KTX also provides extensions for mapping documents from a JSON string to Kotlin class. This works well
Kotbase KTX also provides extensions for mapping documents from a JSON string to a Kotlin class. This works well
together with a serialization library, like [kotlinx-serialization](https://github.com/Kotlin/kotlinx.serialization), to
decode the JSON string to a Kotlin object.

Expand All @@ -177,15 +178,6 @@ val usersFlow: Flow<List<User>> = query.asObjectsFlow { json: String ->
}
```

##### Index creation

Kotbase KTX provides concise top-level functions for index creation:

```kotlin
collection.createIndex("typeNameIndex", valueIndex("type", "name"))
collection.createIndex("overviewFTSIndex", fullTextIndex("overview"))
```

##### Replicator extensions

For the Android platform, you can bind the `Replicator` `start()` and `stop()` methods to be performed automatically
Expand Down
12 changes: 2 additions & 10 deletions docs/site/ktx.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
The KTX extensions include the excellent [Kotlin extensions by MOLO17](https://github.com/MOLO17/couchbase-lite-kotlin),
as well as other convenience functions for composing queries, observing change `Flow`s, and creating indexes.
as well as other convenience functions for composing queries, mapping query results, creating documents, and observing
change `Flow`s.

## Installation

Expand Down Expand Up @@ -187,15 +188,6 @@ val usersFlow: Flow<List<User>> = query.asObjectsFlow { json: String ->
}
```

### Index creation

Kotbase KTX provides concise top-level functions for index creation:

```kotlin
collection.createIndex("typeNameIndex", valueIndex("type", "name"))
collection.createIndex("overviewFTSIndex", fullTextIndex("overview"))
```

### Replicator extensions

For the Android platform, you can bind the `Replicator` `start()` and `stop()` methods to be performed automatically
Expand Down
2 changes: 2 additions & 0 deletions docs/site/vector-search.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ _Use Vector Search to build adaptive and user-focused applications using Generat

## About Vector Search

!!! important "This is an [Enterprise Edition](https://www.couchbase.com/products/editions/mobile/) feature."

Vector Search is a technique to retrieve semantically similar items based on vector embedding representations of the
items in a multi-dimensional space. You can use Vector Search to find the top N items similar to a given item based on
their vector representations. Vector Search is an essential component of Generative AI and Predictive AI applications.
Expand Down
2 changes: 2 additions & 0 deletions docs/site/working-with-vector-search.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ _Use Vector Search with Full Text Search and Query._

## Use Vector Search

!!! important "This is an [Enterprise Edition](https://www.couchbase.com/products/editions/mobile/) feature."

To configure a project to use vector search, follow the [installation instructions](installation.md#vector-search) to
add the Vector Search extension.

Expand Down
5 changes: 5 additions & 0 deletions examples/getting-started-compose/composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ kotlin {
implementation(compose.foundation)
implementation(compose.material)
implementation(compose.ui)
implementation(libs.kotlinx.datetime)
}
androidMain.dependencies {
implementation(libs.compose.ui.tooling.preview)
Expand All @@ -46,6 +47,10 @@ kotlin {
jvmMain.dependencies {
implementation(compose.desktop.currentOs)
}

configureEach {
languageSettings.optIn("kotlin.time.ExperimentalTime")
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,11 @@ class SharedDbWork {
)

val repl = Replicator(
ReplicatorConfigurationFactory.newConfig(
target = URLEndpoint("ws://localhost:4984/getting-started-db"),
collections = mapOf(setOf(coll) to collConfig),
type = ReplicatorType.PUSH_AND_PULL,
authenticator = BasicAuthenticator("sync-gateway", "password".toCharArray())
)
ReplicatorConfiguration(URLEndpoint("ws://localhost:4984/getting-started-db"))
.addCollection(coll, collConfig).apply {
type = ReplicatorType.PUSH_AND_PULL
authenticator = BasicAuthenticator("sync-gateway", "password".toCharArray())
}
)

// Listen to replicator change events.
Expand Down
15 changes: 8 additions & 7 deletions examples/getting-started-compose/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[versions]
activity-compose = "1.10.1"
android-gradle-plugin = "8.11.1"
compose = "1.9.0"
compose-plugin = "1.8.2"
couchbase-lite-objc = "3.1.10"
kotbase = "3.1.11-1.1.2"
kotlin = "2.2.10"
activity-compose = "1.11.0"
android-gradle-plugin = "8.12.3"
compose = "1.9.4"
compose-plugin = "1.9.1"
couchbase-lite-objc = "3.2.4"
kotbase = "3.2.4-1.2.0"
kotlin = "2.2.21"

[plugins]
android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" }
Expand All @@ -18,3 +18,4 @@ androidx-activity-compose = { module = "androidx.activity:activity-compose", ver
compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }
compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" }
kotbase = { module = "dev.kotbase:couchbase-lite-ktx", version.ref = "kotbase" }
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version = "0.7.1" }

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "Collection.hh"
#include "Database.hh"
#include "Document.hh"
#include "LogSinks.hh"
#include "Prediction.hh"
#include "Query.hh"
#include "QueryIndex.hh"
Expand Down
Loading