Skip to content

Commit

Permalink
Started adding SQLiteSupport
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfrog26 committed Apr 10, 2024
1 parent 574e5b6 commit 544f55e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
19 changes: 16 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,16 @@ val collectionCompatVersion: String = "2.11.0"
val haloDBVersion: String = "v0.5.6"
val catsEffectVersion: String = "3.5.4"
val fabricVersion: String = "1.14.2"
val fs2Version: String = "3.10.1"
val fs2Version: String = "3.10.2"
val scribeVersion: String = "3.13.2"
val luceneVersion: String = "9.10.0"
val sqliteVersion: String = "3.45.2.0"

val scalaTestVersion: String = "3.2.18"
val catsEffectTestingVersion: String = "1.5.0"

lazy val root = project.in(file("."))
.aggregate(core, lucene)
.aggregate(core, lucene, sqlite)
.settings(
name := projectName,
publish := {},
Expand Down Expand Up @@ -106,6 +107,18 @@ lazy val lucene = project.in(file("lucene"))
)
)

lazy val sqlite = project.in(file("sqlite"))
.dependsOn(core)
.settings(
name := s"$projectName-sqlite",
fork := true,
libraryDependencies ++= Seq(
"org.xerial" % "sqlite-jdbc" % sqliteVersion,
"org.scalatest" %% "scalatest" % scalaTestVersion % Test,
"org.typelevel" %% "cats-effect-testing-scalatest" % catsEffectTestingVersion % Test
)
)

lazy val benchmark = project.in(file("benchmark"))
.dependsOn(core)
.settings(
Expand All @@ -116,7 +129,7 @@ lazy val benchmark = project.in(file("benchmark"))
"org.mongodb" % "mongodb-driver-sync" % "5.0.1",
"org.postgresql" % "postgresql" % "42.7.3",
"org.mariadb.jdbc" % "mariadb-java-client" % "3.3.3",
"org.xerial" % "sqlite-jdbc" % "3.45.2.0",
"org.xerial" % "sqlite-jdbc" % sqliteVersion,
"com.outr" %% "scarango-driver" % "3.20.0"
)
)
25 changes: 25 additions & 0 deletions sqlite/src/main/scala/lightdb/sqlite/SQLiteSupport.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package lightdb.sqlite

import cats.effect.IO
import lightdb.{Document, Id}
import lightdb.index.{IndexSupport, Indexer}
import lightdb.query.{PagedResults, Query, SearchContext}

trait SQLiteSupport[D <: Document[D]] extends IndexSupport[D] {
override lazy val index: SQLiteIndexer[D] = SQLiteIndexer(this)

override def doSearch(query: Query[D],
context: SearchContext[D],
offset: Int,
after: Option[PagedResults[D]]): IO[PagedResults[D]] = ???
}

case class SQLiteIndexer[D <: Document[D]](indexSupport: IndexSupport[D]) extends Indexer[D] {
override def withSearchContext[Return](f: SearchContext[D] => IO[Return]): IO[Return] = ???

override def count(): IO[Int] = ???

override private[lightdb] def delete(id: Id[D]): IO[Unit] = ???

override def commit(): IO[Unit] = ???
}

0 comments on commit 544f55e

Please sign in to comment.