view demo/more/versioned.urs @ 2209:0ca11d57c175

Cleans up interface (it's now a command line option) and renames project to "sqlcache" in the all-one-word style. Still has issues to do with concurrency, retrying transactions, and foreign function calls that either rely on state or have side effects.
author Ziv Scully <ziv@mit.edu>
date Sat, 31 May 2014 03:08:16 -0400
parents 166ea3944b91
children
line wrap: on
line source
functor Make(M : sig
                 con key :: {Type}
                 con data :: {Type}
                 constraint key ~ data
                 constraint [When, Version] ~ (key ++ data)

                 val key : $(map sql_injectable key)
                 val data : $(map (fn t => {Inj : sql_injectable_prim t,
                                            Eq : eq t}) data)

                 val keyFolder : folder key
                 val dataFolder : folder data
             end) : sig
    val insert : $(M.key ++ M.data) -> transaction unit
    val update : $(M.key ++ M.data) -> transaction unit

    val keys : transaction (list $M.key)
    val current : $M.key -> transaction (option $M.data)

    type version
    val keysAt : version -> transaction (list $M.key)
    val archive : version -> $M.key -> transaction (option $M.data)
    val updateTimes : transaction (list (version * time))
end