libdballe  9.11
Public Member Functions | Static Public Member Functions | List of all members
dballe::DB Class Referenceabstract
Inheritance diagram for dballe::DB:
dballe::db::DB dballe::db::v7::DB

Public Member Functions

virtual std::shared_ptr< dballe::Transactiontransaction (bool readonly=false)=0
 Begin a transaction on this database, and return a Transaction object that can be used to commit it.
 
virtual std::shared_ptr< CursorStationquery_stations (const Query &query)
 Start a query on the station variables archive. More...
 
virtual std::shared_ptr< CursorStationDataquery_station_data (const Query &query)
 Query the station variables in the database. More...
 
virtual std::shared_ptr< CursorDataquery_data (const Query &query)
 Query the database. More...
 
virtual std::shared_ptr< CursorSummaryquery_summary (const Query &query)
 Query a summary of what the result would be for a query. More...
 
virtual std::shared_ptr< CursorMessagequery_messages (const Query &query)
 Query the database returning the matching data as Message objects. More...
 
void remove_all ()
 Remove all data from the database. More...
 
void remove_station_data (const Query &query)
 Remove data from the database. More...
 
void remove_data (const Query &query)
 Remove data from the database. More...
 
void import_message (const Message &message, const DBImportOptions &opts=DBImportOptions::defaults)
 Import a Message into the DB-All.e database. More...
 
void import_messages (const std::vector< std::shared_ptr< Message >> &messages, const DBImportOptions &opts=DBImportOptions::defaults)
 Import Messages into the DB-All.e database. More...
 
void insert_station_data (Data &vals, const DBInsertOptions &opts=DBInsertOptions::defaults)
 Insert station values into the database. More...
 
void insert_data (Data &vals, const DBInsertOptions &opts=DBInsertOptions::defaults)
 Insert data values into the database. More...
 

Static Public Member Functions

static std::shared_ptr< DBconnect (const DBConnectOptions &opts)
 Create a new DB.
 

Member Function Documentation

◆ import_message()

void dballe::DB::import_message ( const Message message,
const DBImportOptions opts = DBImportOptions::defaults 
)

Import a Message into the DB-All.e database.

Parameters
messageThe Message to import
optsOptions controlling the import process

◆ import_messages()

void dballe::DB::import_messages ( const std::vector< std::shared_ptr< Message >> &  messages,
const DBImportOptions opts = DBImportOptions::defaults 
)

Import Messages into the DB-All.e database.

Parameters
messagesThe messages to import
optsOptions controlling the import process

◆ insert_data()

void dballe::DB::insert_data ( Data vals,
const DBInsertOptions opts = DBInsertOptions::defaults 
)

Insert data values into the database.

The IDs of the station andl all variables that were inserted will be stored in vals.

Parameters
valsThe values to insert.
optsOptions controlling the insert operation

◆ insert_station_data()

void dballe::DB::insert_station_data ( Data vals,
const DBInsertOptions opts = DBInsertOptions::defaults 
)

Insert station values into the database.

The IDs of the station andl all variables that were inserted will be stored in vals.

Parameters
valsThe values to insert.
optsOptions controlling the insert operation

◆ query_data()

virtual std::shared_ptr<CursorData> dballe::DB::query_data ( const Query query)
virtual

Query the database.

When multiple values per variable are present, the results will be presented in increasing order of priority.

Parameters
queryThe Query selecting the data to return
Returns
The cursor to use to iterate over the results

◆ query_messages()

virtual std::shared_ptr<CursorMessage> dballe::DB::query_messages ( const Query query)
virtual

Query the database returning the matching data as Message objects.

Parameters
queryThe Query selecting the data that will go into the Message objects
Returns
The cursor to use to iterate over the results

◆ query_station_data()

virtual std::shared_ptr<CursorStationData> dballe::DB::query_station_data ( const Query query)
virtual

Query the station variables in the database.

When multiple values per variable are present, the results will be presented in increasing order of priority.

Parameters
queryThe Query selecting the station data to return
Returns
The cursor to use to iterate over the results

◆ query_stations()

virtual std::shared_ptr<CursorStation> dballe::DB::query_stations ( const Query query)
virtual

Start a query on the station variables archive.

The cursor will iterate over unique lat, lon, ident triples, and will contain all station vars. If a station var exists twice on two different networks, only one will be present: the one of the network with the highest priority.

Parameters
queryThe Query selecting the stations to return
Returns
The cursor to use to iterate over the results

◆ query_summary()

virtual std::shared_ptr<CursorSummary> dballe::DB::query_summary ( const Query query)
virtual

Query a summary of what the result would be for a query.

Parameters
queryThe Query selecting the data to summarise
Returns
The cursor to use to iterate over the results

◆ remove_all()

void dballe::DB::remove_all ( )

Remove all data from the database.

This is faster than remove() with an empty record, and unlike reset() it preserves existing report information.

◆ remove_data()

void dballe::DB::remove_data ( const Query query)

Remove data from the database.

Parameters
queryThe query selecting the data to remove

◆ remove_station_data()

void dballe::DB::remove_station_data ( const Query query)

Remove data from the database.

Parameters
queryThe query selecting the data to remove

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