-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sql.h
43 lines (37 loc) · 1020 Bytes
/
Sql.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// Created by viking on 7/4/18.
//
#include <sqlsetup.h>
#ifndef TESTSTRING_SQL_H
#define TESTSTRING_SQL_H
class Sql {
public:
//QString execute(QString) const;
Sql(QString, QString, QString, QString);
virtual ~Sql(){;}
Sql select(const QString &,const QString &); // Select(column, from table)
Sql where(const QString &);
/* Sql lpar(); // left parenthesis
Sql rpar(); // right parenthesis
Sql and_(const QString &);
Sql or_(const QString &);
Sql not_(const QString &); */
/* Sql orderby(const QString &);
Sql fetchone();
Sql fetchall(); */
const QString getsql();
QSqlQuery qry(QString);
QSqlDatabase db;
const QString hostname;
const QString databasename;
const QString username;
const QString password;
private:
QString sqlquery;
void connect();
//QSqlQuery q;
};
const QString and_(const QString &);
const QString or_(const QString &);
const QString not_(const QString &);
#endif //TESTSTRING_SQL_H