Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfrog26 committed Mar 24, 2024
1 parent ae71edc commit ad61ed4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
8 changes: 0 additions & 8 deletions mapdb/src/main/scala/lighdb/storage/mapdb/MapDBStore.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,4 @@ case class MapDBStore(directory: Option[Path]) extends ObjectStore {
override def commit(): IO[Unit] = IO(db.commit())

override def truncate(): IO[Unit] = IO(map.clear())
}

trait SharedMapDBSupport extends ObjectStoreSupport {
this: LightDB =>

private lazy val shared: MapDBStore = MapDBStore(directory.map(_.resolve("store")))

override def store[D <: Document[D]](collection: Collection[D]): ObjectStore = shared
}
13 changes: 13 additions & 0 deletions mapdb/src/main/scala/lighdb/storage/mapdb/SharedMapDBSupport.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package lighdb.storage.mapdb

import lightdb.collection.Collection
import lightdb.store.{ObjectStore, ObjectStoreSupport}
import lightdb.{Document, LightDB}

trait SharedMapDBSupport extends ObjectStoreSupport {
this: LightDB =>

private lazy val shared: MapDBStore = MapDBStore(directory.map(_.resolve("store")))

override def store[D <: Document[D]](collection: Collection[D]): ObjectStore = shared
}

0 comments on commit ad61ed4

Please sign in to comment.