From 046ab2d6963dfa9a212714add1561a6ddf516841 Mon Sep 17 00:00:00 2001 From: Matt Hicks Date: Mon, 2 Dec 2024 12:10:32 -0600 Subject: [PATCH] Release 1.0.0 --- README.md | 22 +++++++++---------- build.sbt | 4 ++-- .../scala/lightdb/lucene/LuceneStore.scala | 2 +- .../sql/connect/HikariConnectionManager.scala | 1 - 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 50ce47d3..ebc3c02b 100644 --- a/README.md +++ b/README.md @@ -19,12 +19,12 @@ Computationally focused database using pluggable stores To add all modules: ```scala -libraryDependencies += "com.outr" %% "lightdb-all" % "0.17.0" +libraryDependencies += "com.outr" %% "lightdb-all" % "1.0.0" ``` For a specific implementation like Lucene: ```scala -libraryDependencies += "com.outr" %% "lightdb-lucene" % "0.17.0" +libraryDependencies += "com.outr" %% "lightdb-lucene" % "1.0.0" ``` ## Videos @@ -52,7 +52,7 @@ Ensure you have the following: Add the following dependency to your `build.sbt` file: ```scala -libraryDependencies += "com.outr" %% "lightdb-all" % "0.17.0" +libraryDependencies += "com.outr" %% "lightdb-all" % "1.0.0" ``` --- @@ -128,7 +128,7 @@ Instantiate and initialize the database: ```scala val db = new DB -// db: DB = repl.MdocSession$MdocApp$DB@6cd11793 +// db: DB = repl.MdocSession$MdocApp$DB@7c34159c db.init() // res0: Boolean = true ``` @@ -145,7 +145,7 @@ val adam = Person(name = "Adam", age = 21) // city = None, // nicknames = Set(), // friends = List(), -// _id = Id(value = "Mg3nibsB1wstqK1xEIiGNeU4Q5iw7Kfc") +// _id = Id(value = "bKaLE07r8AzMoAjBotiP0dDfo9n96I1q") // ) db.people.transaction { implicit transaction => db.people.insert(adam) @@ -156,7 +156,7 @@ db.people.transaction { implicit transaction => // city = None, // nicknames = Set(), // friends = List(), -// _id = Id(value = "Mg3nibsB1wstqK1xEIiGNeU4Q5iw7Kfc") +// _id = Id(value = "bKaLE07r8AzMoAjBotiP0dDfo9n96I1q") // ) ``` @@ -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))) +// 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))) ``` --- @@ -204,7 +204,7 @@ db.people.transaction { implicit transaction => .toList println(results) } -// List(MaterializedAggregate({"ageMin": 21, "ageMax": 21, "ageAvg": 21.0, "ageSum": 84},repl.MdocSession$MdocApp$Person$@5e5c66af)) +// List(MaterializedAggregate({"ageMin": 21, "ageMax": 21, "ageAvg": 21.0, "ageSum": 105},repl.MdocSession$MdocApp$Person$@7b2728df)) ``` ### Grouping @@ -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))))) +// 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))))) ``` --- @@ -228,14 +228,14 @@ import lightdb.backup._ import java.io.File DatabaseBackup.archive(db, new File("backup.zip")) -// res5: Int = 5 +// res5: Int = 6 ``` Restore from a backup: ```scala DatabaseRestore.archive(db, new File("backup.zip")) -// res6: Int = 5 +// res6: Int = 6 ``` --- diff --git a/build.sbt b/build.sbt index 45456608..95e591c6 100644 --- a/build.sbt +++ b/build.sbt @@ -15,7 +15,7 @@ val developerURL: String = "https://matthicks.com" name := projectName ThisBuild / organization := org -ThisBuild / version := "1.0.0-SNAPSHOT" +ThisBuild / version := "1.0.0" ThisBuild / scalaVersion := scala213 ThisBuild / crossScalaVersions := allScalaVersions ThisBuild / scalacOptions ++= Seq("-unchecked", "-deprecation") @@ -98,7 +98,7 @@ lazy val root = project.in(file(".")) publishLocal := {} ) -lazy val core = crossProject(JVMPlatform) // TODO: Add JSPlatform and NativePlatform +lazy val core = crossProject(JVMPlatform) .crossType(CrossType.Pure) .settings( name := s"$projectName-core", diff --git a/lucene/src/main/scala/lightdb/lucene/LuceneStore.scala b/lucene/src/main/scala/lightdb/lucene/LuceneStore.scala index 0c224c22..6bf374c1 100644 --- a/lucene/src/main/scala/lightdb/lucene/LuceneStore.scala +++ b/lucene/src/main/scala/lightdb/lucene/LuceneStore.scala @@ -67,7 +67,7 @@ class LuceneStore[Doc <: Document[Doc], Model <: DocumentModel[Doc]](directory: val latest = Version.LATEST if (latest != dataVersion) { // TODO: Support re-indexing - scribe.info(s"Data Version: $dataVersion, Latest Version: $latest") + scribe.warn(s"Data Version: $dataVersion, Latest Version: $latest") } } } diff --git a/sql/src/main/scala/lightdb/sql/connect/HikariConnectionManager.scala b/sql/src/main/scala/lightdb/sql/connect/HikariConnectionManager.scala index 798f7a81..e69cc6fe 100644 --- a/sql/src/main/scala/lightdb/sql/connect/HikariConnectionManager.scala +++ b/sql/src/main/scala/lightdb/sql/connect/HikariConnectionManager.scala @@ -11,7 +11,6 @@ case class HikariConnectionManager(config: SQLConfig) extends DataSourceConnecti config.password.foreach(hc.setPassword) config.maximumPoolSize.foreach(hc.setMaximumPoolSize) hc.setAutoCommit(config.autoCommit) - // TODO: Configure hc.addDataSourceProperty("cachePrepStmts", "true") hc.addDataSourceProperty("prepStmtCacheSize", "250") hc.addDataSourceProperty("prepStmtCacheSqlLimit", "2048")