~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/message/statement_transform.h

  • Committer: Mark Atwood
  • Date: 2011-10-27 05:08:12 UTC
  • mfrom: (2445.1.11 rf)
  • Revision ID: me@mark.atwood.name-20111027050812-1icvs72lb0u4xdc4
mergeĀ lp:~olafvdspek/drizzle/refactor8

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 * Transaction messages to other formats, including SQL statements.
30
30
 */
31
31
 
32
 
#ifndef DRIZZLED_MESSAGE_STATEMENT_TRANSFORM_H
33
 
#define DRIZZLED_MESSAGE_STATEMENT_TRANSFORM_H
 
32
#pragma once
34
33
 
 
34
#include <drizzled/common_fwd.h>
 
35
#include <drizzled/common.h>
35
36
#include <drizzled/message/table.pb.h>
36
37
#include <string>
37
38
#include <vector>
38
39
 
39
 
#include "drizzled/common.h"
40
 
 
41
 
namespace drizzled
42
 
{
43
 
namespace message
44
 
{
45
 
/* some forward declarations */
46
 
class Transaction;
47
 
class Statement;
48
 
class InsertHeader;
49
 
class InsertData;
50
 
class InsertRecord;
51
 
class UpdateHeader;
52
 
class UpdateData;
53
 
class UpdateRecord;
54
 
class DeleteHeader;
55
 
class DeleteData;
56
 
class DeleteRecord;
57
 
class DropTableStatement;
58
 
class CreateTableStatement;
59
 
class TruncateTableStatement;
60
 
class CreateSchemaStatement;
61
 
class DropSchemaStatement;
62
 
class SetVariableStatement;
 
40
namespace drizzled {
 
41
namespace message {
63
42
 
64
43
/** A Variation of SQL to be output during transformation */
65
44
enum TransformSqlVariant
75
54
{
76
55
  NONE= 0,
77
56
  MISSING_HEADER= 1, /* A data segment without a header segment was found */
78
 
  MISSING_DATA= 2 /* A header segment without a data segment was found */
 
57
  MISSING_DATA= 2,   /* A header segment without a data segment was found */
 
58
  UUID_MISMATCH= 3
79
59
};
80
60
 
81
61
/**
346
326
                                  enum TransformSqlVariant sql_variant= DRIZZLE);
347
327
 
348
328
/**
 
329
 * This function looks at a supplied AlterSchemaStatement
 
330
 * and constructs a correctly-formatted SQL
 
331
 * statement to the supplied destination string.
 
332
 *
 
333
 * @param AlterSchemaStatement message to transform
 
334
 * @param Destination string to append SQL to
 
335
 * @param Variation of SQL to generate
 
336
 *
 
337
 * @retval
 
338
 *  NONE if successful transformation
 
339
 * @retval
 
340
 *  Error code (see enum TransformSqlError definition) if failure
 
341
 */
 
342
enum TransformSqlError
 
343
transformAlterSchemaStatementToSql(const AlterSchemaStatement &statement,
 
344
                                   std::string &destination,
 
345
                                   enum TransformSqlVariant sql_variant= DRIZZLE);
 
346
 
 
347
/**
349
348
 * This function looks at a supplied SetVariableStatement
350
349
 * and constructs a correctly-formatted SQL
351
350
 * statement to the supplied destination string.
494
493
} /* namespace message */
495
494
} /* namespace drizzled */
496
495
 
497
 
#endif /* DRIZZLED_MESSAGE_STATEMENT_TRANSFORM_H */