tokyocabinet-haskell-0.0.5: Haskell binding of Tokyo Cabinet

Safe Haskell | None

Database.TokyoCabinet.TDB.Query

Synopsis

- data Condition
  - = QCSTREQ
  - | QCSTRINC
  - | QCSTRBW
  - | QCSTREW
  - | QCSTRAND
  - | QCSTROR
  - | QCSTROREQ
  - | QCSTRRX
  - | QCNUMEQ
  - | QCNUMGT
  - | QCNUMGE
  - | QCNUMLT
  - | QCNUMLE
  - | QCNUMBT
  - | QCNUMOREQ
  - | QCNEGATE Condition
  - | QCNOIDX Condition
- data OrderType
  - = QOSTRASC
  - | QOSTRDESC
  - | QONUMASC
  - | QONUMDESC
- data PostTreatment m k v
  - = QPPUT (m k v)
  - | QPOUT
  - | QPNOP
  - | QPSTOP
- new :: TDB -> IO TDBQRY
- delete :: TDBQRY -> IO ()
- addcond :: (Storable k, Storable v) => TDBQRY -> k -> Condition -> v -> IO ()
- setorder :: Storable k => TDBQRY -> k -> OrderType -> IO ()
- setlimit :: TDBQRY -> Int -> Int -> IO ()
- search :: (Storable k, Sequence q) => TDBQRY -> IO (q k)
- searchout :: TDBQRY -> IO Bool
- hint :: TDBQRY -> IO String
- proc :: (Storable k, Storable v, Associative m) => TDBQRY -> (v -> m k v -> IO (PostTreatment m k v)) -> IO Bool

# Documentation

data Condition Source

Constructors

QCSTREQ |
QCSTRINC |
QCSTRBW |
QCSTREW |
QCSTRAND |
QCSTROR |
QCSTROREQ |
QCSTRRX |
QCNUMEQ |
QCNUMGT |
QCNUMGE |
QCNUMLT |
QCNUMLE |
QCNUMBT |
QCNUMOREQ |
QCNEGATE Condition |
QCNOIDX Condition |

Instances

Eq Condition |
Ord Condition |
Show Condition |

data OrderType Source

Constructors

QOSTRASC |
QOSTRDESC |
QONUMASC |
QONUMDESC |

Instances

Eq OrderType |
Ord OrderType |
Show OrderType |

data PostTreatment m k v Source

Constructors

QPPUT (m k v) |
QPOUT |
QPNOP |
QPSTOP |

Instances

Eq (m k v) => Eq (PostTreatment m k v) |
Ord (m k v) => Ord (PostTreatment m k v) |
Show (m k v) => Show (PostTreatment m k v) |

new :: TDB -> IO TDBQRY Source

Create a query object.

delete :: TDBQRY -> IO ()Source

Free object resource forcibly.

addcond :: (Storable k, Storable v) => TDBQRY -> k -> Condition -> v -> IO ()Source

Add a narrowing condition to a query object.

setorder :: Storable k => TDBQRY -> k -> OrderType -> IO ()Source

Set the order of a query object.

setlimit :: TDBQRY -> Int -> Int -> IO ()Source

Set the limit number of records of the result of a query object.

search :: (Storable k, Sequence q) => TDBQRY -> IO (q k)Source

Execute the search of a query object. The return value is a list object of the primary keys of the corresponding records.

searchout :: TDBQRY -> IO Bool Source

Remove each record corresponding to a query object.

hint :: TDBQRY -> IO String Source

proc Source

Arguments

:: (Storable k, Storable v, Associative m) |
=> TDBQRY | Query object.
-> (v -> m k v -> IO (PostTreatment m k v)) | the iterator function called for each record.
-> IO Bool | If successful, the return value is true, else, it is false.

Process each record corresponding to a query object.