26 #include <QSqlTableModel>
27 #include "src/database/dbinfo.h"
28 #include "src/testing/adebug.h"
31 #include "apilotentry.h"
32 #include "atailentry.h"
33 #include "aaircraftentry.h"
34 #include "aflightentry.h"
46 airport_identifier_icao,
47 airport_identifier_iata,
48 airport_identifier_all,
78 TableNames tableNames;
79 TableColumns tableColumns;
85 void operator=(
const ADatabase&) =
delete;
110 QVector<QString>
customQuery(QString statement,
int return_values);
Temporary namespace for experimental features. Will be removed in later versions.
Definition: aaircraftentry.cpp:20
void dataBaseUpdated()
updated is emitted whenever the database contents have been updated. This can be either a commit,...
void disconnect()
closes the database connection.
Definition: adatabase.cpp:75
The Entry class encapsulates table metadata(table name, row id) and data for new and existing entries...
Definition: aentry.h:42
bool commit(AEntry entry)
commits an entry to the database, calls either insert or update, based on position data
Definition: adatabase.cpp:88
const QMap< QString, int > getIdMap(ADatabaseTarget)
returns a QMap<QString, int> of a human-readable database value and its row id. Used in the Dialogs t...
Definition: adatabase.cpp:452
ADatabaseTarget
The DBTarget enum provides the items for which QCompleter completion lists are provided from the data...
Definition: adatabase.h:45
bool update(AEntry updated_entry)
Updates entry in database from existing entry tweaked by the user.
Definition: adatabase.cpp:230
AAircraftEntry getAircraftEntry(RowId row_id)
retreives a TailEntry from the database.
Definition: adatabase.cpp:390
APilotEntry getPilotEntry(RowId row_id)
retreives a PilotEntry from the database.
Definition: adatabase.cpp:376
Definition: aflightentry.h:9
QVector< QString > customQuery(QString statement, int return_values)
Can be used to send a complex query to the database.
Definition: adatabase.cpp:564
Definition: atailentry.h:27
bool removeMany(QList< DataPosition >)
deletes a list of entries from the database. Optimised for speed when deleting many entries.
Definition: adatabase.cpp:128
ATailEntry getTailEntry(RowId row_id)
retreives a TailEntry from the database.
Definition: adatabase.cpp:383
bool insert(AEntry new_entry)
Create new entry in the databse based on UserInput.
Definition: adatabase.cpp:266
static QSqlDatabase database()
Can be used to access the database connection.
Definition: adatabase.cpp:83
Custom Database Error derived from QSqlError. Extends text() adding "Database Error: " before the tex...
Definition: adatabase.h:64
Definition: aaircraftentry.h:9
QList< int > getForeignKeyConstraints(int foreign_row_id, ADatabaseTarget target)
returns a list of ROWID's in the flights table for which foreign key constraints exist.
Definition: adatabase.cpp:527
The DB class encapsulates the SQL database by providing fast access to hot database data.
Definition: adatabase.h:75
bool exists(AEntry entry)
Checks if an entry exists in the database, based on position data.
Definition: adatabase.cpp:170
AFlightEntry getFlightEntry(RowId row_id)
retreives a flight entry from the database.
Definition: adatabase.cpp:397
bool connect()
Connect to the database and populate database information.
Definition: adatabase.cpp:41
Definition: apilotentry.h:26
int getLastEntry(ADatabaseTarget)
returns the ROWID for the newest entry in the respective database.
Definition: adatabase.cpp:499
ADatabase * aDB()
Convinience function that returns instance of DataBase. Instead of this: DataBase::getInstance()....
Definition: adatabase.cpp:590
TableData getEntryData(DataPosition data_position)
retreive entry data from the database to create an entry object
Definition: adatabase.cpp:312
AEntry getEntry(DataPosition data_position)
retreive an Entry from the database.
Definition: adatabase.cpp:369
const QStringList getCompletionList(ADatabaseTarget)
getCompletionList returns a QStringList of values for a QCompleter based on database values
Definition: adatabase.cpp:404
bool remove(AEntry entry)
deletes an entry from the database.
Definition: adatabase.cpp:97