MySQL 5.6.14 Source Code Document
|
#include <dba.h>
Public Attributes | |
const char * | Name |
DBA_DataTypes_t | DataType |
Size_t | Size |
Size_t | Offset |
Boolean_t | Ptr |
struct DBA_ColumnBinding * | SubBinding |
The DBA_ColumnBinding_t is used to describe a binding between one column and one field of a C struct.
typedef struct Address { char StreetName[30]; int StreetNumber; } Address_t;
typdef struct Person { char Name[30]; Address_t * AddressPtr; } Person_t;
For example, if the field Name of a Person_t data structure is bound to the column "NAME", the corresponding binding would be defined as:
DBA_ColumnBinding_t NameBinding = DBA_BINDING( "name", DBA_CHAR, Person_t, Name );
There is also the DBA_BINDING_PTR which is used when several linked structures should be put into one table.
For example, if data in a Person_t data structure should be saved in the same table as the Address_t data structure (as the address belongs to the person), the corresponding binding would be defined as:
DBA_ColumnBinding_t AddrBinding[AddrLen]; This binding describes how the fields in the Address_t structure is linked to the table PERSON_ADDRESS
DBA_ColumnBinding_t AddressBinding = DBA_BINDING_PTR(Person_t, AddressPtr, AddrBinding, AddrLen);
DBA_DataTypes_t DBA_ColumnBinding::DataType |
Boolean_t DBA_ColumnBinding::Ptr |
Size_t DBA_ColumnBinding::Size |
Size in bytes of member or no of DBA_ColumnBinding's when doing ptr binding
struct DBA_ColumnBinding* DBA_ColumnBinding::SubBinding |