Skip to content

Commit

Permalink
Release 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfrog26 committed Dec 11, 2024
1 parent be40318 commit 4669041
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ Computationally focused database using pluggable stores

To add all modules:
```scala
libraryDependencies += "com.outr" %% "lightdb-all" % "1.0.0"
libraryDependencies += "com.outr" %% "lightdb-all" % "1.1.0"
```

For a specific implementation like Lucene:
```scala
libraryDependencies += "com.outr" %% "lightdb-lucene" % "1.0.0"
libraryDependencies += "com.outr" %% "lightdb-lucene" % "1.1.0"
```

## Videos
Expand Down Expand Up @@ -52,7 +52,7 @@ Ensure you have the following:
Add the following dependency to your `build.sbt` file:

```scala
libraryDependencies += "com.outr" %% "lightdb-all" % "1.0.0"
libraryDependencies += "com.outr" %% "lightdb-all" % "1.1.0"
```

---
Expand Down Expand Up @@ -128,7 +128,7 @@ Instantiate and initialize the database:

```scala
val db = new DB
// db: DB = repl.MdocSession$MdocApp$DB@7c34159c
// db: DB = repl.MdocSession$MdocApp$DB@2d599fa3
db.init()
// res0: Boolean = true
```
Expand All @@ -145,7 +145,7 @@ val adam = Person(name = "Adam", age = 21)
// city = None,
// nicknames = Set(),
// friends = List(),
// _id = Id(value = "bKaLE07r8AzMoAjBotiP0dDfo9n96I1q")
// _id = Id(value = "Kq2SaCpZ7spHyMnYT2IvmpbynonZEBR2")
// )
db.people.transaction { implicit transaction =>
db.people.insert(adam)
Expand All @@ -156,7 +156,7 @@ db.people.transaction { implicit transaction =>
// city = None,
// nicknames = Set(),
// friends = List(),
// _id = Id(value = "bKaLE07r8AzMoAjBotiP0dDfo9n96I1q")
// _id = Id(value = "Kq2SaCpZ7spHyMnYT2IvmpbynonZEBR2")
// )
```

Expand All @@ -169,7 +169,7 @@ db.people.transaction { implicit transaction =>
val peopleIn20s = db.people.query.filter(_.age BETWEEN 20 -> 29).toList
println(peopleIn20s)
}
// List(Person(Adam,21,None,Set(),List(),Id(V4HuAlFgFWP0bARChPFtCx5eqMCvtX7l)), Person(Adam,21,None,Set(),List(),Id(xxVmia6PxlkFL1nWWDNFKiO2KccbDrhv)), Person(Adam,21,None,Set(),List(),Id(eaQIHd0ZiDHjxWa9VXzhybMHWtH80C47)), Person(Adam,21,None,Set(),List(),Id(Mg3nibsB1wstqK1xEIiGNeU4Q5iw7Kfc)), Person(Adam,21,None,Set(),List(),Id(bKaLE07r8AzMoAjBotiP0dDfo9n96I1q)))
// List(Person(Adam,21,None,Set(),List(),Id(V4HuAlFgFWP0bARChPFtCx5eqMCvtX7l)), Person(Adam,21,None,Set(),List(),Id(xxVmia6PxlkFL1nWWDNFKiO2KccbDrhv)), Person(Adam,21,None,Set(),List(),Id(eaQIHd0ZiDHjxWa9VXzhybMHWtH80C47)), Person(Adam,21,None,Set(),List(),Id(Mg3nibsB1wstqK1xEIiGNeU4Q5iw7Kfc)), Person(Adam,21,None,Set(),List(),Id(bKaLE07r8AzMoAjBotiP0dDfo9n96I1q)), Person(Adam,21,None,Set(),List(),Id(Kq2SaCpZ7spHyMnYT2IvmpbynonZEBR2)))
```

---
Expand Down Expand Up @@ -204,7 +204,7 @@ db.people.transaction { implicit transaction =>
.toList
println(results)
}
// List(MaterializedAggregate({"ageMin": 21, "ageMax": 21, "ageAvg": 21.0, "ageSum": 105},repl.MdocSession$MdocApp$Person$@7b2728df))
// List(MaterializedAggregate({"ageMin": 21, "ageMax": 21, "ageAvg": 21.0, "ageSum": 126},repl.MdocSession$MdocApp$Person$@4373e521))
```

### Grouping
Expand All @@ -214,7 +214,7 @@ db.people.transaction { implicit transaction =>
val grouped = db.people.query.grouped(_.age).toList
println(grouped)
}
// List((21,List(Person(Adam,21,None,Set(),List(),Id(V4HuAlFgFWP0bARChPFtCx5eqMCvtX7l)), Person(Adam,21,None,Set(),List(),Id(xxVmia6PxlkFL1nWWDNFKiO2KccbDrhv)), Person(Adam,21,None,Set(),List(),Id(eaQIHd0ZiDHjxWa9VXzhybMHWtH80C47)), Person(Adam,21,None,Set(),List(),Id(Mg3nibsB1wstqK1xEIiGNeU4Q5iw7Kfc)), Person(Adam,21,None,Set(),List(),Id(bKaLE07r8AzMoAjBotiP0dDfo9n96I1q)))))
// List((21,List(Person(Adam,21,None,Set(),List(),Id(V4HuAlFgFWP0bARChPFtCx5eqMCvtX7l)), Person(Adam,21,None,Set(),List(),Id(xxVmia6PxlkFL1nWWDNFKiO2KccbDrhv)), Person(Adam,21,None,Set(),List(),Id(eaQIHd0ZiDHjxWa9VXzhybMHWtH80C47)), Person(Adam,21,None,Set(),List(),Id(Mg3nibsB1wstqK1xEIiGNeU4Q5iw7Kfc)), Person(Adam,21,None,Set(),List(),Id(bKaLE07r8AzMoAjBotiP0dDfo9n96I1q)), Person(Adam,21,None,Set(),List(),Id(Kq2SaCpZ7spHyMnYT2IvmpbynonZEBR2)))))
```

---
Expand All @@ -228,14 +228,14 @@ import lightdb.backup._
import java.io.File

DatabaseBackup.archive(db, new File("backup.zip"))
// res5: Int = 6
// res5: Int = 7
```

Restore from a backup:

```scala
DatabaseRestore.archive(db, new File("backup.zip"))
// res6: Int = 6
// res6: Int = 7
```

---
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ val developerURL: String = "https://matthicks.com"

name := projectName
ThisBuild / organization := org
ThisBuild / version := "1.1.0-SNAPSHOT"
ThisBuild / version := "1.1.0"
ThisBuild / scalaVersion := scala213
ThisBuild / crossScalaVersions := allScalaVersions
ThisBuild / scalacOptions ++= Seq("-unchecked", "-deprecation")
Expand Down
6 changes: 1 addition & 5 deletions lucene/src/main/scala/lightdb/lucene/LuceneStore.scala
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,7 @@ class LuceneStore[Doc <: Document[Doc], Model <: DocumentModel[Doc]](name: Strin

private def createGeoFields(field: Field[Doc, _],
json: Json,
add: LuceneField => Unit): Unit = if (json.isArr) {
json.asVector.foreach { json =>
createGeoFields(field, json, add)
}
} else {
add: LuceneField => Unit): Unit = {
field.className match {
case Some("lightdb.spatial.Geo.Point") =>
val p = json.as[Geo.Point]
Expand Down

0 comments on commit 4669041

Please sign in to comment.