transfer-db-0.3.1.2: ODBC database transfer

Safe HaskellNone
LanguageHaskell2010

Database.TransferDB.DumpDB.Format

Contents

Synopsis

Documentation

data Version Source #

dump file format version

Constructors

V1 

Instances

data HeaderV1 Source #

dump file header for version 1

Constructors

HeaderV1 

Fields

data SchemaV1 Source #

the schema reffers to the information about each field in one table

Constructors

SchemaV1 

Fields

data RecordIndicator Source #

there are 2 types of record indicators: * RI means that the following data is a new record in the current table; * EOT (end of table) means that there is no more data for the current table

The current table is defined by the previous SCHEMA block in the dump file

Constructors

RI 
EOT 

data NullIndicator Source #

indicates if a nullable field is Null or not Null; it is the first byte in encoded field value, only for fields that are nullable; non-nullable fields have no null indicator

Constructors

Null 
NotNull 

sizeOf :: Size a -> a -> Int Source #

helper function to compute the store size in bytes of a value

writeVersion :: Version -> ByteString Source #

the version is written as an Word8 length followed by the version

writeHeader :: HeaderV1 -> ByteString Source #

the header is written as an Word16 length followed by the header itself

writeSchema :: SchemaV1 -> ByteString Source #

the schema is written as an Word32 length followed by the encoded schema

writeRI :: ByteString Source #

write an RI record indicator

writeEOT :: ByteString Source #

write an EOT record indicator

writeNullIndicator :: NullIndicator -> ByteString Source #

write a null indicator

data Chunk a Source #

a chunk of data consists of the length of the binary data and a pointer to the memory of the data

Constructors

Chunk a (ForeignPtr Word8) 

Instances

(Integral a, Store a) => Store (Chunk a) Source # 

Methods

size :: Size (Chunk a) #

poke :: Chunk a -> Poke () #

peek :: Peek (Chunk a) #

writeChunk :: Int -> Int -> Ptr Word8 -> ByteString Source #

write a chunk of binary data; the chunk has a length field followed by the binary data; the length field may be on 1, 2 or 4 bytes; the first parameter is the length in bytes of the length field, the second parameter is the length in bytes of the data

writePlainBuf :: Ptr Word8 -> Int -> ByteString Source #

encodes the memory buffer into a ByteString

Orphan instances

Eq (Size a) Source #

declare type Size as instance of Eq class to be used in test cases

Methods

(==) :: Size a -> Size a -> Bool #

(/=) :: Size a -> Size a -> Bool #

Show (Size a) Source #

declare type Size as instance of Show class to be used in the tests and log messages

Methods

showsPrec :: Int -> Size a -> ShowS #

show :: Size a -> String #

showList :: [Size a] -> ShowS #