MissingPy-0.10.6: Haskell interface to Python

MaintainerJohn Goerzen,
Safe HaskellNone

MissingPy.AnyDBM

Description

Maintainer : jgoerzen@complete.org Stability : provisional Portability: portable

This module interfaces Database.AnyDBM to Python's anydbm.py. Implementations for specific Python *dbm modules are also available.

See and import Database.AnyDBM to use these features.

Written by John Goerzen, jgoerzen@complete.org

Synopsis

Documentation

data PyDBMOpenFlags Source

Flags used to open a dbm-type database

Constructors

DBM_ReadOnly

Open an existing database for read only

DBM_ReadWrite

Open an existing database for reading and writing

DBM_ReadWriteCreate

Open a database for reading and writing, creating if it doesn't exist

DBM_ReadWriteNew

Open a database, creating it anew each time (deleting any existing data)

openAnyDBM :: FilePath -> PyDBMOpenFlags -> IO PyDictSource

Opens a persistent storage database using the "best" storage mechanism available to Python on this system. This will usually be one of the *dbm services, though in rare circumstances, could be "dumbdbm", which is only marginally better than Database.AnyDBM.StringDBM.

openSpecificDBMSource

Arguments

:: String

Python module name to use

-> FilePath

Path to database files

-> PyDBMOpenFlags

Flags to use when opening

-> IO PyDict

Result

Open a database using a specific module given by the first parameter. The module supported are:

  • dbhash
  • dbm
  • dumbdbm
  • gdbm

SECURITY NOTE: the string is not validated before being passed to Python. Do not pass an arbitrary value to this function.