aboutsummaryrefslogtreecommitdiffstats
path: root/lib/abstract/Storage.ml
blob: d0f2097e83efe8fb9eb36bf38a755c1f13d8a344 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module type STORAGE = sig
  type connection
  type transaction

  val connect: Concepts.Configuration.configuration -> connection

  (** begin a transaction within `connection` *)
  val start: connection -> transaction
  (** `commit` the current transaction *)
  val commit: transaction -> ()
  (** `abort` the current transaction *)
  val abort: transaction -> ()

  (** within a transaction, fetch a blob from disk *)
  val get: transaction -> Concepts.Hash.hash -> Concepts.Representation.blob
  (** within a transaction, associate a hash with a blob on disk *)
  val put: transaction -> Concepts.Hash.hash -> Concepts.Representation.blob -> ()
end