flaw-oil-0.1.0.0

LicenseMIT
Safe HaskellNone
LanguageHaskell2010

Flaw.Oil.Repo

Description

 
Synopsis

Documentation

newtype RepoVersion Source #

Constructors

RepoVersion CInt 

serverRepoVersion :: RepoVersion Source #

"application_id" in SQLite db of server repo. Convention: oilstarting from A in little-endian.

clientRepoVersion :: RepoVersion Source #

"application_id" in SQLite db of client repo. Convention: oilstarting from a in little-endian.

data Manifest Source #

Manifest with most limitations.

Instances
Generic Manifest Source # 
Instance details

Defined in Flaw.Oil.Repo

Associated Types

type Rep Manifest :: Type -> Type #

Methods

from :: Manifest -> Rep Manifest x #

to :: Rep Manifest x -> Manifest #

Serialize Manifest Source # 
Instance details

Defined in Flaw.Oil.Repo

type Rep Manifest Source # 
Instance details

Defined in Flaw.Oil.Repo

type Rep Manifest = D1 (MetaData "Manifest" "Flaw.Oil.Repo" "flaw-oil-0.1.0.0-BOdTFj7IzZ4Bw65TIEcfdB" False) (C1 (MetaCons "Manifest" PrefixI True) ((S1 (MetaSel (Just "manifestProtocolVersion") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int32) :*: (S1 (MetaSel (Just "manifestMaxKeySize") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int) :*: S1 (MetaSel (Just "manifestMaxValueSize") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int))) :*: ((S1 (MetaSel (Just "manifestMaxPushItemsCount") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int) :*: S1 (MetaSel (Just "manifestMaxPushValuesTotalSize") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int)) :*: (S1 (MetaSel (Just "manifestMaxPullItemsCount") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int) :*: S1 (MetaSel (Just "manifestMaxPullValuesTotalSize") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int)))))

protocolVersion :: Int32 Source #

Current protocol version. Convention: oilstarting from 0 in little-endian.

type Revision = Int64 Source #

Type for revisions. Start revision is 1. 0 means no revisions.

type UserId = Int64 Source #

Type for user ID.

data Push Source #

Data sent by client to server.

Constructors

Push 

Fields

Instances
Generic Push Source # 
Instance details

Defined in Flaw.Oil.Repo

Associated Types

type Rep Push :: Type -> Type #

Methods

from :: Push -> Rep Push x #

to :: Rep Push x -> Push #

Serialize Push Source # 
Instance details

Defined in Flaw.Oil.Repo

Methods

put :: Putter Push #

get :: Get Push #

type Rep Push Source # 
Instance details

Defined in Flaw.Oil.Repo

type Rep Push = D1 (MetaData "Push" "Flaw.Oil.Repo" "flaw-oil-0.1.0.0-BOdTFj7IzZ4Bw65TIEcfdB" False) (C1 (MetaCons "Push" PrefixI True) (S1 (MetaSel (Just "pushClientRevision") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Revision) :*: (S1 (MetaSel (Just "pushClientUpperRevision") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Revision) :*: S1 (MetaSel (Just "pushItems") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(ByteString, ByteString)]))))

data Pull Source #

Data sent by server to client.

Constructors

Pull 

Fields

Instances
Generic Pull Source # 
Instance details

Defined in Flaw.Oil.Repo

Associated Types

type Rep Pull :: Type -> Type #

Methods

from :: Pull -> Rep Pull x #

to :: Rep Pull x -> Pull #

Serialize Pull Source # 
Instance details

Defined in Flaw.Oil.Repo

Methods

put :: Putter Pull #

get :: Get Pull #

type Rep Pull Source # 
Instance details

Defined in Flaw.Oil.Repo

checkPushLimits :: Manifest -> Push -> Maybe SyncError Source #

Check push limits.

data SyncError Source #

Errors while syncing (reported to client).

Instances
Generic SyncError Source # 
Instance details

Defined in Flaw.Oil.Repo

Associated Types

type Rep SyncError :: Type -> Type #

type Rep SyncError Source # 
Instance details

Defined in Flaw.Oil.Repo

type Rep SyncError = D1 (MetaData "SyncError" "Flaw.Oil.Repo" "flaw-oil-0.1.0.0-BOdTFj7IzZ4Bw65TIEcfdB" False) ((C1 (MetaCons "SyncTooManyItemsError" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "SyncTooBigKeyError" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "SyncTooBigValueError" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "SyncTooBigPushValuesTotalSize" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "SyncFatalError" PrefixI False) (U1 :: Type -> Type))))

class Repo r where Source #

Methods

repoDb :: r -> SqliteDb Source #

Get SQLite DB.

Instances
Repo ClientRepo Source # 
Instance details

Defined in Flaw.Oil.ClientRepo

Repo ServerRepo Source # 
Instance details

Defined in Flaw.Oil.ServerRepo

repoDbCheckIntegrity :: SqliteDb -> IO (Bool, Text) Source #

Check integrity of DB.

repoDbVacuum :: SqliteDb -> IO () Source #

Optimize DB.