163
153
enum TransformSqlError
164
154
transformInsertHeaderToSql(const InsertHeader &header,
165
std::string &destination,
155
std::string *destination,
166
156
enum TransformSqlVariant sql_variant= DRIZZLE);
158
* This function looks at a supplied UpdateHeader
159
* and UpdateData message and constructs a correctly-formatted SQL
160
* statement to the supplied destination string.
164
* This function constructs a <strong>single SQL statement</strong>
165
* that contains all the update keys represented in all records in
166
* the UpdateData message.
168
* @param UpdateHeader message to transform
169
* @param UpdateData message to transform
170
* @param Destination string to append SQL to
171
* @param Variation of SQL to generate
174
* NONE if successful transformation
176
* Error code (see enum TransformSqlError definition) if failure
178
enum TransformSqlError
179
transformUpdateStatementToSql(const UpdateHeader &header,
180
const UpdateData &data,
181
std::string *destination,
182
enum TransformSqlVariant sql_variant= DRIZZLE);
169
185
* Helper function to construct the header portion of an UPDATE
267
283
enum TransformSqlError
268
284
transformDeleteHeaderToSql(const DeleteHeader &header,
269
std::string &destination,
285
std::string *destination,
270
286
enum TransformSqlVariant sql_variant= DRIZZLE);
273
* This function looks at a supplied DropTableStatement
274
* and constructs a correctly-formatted SQL
275
* statement to the supplied destination string.
277
* @param DropTableStatement message to transform
278
* @param Destination string to append SQL to
279
* @param Variation of SQL to generate
282
* NONE if successful transformation
284
* Error code (see enum TransformSqlError definition) if failure
286
enum TransformSqlError
287
transformDropTableStatementToSql(const DropTableStatement &statement,
288
std::string &destination,
289
enum TransformSqlVariant sql_variant= DRIZZLE);
292
* This function looks at a supplied TruncateTableStatement
293
* and constructs a correctly-formatted SQL
294
* statement to the supplied destination string.
296
* @param TruncateTableStatement message to transform
297
* @param Destination string to append SQL to
298
* @param Variation of SQL to generate
301
* NONE if successful transformation
303
* Error code (see enum TransformSqlError definition) if failure
305
enum TransformSqlError
306
transformTruncateTableStatementToSql(const TruncateTableStatement &statement,
307
std::string &destination,
308
enum TransformSqlVariant sql_variant= DRIZZLE);
311
* This function looks at a supplied CreateSchemaStatement
312
* and constructs a correctly-formatted SQL
313
* statement to the supplied destination string.
315
* @param CreateSchemaStatement message to transform
316
* @param Destination string to append SQL to
317
* @param Variation of SQL to generate
320
* NONE if successful transformation
322
* Error code (see enum TransformSqlError definition) if failure
324
enum TransformSqlError
325
transformCreateSchemaStatementToSql(const CreateSchemaStatement &statement,
326
std::string &destination,
327
enum TransformSqlVariant sql_variant= DRIZZLE);
330
* This function looks at a supplied DropSchemaStatement
331
* and constructs a correctly-formatted SQL
332
* statement to the supplied destination string.
334
* @param DropSchemaStatement message to transform
335
* @param Destination string to append SQL to
336
* @param Variation of SQL to generate
339
* NONE if successful transformation
341
* Error code (see enum TransformSqlError definition) if failure
343
enum TransformSqlError
344
transformDropSchemaStatementToSql(const DropSchemaStatement &statement,
345
std::string &destination,
346
enum TransformSqlVariant sql_variant= DRIZZLE);
349
289
* This function looks at a supplied SetVariableStatement
350
290
* and constructs a correctly-formatted SQL
351
291
* statement to the supplied destination string.
362
302
enum TransformSqlError
363
303
transformSetVariableStatementToSql(const SetVariableStatement &statement,
364
std::string &destination,
365
enum TransformSqlVariant sql_variant= DRIZZLE);
368
* Appends to supplied string an SQL expression
369
* containing the supplied CreateTableStatement's
370
* appropriate CREATE TABLE SQL statement.
372
enum TransformSqlError
373
transformCreateTableStatementToSql(const CreateTableStatement &statement,
374
std::string &destination,
375
enum TransformSqlVariant sql_variant= DRIZZLE);
378
* Appends to the supplied string an SQL expression
379
* representing the table for a CREATE TABLE expression.
381
* @param[in] Table message
382
* @param[out] String to append to
385
* NONE if successful transformation
387
* Error code (see enum TransformSqlError definition) if failure
389
enum TransformSqlError
390
transformTableDefinitionToSql(const Table &table,
391
std::string &destination,
392
enum TransformSqlVariant sql_variant= DRIZZLE,
393
bool with_schema= false);
396
* Appends to the supplied string an SQL expression
397
* representing the table's optional attributes.
401
* This function will eventually be a much simpler
402
* listing of key/value pairs.
404
* @param[in] TableOptions message
405
* @param[out] String to append to
408
* NONE if successful transformation
410
* Error code (see enum TransformSqlError definition) if failure
412
enum TransformSqlError
413
transformTableOptionsToSql(const Table::TableOptions &table_options,
414
std::string &destination,
415
enum TransformSqlVariant sql_variant= DRIZZLE);
418
* Appends to the supplied string an SQL expression
419
* representing the index's attributes. The built string
420
* corresponds to the SQL in a CREATE INDEX statement.
422
* @param[in] Index message
423
* @param[in] Table containing this index (used to get field names...)
424
* @param[out] String to append to
427
* NONE if successful transformation
429
* Error code (see enum TransformSqlError definition) if failure
431
enum TransformSqlError
432
transformIndexDefinitionToSql(const Table::Index &index,
434
std::string &destination,
435
enum TransformSqlVariant sql_variant= DRIZZLE);
438
* Appends to the supplied string an SQL expression
439
* representing the field's attributes. The built string
440
* corresponds to the SQL in a CREATE TABLE statement.
442
* @param[in] Field message
443
* @param[out] String to append to
446
* NONE if successful transformation
448
* Error code (see enum TransformSqlError definition) if failure
450
enum TransformSqlError
451
transformFieldDefinitionToSql(const Table::Field &field,
452
std::string &destination,
453
enum TransformSqlVariant sql_variant= DRIZZLE);
304
std::string *destination,
305
enum TransformSqlVariant sql_variant= DRIZZLE);
456
309
* Returns true if the supplied message::Table::Field::FieldType
461
314
bool shouldQuoteFieldValue(Table::Field::FieldType in_type);
463
drizzled::message::Table::Field::FieldType internalFieldTypeToFieldProtoType(enum enum_field_types type);
466
* Returns true if the transaction contains any Statement
467
* messages which are not end segments (i.e. a bulk statement has
468
* previously been sent to replicators).
470
* @param The transaction to check
472
bool transactionContainsBulkSegment(const Transaction &transaction);
474
} /* namespace message */
475
} /* namespace drizzled */
316
} /* end namespace drizzled::message */
317
} /* end namespace drizzled */
477
319
#endif /* DRIZZLED_MESSAGE_STATEMENT_TRANSFORM_H */