Class representing a Postgresql database. Allows ts-api to read and write series to and from a Postgresql database server.
More...
|
void | create_series_table (const std::string &table_name, const tsa::column_defs &table_def) |
| Creates a new series table. A series table is a table that has a timestamp as first column. Recall that the timestamp is implicit to all series tables and must not be given as part of the columns definition. More...
|
|
virtual bool | drop_series_table (const std::string &table_name) override |
| ??????? drop_table
|
|
virtual void | series_append (const std::string &table_name, const tsa::mem_table &data) |
| Appends the records from the given m_table to a database table. This operation will fail if there is overal in the range of timestamps, or if the column structure does not match. More...
|
|
virtual void | series_load (const std::string &table_name, tsa::mem_table &data, const date_time &from_timestamp, size_t num_records) override |
| Loads a number of series records from a given database table into a mem_table (memory based table) object. More...
|
|
virtual date_time | series_table_closest_timestamp_LOE (const date_time &ts, const std::string &table_name) override |
| Returns the record timestamp that is closest to, but lower than, the given target timestamp. More...
|
|
virtual tsa::column_defs | series_table_column_defs (const std::string &table_name) override |
| Returns the column definition structure. More...
|
|
virtual date_time | series_table_first_timestamp (const std::string &table_name) override |
| Returns the timestamp of the first record in the table. More...
|
|
virtual date_time | series_table_last_timestamp (const std::string &table_name) override |
| Returns the timestamp of the last records in the table. More...
|
|
virtual bool | table_exists (const std::string &table_name) const override |
| Returns true if a database table exists. More...
|
|
virtual bool | table_has_data (const std::string &table_name) override |
| Returns true if the table has records, false if empty. More...
|
|
int64_t | table_record_count (const std::string &table_name) |
| Returns the number of records in the table. More...
|
|
virtual bool | table_record_count_is_known (void) const override |
| Returns true if the database system knows the size (record count) of a table at all times, or whether it needs to iterate through the table to calculate the size. In the native fast::database knows the table size at all times, whereas SQL databases need to launch the 'select count(*)' command. More...
|
|
virtual void | truncate_series_table (const std::string &table_name, const date_time &new_max_timestamp=date_time::min) override |
| Truncates a database table by deleting all records higher than a given new_max_timestamp. More...
|
|
virtual std::string | type (void) const override |
| Returns the 'type' of the database as a string, such as "sqlite", "postgresql" or the native "fast". More...
|
|
| data_base (void) |
| Constructor.
|
|
virtual | ~data_base (void) |
| Destructor.
|
|
void | copy_table_from (data_base &source_db, const std::string &source_table_name, const std::string &target_table_name, const table_copy_params ©_prop=table_copy_params()) |
| Copies a table, potentially from one database to another, according to the given table_copy_properties object, which by default copies the entire table. See class table_copy_properties for more details. More...
|
|
void | import (const file_import_rules__obsolete &import_properties) |
| Imports records from a text file according to the given import properties. See class file_import_properties for more information. More...
|
|
void | print_table_info (const std::string &table_name, std::ostream &stream) |
| Prints basic information about the table. More...
|
|
bool | series_columns_match (const std::string &table_name, const tsa::mem_table &m_table) |
| Returns true if a database table has an identical column structure to a given mem_table. More...
|
|
| object (void) |
| Constructor.
|
|
virtual | ~object (void) |
| Destructor.
|
|
const char * | class_name (void) const |
| Returns the class name as returned by the 'Real Time Type Information' (RTTI) mechanism. More...
|
|
bool | has_same_class_as (const object &other) const |
| Returns true if self has the same type as other object. More...
|
|
Class representing a Postgresql database. Allows ts-api to read and write series to and from a Postgresql database server.