https://github.com/CryptDB/cryptdb
Raw File
Tip revision: 7678bc98d3054f1418371779c6d1050cd1a88b2e authored by Raluca Ada Popa on 04 January 2014, 01:31:06 UTC
small changes to readme
Tip revision: 7678bc9
sql_utils.hh
#pragma once

#include <util/util.hh>
#include <vector>
#include <string>
#include <memory>

#include <sql_select.h>
#include <sql_delete.h>
#include <sql_insert.h>
#include <sql_update.h>


// must be called before we can use any MySQL AP
void
init_mysql(const std::string & embed_db);

class ResType {
public:
    bool ok;  // query executed successfully
    std::vector<std::string> names;
    std::vector<enum_field_types> types;
    std::vector<std::vector<std::shared_ptr<Item> > > rows;

    explicit ResType(bool okflag = true) : ok(okflag) {}
    bool success() const {return this->ok;}
};

bool isTableField(std::string token);
std::string fullName(std::string field, std::string name);

char * make_thd_string(const std::string &s, size_t *lenp = 0);

std::string ItemToString(const Item &i);
std::string ItemToStringWithQuotes(const Item &i);
back to top