CompositeTypeSerialiser

The default serialiser for any composite type (structs and classes)

For custom types, the data representation is the following

First 4 bytes are an int representing the number of members After that, the members are listed in the following way: - OID - length - value

Members

Static functions

addCustomOid
void addCustomOid(string typeName, Oid oid)
Undocumented in source. Be warned that the author may not have intended to support it.
deserialise
T deserialise(const(ubyte)[] bytes)
Undocumented in source. Be warned that the author may not have intended to support it.
enforceSupportedType
void enforceSupportedType()
Undocumented in source. Be warned that the author may not have intended to support it.
ensureExistence
void ensureExistence(Connection conn)
Undocumented in source. Be warned that the author may not have intended to support it.
isSupportedType
bool isSupportedType()

Only accepts structs and classes, will fail on Nullable or Typedef types which should be taken care of by toBytes function.

nameForType
string nameForType()
Undocumented in source. Be warned that the author may not have intended to support it.
oidForType
Oid oidForType()
Undocumented in source. Be warned that the author may not have intended to support it.
serialise
Nullable!(ubyte[]) serialise(T val)
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

(bytes, decimal) [0 0 0 2 , 0 0 0 23 , 0 0 0 4 , 0 0 0 1 , 0 0 0 23 , 0 0 0 4 , 0 0 0 2] will represent a struct with two members, both OID 23, length 4, with values 1 and 2

Meta