Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Version = V1
- data HeaderV1 = HeaderV1 {}
- data SchemaV1 = SchemaV1 {}
- schema_QualifiedTableName :: SchemaV1 -> ByteString
- data FieldInfoV1 = FieldInfoV1 {}
- data RecordIndicator
- data NullIndicator
- sizeOf :: Size a -> a -> Int
- writeVersion :: Version -> ByteString
- writeHeader :: HeaderV1 -> ByteString
- writeSchema :: SchemaV1 -> ByteString
- writeRI :: ByteString
- writeEOT :: ByteString
- writeNullIndicator :: NullIndicator -> ByteString
- data Chunk a = Chunk a (ForeignPtr Word8)
- writeChunk :: Int -> Int -> Ptr Word8 -> ByteString
- writePlainBuf :: Ptr Word8 -> Int -> ByteString
Documentation
dump file format version
dump file header for version 1
HeaderV1 | |
|
the schema reffers to the information about each field in one table
SchemaV1 | |
|
schema_QualifiedTableName :: SchemaV1 -> ByteString Source #
make a schema.table_name qualified table name
data FieldInfoV1 Source #
information about the name of the field, the length, precision, type, etc
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
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
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
a chunk of data consists of the length of the binary data and a pointer to the memory of the data
Chunk a (ForeignPtr Word8) |
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