![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
Class for parsing SQL results using Nanodbc. More...
#include <nanodbcParser.h>
Public Member Functions | |
Constructors / Destructors | |
| NanodbcParser () | |
| Default constructor: create a parser without being connected. | |
| NanodbcParser (nanodbc::connection &connection, const std::string &query) | |
| constructor that executes an SQL query if the connection is active | |
| virtual | ~NanodbcParser () |
| destructor | |
Accessors / Modifiers | |
| bool | next () |
| Gets the next line of the SQL stream and parses it. | |
| const std::vector< std::string > & | current () const |
| returns the current parsed line. | |
| std::size_t | nbLine () const |
| returns the current line number within the query | |
| std::size_t | nbColumns () const |
| returns the number of columns in the query result | |
| std::string | columnName (const std::size_t i) const |
| returns the name of the ith column | |
| void | useNewQuery (nanodbc::connection &connexion, const std::string &query) |
| start a new query | |
Class for parsing SQL results using Nanodbc.
This class should probably not be used by itself. It is essentially used by Class DBInitializerFromSQL.
Definition at line 53 of file nanodbcParser.h.
| gum::learning::NanodbcParser::NanodbcParser | ( | ) |
Default constructor: create a parser without being connected.
| gum::learning::NanodbcParser::NanodbcParser | ( | nanodbc::connection & | connection, |
| const std::string & | query ) |
constructor that executes an SQL query if the connection is active
| connection | a nanODBC connection to a SQL database |
| query | a string containing an SQL query |
|
virtual |
destructor
| std::string gum::learning::NanodbcParser::columnName | ( | const std::size_t | i | ) | const |
returns the name of the ith column
| const std::vector< std::string > & gum::learning::NanodbcParser::current | ( | ) | const |
returns the current parsed line.
| NullElement | is raised if there is no data. |
| std::size_t gum::learning::NanodbcParser::nbColumns | ( | ) | const |
returns the number of columns in the query result
| std::size_t gum::learning::NanodbcParser::nbLine | ( | ) | const |
returns the current line number within the query
| bool gum::learning::NanodbcParser::next | ( | ) |
Gets the next line of the SQL stream and parses it.
| void gum::learning::NanodbcParser::useNewQuery | ( | nanodbc::connection & | connexion, |
| const std::string & | query ) |
start a new query