  Ohm is © 2012  

open BatPervasives

module ImplDB = CouchDB_database
module ImplCache = CouchDB_cache
module ImplTypes = CouchDB_types
module ImplTable = CouchDB_table
module ImplViews = CouchDB_views

(* Database-related definitions ------------------------------------------------------------ *)

type database = ImplDB.t = {
  db_id     : int ;
  db_host   : string ;
  db_port   : int ;
  db_name   : string ;
  db_prefix : string
}

(* Cache-related definitions --------------------------------------------------------------- *)

exception CouchDB_Error = ImplCache.CouchDB_error
type implementation = ImplCache.t

(* Type-related definitions ---------------------------------------------------------------- *)

module Parser = CouchDB_parser
include ImplTypes

let ctx_decay (ctx : #ctx) = (ctx :> ctx)

class init_ctx = object
  val time = Unix.gettimeofday ()
  method time = time
  inherit ctx
end

(* Database and table definitions ---------------------------------------------------------- *)

module Database  = ImplTable.Database
module ReadTable = ImplTable.ReadTable
module Table     = ImplTable.Table

(* View-related definitions ---------------------------------------------------------------- *)

module ReduceView = ImplViews.ReduceView
module DocView    = ImplViews.DocView
module MapView    = ImplViews.MapView

(* Convenience module ---------------------------------------------------------------------- *)

module Convenience = CouchDB_convenience

(* Bind signals ---------------------------------------------------------------------------- *)

let week = 3600. *. 24. *. 7.

let () = Sig.listen Sig.Std.Bot.tick (Util.every week  ImplDB.compact) 
let () = Sig.listen Sig.Std.Put.once ImplViews.compile_views


 Database-related definitions ------------------------------------------------------------ 
 Cache-related definitions --------------------------------------------------------------- 
 Type-related definitions ---------------------------------------------------------------- 
 Database and table definitions ---------------------------------------------------------- 
 View-related definitions ---------------------------------------------------------------- 
 Convenience module ---------------------------------------------------------------------- 
 Bind signals ---------------------------------------------------------------------------- 
  Ohm is © 2012  

open BatPervasives

module ImplDB = CouchDB_database
module ImplCache = CouchDB_cache
module ImplTypes = CouchDB_types
module ImplTable = CouchDB_table
module ImplViews = CouchDB_views


type database = ImplDB.t = {
  db_id     : int ;
  db_host   : string ;
  db_port   : int ;
  db_name   : string ;
  db_prefix : string
}


exception CouchDB_Error = ImplCache.CouchDB_error
type implementation = ImplCache.t


module Parser = CouchDB_parser
include ImplTypes

let ctx_decay (ctx : #ctx) = (ctx :> ctx)

class init_ctx = object
  val time = Unix.gettimeofday ()
  method time = time
  inherit ctx
end


module Database  = ImplTable.Database
module ReadTable = ImplTable.ReadTable
module Table     = ImplTable.Table


module ReduceView = ImplViews.ReduceView
module DocView    = ImplViews.DocView
module MapView    = ImplViews.MapView


module Convenience = CouchDB_convenience


let week = 3600. *. 24. *. 7.

let () = Sig.listen Sig.Std.Bot.tick (Util.every week  ImplDB.compact) 
let () = Sig.listen Sig.Std.Put.once ImplViews.compile_views

