| openPilotLog

Static Public Member Functions | List of all members
ADataBaseSetup Class Reference

The ADataBaseSetup class is responsible for the inital setup of the database when the application is first launched. It creates the database in the specified default location and creates all required tables and views. It can also be used to reset the database currently used. More...

`#include <adatabasesetup.h>`

## Static Public Member Functions
static void | debug ()
| dbSetup::debug prints Database Layout
static bool | createDatabase ()
static bool | downloadTemplates ()
static bool | backupOldData ()
static bool | fillTemplates ()
static bool | importDefaultData (bool use_local_data)
static bool | resetToDefault ()
| DbSetup::resetToDefault Empties all user-generated content in the database. More...
static bool | commitData (QVector< QStringList > from_csv, const QString &table_name)
| DbSetup::commitData inserts the data parsed from a csv file into the database. The first line of the csv file has to contain the column names of the corresponding table in the database. More...
static bool | commitDataJson (const QJsonArray &json_arr, const QString &table_name)
| commitDataJson Commits data read from a JSON array to the database. More...

## Detailed Description

The ADataBaseSetup class is responsible for the inital setup of the database when the application is first launched. It creates the database in the specified default location and creates all required tables and views. It can also be used to reset the database currently used.

## Member Function Documentation

## ◆ commitData()

QT_DEPRECATED bool ADataBaseSetup::commitData | ( | QVector< QStringList > | from_csv,
|  | const QString & | table_name
| ) |  |
| static

DbSetup::commitData inserts the data parsed from a csv file into the database. The first line of the csv file has to contain the column names of the corresponding table in the database.

Parameters

  fromCSV | input as parsed from CSV::read()
  tableName | as in the database

Returns

## ◆ commitDataJson()

QT_DEPRECATED bool ADataBaseSetup::commitDataJson | ( | const QJsonArray & | json_arr,
|  | const QString & | table_name
| ) |  |
| static

commitDataJson Commits data read from a JSON array to the database.

Parameters

  json_arr |
  table_name | The table that will be written to

## ◆ resetToDefault()

QT_DEPRECATED bool ADataBaseSetup::resetToDefault | ( |  | ) |
| static

DbSetup::resetToDefault Empties all user-generated content in the database.

Returns
  true on success

The documentation for this class was generated from the following files:

- src/database/adatabasesetup.h
- src/database/adatabasesetup.cpp