MySQL 8.4.3
Source Code Documentation

Functions for serializing (with complete header) and deserializing the dd object which supports this. More...

Collaboration diagram for (De)serialize api functions.:

Typedefs

using dd::SdiCompatibilityChecker = std::function< bool(const RJ_Document &)>
 Type alias for std::function wrapping a callable to check if SDI, as an RJ_Document, is compatible. More...
 

Functions

Sdi_type dd::serialize (const Schema &schema)
 Serialize a Schema object. More...
 
bool dd::deserialize (THD *thd, const Sdi_type &sdi, Table *table, String_type *deser_schema_name=nullptr)
 Deserialize a dd::Table object. More...
 
bool dd::deserialize (THD *thd, const Sdi_type &sdi, Tablespace *tablespace)
 Deserialize a dd::Tablespace object. More...
 
Sdi_type dd::serialize (THD *thd, const Table &table, const String_type &schema_name)
 Serialize a Table object. More...
 
Sdi_type dd::serialize (const Tablespace &tablespace)
 Serialize a Tablespace object. More...
 
bool dd::CheckDefaultCompatibility (const RJ_Document &doc)
 Default checker which implements the traditional (strict) compatibility check: MYSQL_VERSION less than or equal, dd_version equal, and sdi_version equal. More...
 
template<class Dd_type >
bool dd::generic_deserialize (THD *thd, const Sdi_type &sdi, const String_type &object_type_name, Dd_type *dst, const SdiCompatibilityChecker &comp_checker, String_type *schema_name_from_sdi)
 
bool dd::deserialize (THD *thd, const Sdi_type &sdi, Table *dst_table, SdiCompatibilityChecker comp_checker, String_type *deser_schema_name)
 Deserialize a dd::Table object. More...
 
bool dd::deserialize (THD *thd, const Sdi_type &sdi, Tablespace *dst_tablespace, SdiCompatibilityChecker comp_checker)
 Deserialize a dd::Tablespace object. More...
 

Detailed Description

Functions for serializing (with complete header) and deserializing the dd object which supports this.

Typedef Documentation

◆ SdiCompatibilityChecker

using dd::SdiCompatibilityChecker = typedef std::function<bool(const RJ_Document &)>

Type alias for std::function wrapping a callable to check if SDI, as an RJ_Document, is compatible.

Normal MySQL error handling. Return value: false => success, true => error in DA.

Function Documentation

◆ CheckDefaultCompatibility()

bool dd::CheckDefaultCompatibility ( const RJ_Document doc)

Default checker which implements the traditional (strict) compatibility check: MYSQL_VERSION less than or equal, dd_version equal, and sdi_version equal.

◆ deserialize() [1/4]

bool dd::deserialize ( THD thd,
const Sdi_type sdi,
Table dst_table,
SdiCompatibilityChecker  comp_checker,
String_type deser_schema_name 
)

Deserialize a dd::Table object.

Populates the dd::Table object provided with data from sdi string. Note! Additional objects are dynamically allocated and added to the top-level Schema object, which assumes ownership.

Parameters
thdthread context
sdiserialized representation of schema (as a json string)
dst_tableempty top-level object
comp_checkercallable which will be used to determine if the SDI is compatible
deser_schema_namename of schema containing the table
Returns
error status
Return values
falseif successful
trueotherwise

◆ deserialize() [2/4]

bool dd::deserialize ( THD thd,
const Sdi_type sdi,
Table table,
String_type deser_schema_name = nullptr 
)
inline

Deserialize a dd::Table object.

Populates the dd::Table object provided with data from sdi string. Note! Additional objects are dynamically allocated and added to the top-level Schema object, which assumes ownership.

Note
Uses the default strict compatibility checking,
See also
DefaultCheckCompatibility
Parameters
thdthread context
sdiserialized representation of schema (as a json string)
tableempty top-level object
deser_schema_namename of schema containing the table
Returns
error status
Return values
falseif successful
trueotherwise

◆ deserialize() [3/4]

bool dd::deserialize ( THD thd,
const Sdi_type sdi,
Tablespace dst_tablespace,
SdiCompatibilityChecker  comp_checker 
)

Deserialize a dd::Tablespace object.

Populates the dd::Tablespace object provided with data from sdi string. Note! Additional objects are dynamically allocated and added to the top-level Tablespace object, which assumes ownership.

Parameters
thdthread context
sdiserialized representation of schema (as a json string)
dst_tablespaceempty top-level object
comp_checkercallable which will be used to determine if the SDI is compatible.
Returns
error status
Return values
falseif successful
trueotherwise

◆ deserialize() [4/4]

bool dd::deserialize ( THD thd,
const Sdi_type sdi,
Tablespace tablespace 
)
inline

Deserialize a dd::Tablespace object.

Populates the dd::Tablespace object provided with data from sdi string. Note! Additional objects are dynamically allocated and added to the top-level Tablespace object, which assumes ownership.

Note
Uses the default strict compatibility checking,
See also
DefaultCheckCompatibility
Parameters
thdthread context
sdiserialized representation of schema (as a json string)
tablespaceempty top-level object
Returns
error status
Return values
falseif successful
trueotherwise

◆ generic_deserialize()

template<class Dd_type >
bool dd::generic_deserialize ( THD thd,
const Sdi_type sdi,
const String_type object_type_name,
Dd_type *  dst,
const SdiCompatibilityChecker comp_checker,
String_type schema_name_from_sdi 
)

◆ serialize() [1/3]

Sdi_type dd::serialize ( const Schema schema)

Serialize a Schema object.

Parameters
schemadobject which will be serialized
Returns
sdi (as json string).

◆ serialize() [2/3]

Sdi_type dd::serialize ( const Tablespace tablespace)

Serialize a Tablespace object.

Parameters
tablespaceobject which will be serialized
Returns
sdi (as json string).

◆ serialize() [3/3]

Sdi_type dd::serialize ( THD thd,
const Table table,
const String_type schema_name 
)

Serialize a Table object.

Parameters
thdthread context
tableobject which will be serialized
schema_namename of the schema
Returns
sdi (as json string).