MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DBA_ColumnBinding Struct Reference

#include <dba.h>

Collaboration diagram for DBA_ColumnBinding:

Public Attributes

const char * Name
DBA_DataTypes_t DataType
Size_t Size
Size_t Offset
Boolean_t Ptr
struct DBA_ColumnBindingSubBinding

Detailed Description

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); 

Definition at line 235 of file dba.h.

Member Data Documentation

DBA_DataTypes_t DBA_ColumnBinding::DataType

Type of member in structure

Definition at line 237 of file dba.h.

const char* DBA_ColumnBinding::Name

Name of table column

Definition at line 236 of file dba.h.

Size_t DBA_ColumnBinding::Offset

Offset of the member

Definition at line 241 of file dba.h.

Boolean_t DBA_ColumnBinding::Ptr

True if binding is of ptr type

Definition at line 243 of file dba.h.

Size_t DBA_ColumnBinding::Size

Size in bytes of member or no of DBA_ColumnBinding's when doing ptr binding

Definition at line 238 of file dba.h.

struct DBA_ColumnBinding* DBA_ColumnBinding::SubBinding

Address of Binding Ptr valid if Ptr is true

Definition at line 244 of file dba.h.


The documentation for this struct was generated from the following file: