forked from 3rd-year-CSE-20/SIS_GUI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sqliteclass.h
36 lines (30 loc) · 845 Bytes
/
sqliteclass.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
#ifndef SQLITECLASS_H
#define SQLITECLASS_H
#include <QSqlDatabase>
#include <QSql>
#include <QSqlError>
#include <QDir>
#include <QFile>
#include <QDebug>
#include <QSqlQuery>
#include <QString>
#include <QStringList>
#include <QSqlError>
void databaseInitialization();
class SQLiteClass
{
public:
SQLiteClass(QString dbName);
QSqlQuery sql_getQuery();
int sql_insert(QString table, QStringList columns, QStringList values);
int sql_select(QString select, QString from, QString where);
int sql_update(QString table, QStringList columns, QStringList values, QString where);
int sql_delete(QString table, QString where);
int sql_create(QString table, QStringList columns, QStringList types);
int sql_print();
int sql_close();
private:
QSqlQuery query;
QSqlDatabase db;
};
#endif // SQLITECLASS_H