drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
sql_generator.h
1/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3 *
4 * Copyright (C) 2012 Mohit Srivastava
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
23#pragma once
24
25#include <config.h>
26#include <cstring>
27#include <cstdio>
28#include <boost/program_options.hpp>
29#include <json/json.h>
30#include <plugin/json_server/http_handler.h>
31
32using namespace std;
36namespace drizzle_plugin
37{
41namespace json_server
42{
47 {
48 private:
52 Json::Value _json_in;
56 Json::Value _json_out;
60 string _sql;
64 const char* _schema;
68 const char* _table;
72 void generateGetSql() ;
76 void generatePostSql() ;
80 void generateDeleteSql() ;
81
82 public:
90 SQLGenerator(const Json::Value json_in,const char* schema,const char* table);
95 void generateSql(enum evhttp_cmd_type type);
104 const string getSQL() const
105 {
106 return _sql;
107 }
108 };
109}
110}
SQLGenerator(const Json::Value json_in, const char *schema, const char *table)
void generateSql(enum evhttp_cmd_type type)
Convert from decimal to binary representation.
Definition common_fwd.h:215
STL namespace.