#include <drizzled/common_fwd.h>
#include <drizzled/common.h>
#include <drizzled/message/table.pb.h>
#include <string>
#include <vector>
Go to the source code of this file.
|
| namespace | drizzled |
| | TODO: Rename this file - func.h is stupid.
|
|
| enum TransformSqlError | drizzled::message::transformStatementToSql (const Statement &source, vector< string > &sql_strings, enum TransformSqlVariant sql_variant, bool already_in_transaction) |
| enum TransformSqlError | drizzled::message::transformInsertStatementToSql (const InsertHeader &header, const InsertData &data, string &destination, enum TransformSqlVariant sql_variant) |
| enum TransformSqlError | drizzled::message::transformInsertRecordToSql (const InsertHeader &header, const InsertRecord &record, string &destination, enum TransformSqlVariant sql_variant) |
| enum TransformSqlError | drizzled::message::transformInsertHeaderToSql (const InsertHeader &header, string &destination, enum TransformSqlVariant sql_variant) |
| enum TransformSqlError | drizzled::message::transformUpdateHeaderToSql (const UpdateHeader &header, string &destination, enum TransformSqlVariant sql_variant) |
| enum TransformSqlError | drizzled::message::transformUpdateRecordToSql (const UpdateHeader &header, const UpdateRecord &record, string &destination, enum TransformSqlVariant sql_variant) |
| enum TransformSqlError | drizzled::message::transformDeleteStatementToSql (const DeleteHeader &header, const DeleteData &data, string &destination, enum TransformSqlVariant sql_variant) |
| enum TransformSqlError | drizzled::message::transformDeleteRecordToSql (const DeleteHeader &header, const DeleteRecord &record, string &destination, enum TransformSqlVariant sql_variant) |
| enum TransformSqlError | drizzled::message::transformDeleteHeaderToSql (const DeleteHeader &header, string &destination, enum TransformSqlVariant sql_variant) |
| enum TransformSqlError | drizzled::message::transformDropTableStatementToSql (const DropTableStatement &statement, string &destination, enum TransformSqlVariant sql_variant) |
| enum TransformSqlError | drizzled::message::transformTruncateTableStatementToSql (const TruncateTableStatement &statement, string &destination, enum TransformSqlVariant sql_variant) |
| enum TransformSqlError | drizzled::message::transformCreateSchemaStatementToSql (const CreateSchemaStatement &statement, string &destination, enum TransformSqlVariant sql_variant) |
| enum TransformSqlError | drizzled::message::transformDropSchemaStatementToSql (const DropSchemaStatement &statement, string &destination, enum TransformSqlVariant sql_variant) |
| enum TransformSqlError | drizzled::message::transformAlterSchemaStatementToSql (const AlterSchemaStatement &statement, string &destination, enum TransformSqlVariant sql_variant) |
| enum TransformSqlError | drizzled::message::transformSetVariableStatementToSql (const SetVariableStatement &statement, string &destination, enum TransformSqlVariant sql_variant) |
| enum TransformSqlError | drizzled::message::transformCreateTableStatementToSql (const CreateTableStatement &statement, string &destination, enum TransformSqlVariant sql_variant) |
| enum TransformSqlError | drizzled::message::transformTableDefinitionToSql (const Table &table, string &destination, enum TransformSqlVariant sql_variant, bool with_schema) |
| enum TransformSqlError | drizzled::message::transformTableOptionsToSql (const Table::TableOptions &options, string &destination, enum TransformSqlVariant sql_variant) |
| enum TransformSqlError | drizzled::message::transformIndexDefinitionToSql (const Table::Index &index, const Table &table, string &destination, enum TransformSqlVariant sql_variant) |
| enum TransformSqlError | drizzled::message::transformForeignKeyConstraintDefinitionToSql (const Table::ForeignKeyConstraint &fkey, const Table &, string &destination, enum TransformSqlVariant sql_variant) |
| enum TransformSqlError | drizzled::message::transformFieldDefinitionToSql (const Table::Field &field, string &destination, enum TransformSqlVariant sql_variant) |
| bool | drizzled::message::shouldQuoteFieldValue (Table::Field::FieldType in_type) |
| Table::Field::FieldType | drizzled::message::internalFieldTypeToFieldProtoType (enum enum_field_types type) |
| bool | drizzled::message::transactionContainsBulkSegment (const Transaction &transaction) |
Declarations of various routines that can be used to convert Transaction messages to other formats, including SQL statements.
Definition in file statement_transform.h.
◆ TransformSqlError
◆ TransformSqlVariant
◆ internalFieldTypeToFieldProtoType()
| drizzled::message::Table::Field::FieldType drizzled::message::internalFieldTypeToFieldProtoType |
( |
enum enum_field_types | type | ) |
|
◆ shouldQuoteFieldValue()
| bool drizzled::message::shouldQuoteFieldValue |
( |
Table::Field::FieldType | in_type | ) |
|
Returns true if the supplied message::Table::Field::FieldType should have its values quoted when modifying values.
- Parameters
-
Definition at line 1568 of file statement_transform.cc.
◆ transactionContainsBulkSegment()
| bool drizzled::message::transactionContainsBulkSegment |
( |
const Transaction & | transaction | ) |
|
Returns true if the transaction contains any Statement messages which are not end segments (i.e. a bulk statement has previously been sent to replicators).
- Parameters
-
Definition at line 1623 of file statement_transform.cc.
◆ transformAlterSchemaStatementToSql()
| enum TransformSqlError drizzled::message::transformAlterSchemaStatementToSql |
( |
const AlterSchemaStatement & | statement, |
|
|
std::string & | destination, |
|
|
enum TransformSqlVariant | sql_variant = DRIZZLE ) |
This function looks at a supplied AlterSchemaStatement and constructs a correctly-formatted SQL statement to the supplied destination string.
- Parameters
-
| AlterSchemaStatement | message to transform |
| Destination | string to append SQL to |
| Variation | of SQL to generate |
- Return values
-
| NONE | if successful transformation |
| Error | code (see enum TransformSqlError definition) if failure |
Definition at line 820 of file statement_transform.cc.
◆ transformCreateSchemaStatementToSql()
| enum TransformSqlError drizzled::message::transformCreateSchemaStatementToSql |
( |
const CreateSchemaStatement & | statement, |
|
|
std::string & | destination, |
|
|
enum TransformSqlVariant | sql_variant = DRIZZLE ) |
This function looks at a supplied CreateSchemaStatement and constructs a correctly-formatted SQL statement to the supplied destination string.
- Parameters
-
| CreateSchemaStatement | message to transform |
| Destination | string to append SQL to |
| Variation | of SQL to generate |
- Return values
-
| NONE | if successful transformation |
| Error | code (see enum TransformSqlError definition) if failure |
Definition at line 868 of file statement_transform.cc.
◆ transformCreateTableStatementToSql()
| enum TransformSqlError drizzled::message::transformCreateTableStatementToSql |
( |
const CreateTableStatement & | statement, |
|
|
std::string & | destination, |
|
|
enum TransformSqlVariant | sql_variant = DRIZZLE ) |
Appends to supplied string an SQL expression containing the supplied CreateTableStatement's appropriate CREATE TABLE SQL statement.
Definition at line 984 of file statement_transform.cc.
◆ transformDeleteHeaderToSql()
| enum TransformSqlError drizzled::message::transformDeleteHeaderToSql |
( |
const DeleteHeader & | header, |
|
|
std::string & | destination, |
|
|
enum TransformSqlVariant | sql_variant = DRIZZLE ) |
Helper function to construct the header portion of a DELETE SQL statement from an DeleteHeader message.
- Parameters
-
| DeleteHeader | message to transform |
| Destination | string to append SQL to |
| Variation | of SQL to generate |
- Return values
-
| NONE | if successful transformation |
| Error | code (see enum TransformSqlError definition) if failure |
Definition at line 664 of file statement_transform.cc.
◆ transformDeleteRecordToSql()
| enum TransformSqlError drizzled::message::transformDeleteRecordToSql |
( |
const DeleteHeader & | header, |
|
|
const DeleteRecord & | record, |
|
|
std::string & | destination, |
|
|
enum TransformSqlVariant | sql_variant = DRIZZLE ) |
This function looks at a supplied DeleteHeader and a single DeleteRecord message and constructs a correctly-formatted SQL statement to the supplied destination string.
- Parameters
-
| DeleteHeader | message to transform |
| DeleteRecord | message to transform |
| Destination | string to append SQL to |
| Variation | of SQL to generate |
- Return values
-
| NONE | if successful transformation |
| Error | code (see enum TransformSqlError definition) if failure |
Definition at line 685 of file statement_transform.cc.
◆ transformDeleteStatementToSql()
| enum TransformSqlError drizzled::message::transformDeleteStatementToSql |
( |
const DeleteHeader & | header, |
|
|
const DeleteData & | data, |
|
|
std::string & | destination, |
|
|
enum TransformSqlVariant | sql_variant = DRIZZLE ) |
This function looks at a supplied DeleteHeader and DeleteData message and constructs a correctly-formatted SQL statement to the supplied destination string.
- Note
This function constructs a single SQL statement for all keys in the DeleteData message.
- Parameters
-
| DeleteHeader | message to transform |
| DeleteData | message to transform |
| Destination | string to append SQL to |
| Variation | of SQL to generate |
- Return values
-
| NONE | if successful transformation |
| Error | code (see enum TransformSqlError definition) if failure |
Definition at line 747 of file statement_transform.cc.
◆ transformDropSchemaStatementToSql()
| enum TransformSqlError drizzled::message::transformDropSchemaStatementToSql |
( |
const DropSchemaStatement & | statement, |
|
|
std::string & | destination, |
|
|
enum TransformSqlVariant | sql_variant = DRIZZLE ) |
This function looks at a supplied DropSchemaStatement and constructs a correctly-formatted SQL statement to the supplied destination string.
- Parameters
-
| DropSchemaStatement | message to transform |
| Destination | string to append SQL to |
| Variation | of SQL to generate |
- Return values
-
| NONE | if successful transformation |
| Error | code (see enum TransformSqlError definition) if failure |
Definition at line 851 of file statement_transform.cc.
◆ transformDropTableStatementToSql()
| enum TransformSqlError drizzled::message::transformDropTableStatementToSql |
( |
const DropTableStatement & | statement, |
|
|
std::string & | destination, |
|
|
enum TransformSqlVariant | sql_variant = DRIZZLE ) |
This function looks at a supplied DropTableStatement and constructs a correctly-formatted SQL statement to the supplied destination string.
- Parameters
-
| DropTableStatement | message to transform |
| Destination | string to append SQL to |
| Variation | of SQL to generate |
- Return values
-
| NONE | if successful transformation |
| Error | code (see enum TransformSqlError definition) if failure |
Definition at line 906 of file statement_transform.cc.
◆ transformFieldDefinitionToSql()
| enum TransformSqlError drizzled::message::transformFieldDefinitionToSql |
( |
const Table::Field & | field, |
|
|
std::string & | destination, |
|
|
enum TransformSqlVariant | sql_variant = DRIZZLE ) |
Appends to the supplied string an SQL expression representing the field's attributes. The built string corresponds to the SQL in a CREATE TABLE statement.
- Parameters
-
| [in] | Field | message |
| [out] | String | to append to |
- Return values
-
| NONE | if successful transformation |
| Error | code (see enum TransformSqlError definition) if failure |
Definition at line 1357 of file statement_transform.cc.
◆ transformForeignKeyConstraintDefinitionToSql()
| enum TransformSqlError drizzled::message::transformForeignKeyConstraintDefinitionToSql |
( |
const Table::ForeignKeyConstraint & | fkey, |
|
|
const Table & | table, |
|
|
std::string & | destination, |
|
|
enum TransformSqlVariant | sql_variant = DRIZZLE ) |
Appends to the supplied string an SQL expression representing the foreign key attributes. The built string corresponds to the SQL in a CREATE TABLE statement.
- Parameters
-
| [in] | Foreign | Key Constraint message |
| [in] | Table | containing this foregin key (used to get field names...) |
| [out] | String | to append to |
- Return values
-
| NONE | if successful transformation |
| Error | code (see enum TransformSqlError definition) if failure |
Definition at line 1295 of file statement_transform.cc.
◆ transformIndexDefinitionToSql()
| enum TransformSqlError drizzled::message::transformIndexDefinitionToSql |
( |
const Table::Index & | index, |
|
|
const Table & | table, |
|
|
std::string & | destination, |
|
|
enum TransformSqlVariant | sql_variant = DRIZZLE ) |
Appends to the supplied string an SQL expression representing the index's attributes. The built string corresponds to the SQL in a CREATE INDEX statement.
- Parameters
-
| [in] | Index | message |
| [in] | Table | containing this index (used to get field names...) |
| [out] | String | to append to |
- Return values
-
| NONE | if successful transformation |
| Error | code (see enum TransformSqlError definition) if failure |
Definition at line 1180 of file statement_transform.cc.
◆ transformInsertHeaderToSql()
| enum TransformSqlError drizzled::message::transformInsertHeaderToSql |
( |
const InsertHeader & | header, |
|
|
std::string & | destination, |
|
|
enum TransformSqlVariant | sql_variant = DRIZZLE ) |
Helper function to construct the header portion of an INSERT SQL statement from an InsertHeader message.
- Parameters
-
| InsertHeader | message to transform |
| Destination | string to append SQL to |
| Variation | of SQL to generate |
- Return values
-
| NONE | if successful transformation |
| Error | code (see enum TransformSqlError definition) if failure |
Definition at line 359 of file statement_transform.cc.
◆ transformInsertRecordToSql()
| enum TransformSqlError drizzled::message::transformInsertRecordToSql |
( |
const InsertHeader & | header, |
|
|
const InsertRecord & | record, |
|
|
std::string & | destination, |
|
|
enum TransformSqlVariant | sql_variant = DRIZZLE ) |
This function looks at a supplied InsertHeader and a single InsertRecord message and constructs a correctly-formatted SQL statement to the supplied destination string.
- Parameters
-
| InsertHeader | message to transform |
| InsertRecord | message to transform |
| Destination | string to append SQL to |
| Variation | of SQL to generate |
- Return values
-
| NONE | if successful transformation |
| Error | code (see enum TransformSqlError definition) if failure |
Definition at line 396 of file statement_transform.cc.
◆ transformInsertStatementToSql()
| enum TransformSqlError drizzled::message::transformInsertStatementToSql |
( |
const InsertHeader & | header, |
|
|
const InsertData & | data, |
|
|
std::string & | destination, |
|
|
enum TransformSqlVariant | sql_variant = DRIZZLE ) |
This function looks at a supplied InsertHeader and InsertData message and constructs a correctly-formatted SQL statement to the supplied destination string.
- Note
This function is used when you want to construct a single SQL statement from an entire InsertHeader and InsertData message. If there are many records in the InsertData message, the SQL statement will be a multi-value INSERT statement.
- Parameters
-
| InsertHeader | message to transform |
| InsertData | message to transform |
| Destination | string to append SQL to |
| Variation | of SQL to generate |
- Return values
-
| NONE | if successful transformation |
| Error | code (see enum TransformSqlError definition) if failure |
Definition at line 465 of file statement_transform.cc.
◆ transformSetVariableStatementToSql()
| enum TransformSqlError drizzled::message::transformSetVariableStatementToSql |
( |
const SetVariableStatement & | statement, |
|
|
std::string & | destination, |
|
|
enum TransformSqlVariant | sql_variant = DRIZZLE ) |
This function looks at a supplied SetVariableStatement and constructs a correctly-formatted SQL statement to the supplied destination string.
- Parameters
-
| SetVariableStatement | message to transform |
| Destination | string to append SQL to |
| Variation | of SQL to generate |
- Return values
-
| NONE | if successful transformation |
| Error | code (see enum TransformSqlError definition) if failure |
Definition at line 960 of file statement_transform.cc.
◆ transformStatementToSql()
| enum TransformSqlError drizzled::message::transformStatementToSql |
( |
const Statement & | source, |
|
|
std::vector< std::string > & | sql_strings, |
|
|
enum TransformSqlVariant | sql_variant = DRIZZLE, |
|
|
bool | already_in_transaction = false ) |
This function looks at the Statement message and appends one or more correctly-formatted SQL strings to the supplied vector of strings.
- Parameters
-
| Statement | message to transform |
| Vector | of strings to append SQL statements to |
| Variation | of SQL to generate |
- Return values
-
| NONE | if successful transformation |
| Error | code (see enum TransformSqlError definition) if failure |
Definition at line 121 of file statement_transform.cc.
◆ transformTableDefinitionToSql()
| enum TransformSqlError drizzled::message::transformTableDefinitionToSql |
( |
const Table & | table, |
|
|
std::string & | destination, |
|
|
enum TransformSqlVariant | sql_variant = DRIZZLE, |
|
|
bool | with_schema = true ) |
Appends to the supplied string an SQL expression representing the table for a CREATE TABLE expression.
- Parameters
-
| [in] | Table | message |
| [out] | String | to append to |
- Return values
-
| NONE | if successful transformation |
| Error | code (see enum TransformSqlError definition) if failure |
Definition at line 992 of file statement_transform.cc.
◆ transformTableOptionsToSql()
| enum TransformSqlError drizzled::message::transformTableOptionsToSql |
( |
const Table::TableOptions & | table_options, |
|
|
std::string & | destination, |
|
|
enum TransformSqlVariant | sql_variant = DRIZZLE ) |
Appends to the supplied string an SQL expression representing the table's optional attributes.
- Note
This function will eventually be a much simpler listing of key/value pairs.
- Parameters
-
| [in] | TableOptions | message |
| [out] | String | to append to |
- Return values
-
| NONE | if successful transformation |
| Error | code (see enum TransformSqlError definition) if failure |
Definition at line 1112 of file statement_transform.cc.
◆ transformTruncateTableStatementToSql()
| enum TransformSqlError drizzled::message::transformTruncateTableStatementToSql |
( |
const TruncateTableStatement & | statement, |
|
|
std::string & | destination, |
|
|
enum TransformSqlVariant | sql_variant = DRIZZLE ) |
This function looks at a supplied TruncateTableStatement and constructs a correctly-formatted SQL statement to the supplied destination string.
- Parameters
-
| TruncateTableStatement | message to transform |
| Destination | string to append SQL to |
| Variation | of SQL to generate |
- Return values
-
| NONE | if successful transformation |
| Error | code (see enum TransformSqlError definition) if failure |
Definition at line 937 of file statement_transform.cc.
◆ transformUpdateHeaderToSql()
| enum TransformSqlError drizzled::message::transformUpdateHeaderToSql |
( |
const UpdateHeader & | header, |
|
|
std::string & | destination, |
|
|
enum TransformSqlVariant | sql_variant = DRIZZLE ) |
Helper function to construct the header portion of an UPDATE SQL statement from an UpdateHeader message.
- Parameters
-
| UpdateHeader | message to transform |
| Destination | string to append SQL to |
| Variation | of SQL to generate |
- Return values
-
| NONE | if successful transformation |
| Error | code (see enum TransformSqlError definition) if failure |
Definition at line 527 of file statement_transform.cc.
◆ transformUpdateRecordToSql()
| enum TransformSqlError drizzled::message::transformUpdateRecordToSql |
( |
const UpdateHeader & | header, |
|
|
const UpdateRecord & | record, |
|
|
std::string & | destination, |
|
|
enum TransformSqlVariant | sql_variant = DRIZZLE ) |
This function looks at a supplied UpdateHeader and a single UpdateRecord message and constructs a correctly-formatted SQL statement to the supplied destination string.
- Parameters
-
| UpdateHeader | message to transform |
| UpdateRecord | message to transform |
| Destination | string to append SQL to |
| Variation | of SQL to generate |
- Return values
-
| NONE | if successful transformation |
| Error | code (see enum TransformSqlError definition) if failure |
Definition at line 549 of file statement_transform.cc.