-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.h
More file actions
30 lines (27 loc) · 1006 Bytes
/
database.h
File metadata and controls
30 lines (27 loc) · 1006 Bytes
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
#ifndef DATABASE_H
#define DATABASE_H
#include <QList>
#include "table.h"
#include <QString>
class Database
{
QString name ;
QString target_file ;
QList<Table*> tables;
void initialize_from_file();
public:
Database();
void fromFile(QString Filename) ;
void save_to_file(QString filename) ;
void addTable(Table* table) ;
bool dropTable(QString table_name) ;
QString getName() const;
void setName(const QString &value);
bool createRecord(QString tableName, Record* val_record) ;
QHash<QString, QString> readRecord(QString tableName, QList<QString> attributes, QString where_attribute, QString equals_value) ;
bool updateRecord(QString tableName,QString attribute_to_change,QString new_value, QString where_attribute, QString has_value) ;
bool deleteRecord(QString tableName, QString where_attribute, QString equals_value) ;
void add_index(QString tablename, Index* index) ;
void print_table(QString table_name) ;
};
#endif // DATABASE_H