28 #ifndef DBA_DB_V6_QBUILDER_H
29 #define DBA_DB_V6_QBUILDER_H
44 #define DBA_DB_FROM_PA (1 << 0)
46 #define DBA_DB_FROM_LTR (1 << 1)
48 #define DBA_DB_FROM_D (1 << 2)
50 #define DBA_DB_FROM_RI (1 << 3)
52 #define DBA_DB_FROM_DBLO (1 << 5)
54 #define DBA_DB_FROM_DSTA (1 << 6)
56 #define DBA_DB_FROM_DANA (1 << 7)
59 #define DBA_DB_FROM_DDF (1 << 8)
62 #define DBA_DB_FROM_ADF (1 << 9)
124 unsigned int select_wanted;
127 unsigned int from_wanted;
140 bool add_pa_where(
const char* tbl);
141 bool add_dt_where(
const char* tbl);
142 bool add_ltr_where(
const char* tbl);
143 bool add_varcode_where(
const char* tbl);
144 bool add_repinfo_where(
const char* tbl);
145 bool add_datafilter_where(
const char* tbl);
146 bool add_attrfilter_where(
const char* tbl);
148 virtual void build_select() = 0;
149 virtual bool build_where() = 0;
150 virtual void build_order_by() = 0;
156 void add_to_orderby(
const char* fields);
165 void add_other_froms(
unsigned int base,
const Record& rec);
168 void resolve_dependencies();
177 void make_extra_select();
180 void make_from(
const Record& rec);
183 void add_int(
const Record& rec, dba_keyword key,
const char* sql,
int needed_from);
186 void make_where(
const Record& rec);
189 void add_repinfo_where(
Querybuf& buf,
const Record& query,
const char* colname);
192 void build_query(
const Record& rec);
195 void build_count_query(
const Record& rec);
198 void build_date_extremes_query(
const Record& rec);
207 virtual void build_select();
208 virtual bool build_where();
209 virtual void build_order_by();
218 virtual void build_select();
219 virtual bool build_where();
220 virtual void build_order_by();
228 virtual void build_select();
229 virtual void build_order_by();
239 virtual void build_select();
240 virtual void build_order_by();
Definition: qbuilder.h:232
Cursor & cur
Cursor with the output variables.
Definition: qbuilder.h:94
Structure used to build and execute a query, and to iterate through the results.
Definition: v6/cursor.h:58
DB-All.E record.
Definition: record.h:102
String buffer for composing database queries.
Definition: querybuf.h:35
Functions used to connect to DB-All.e and insert, query and delete data.
Definition: qbuilder.h:202
Implementation of an efficient string buffer for composing database queries.
Querybuf sql_where
WHERE part of the SQL query.
Definition: qbuilder.h:106
bool query_station_vars
True if we are querying station information, rather than measured data.
Definition: qbuilder.h:117
DB & db
Database to operate on.
Definition: qbuilder.h:88
const Record & rec
Record with the query.
Definition: qbuilder.h:97
unsigned int output_seq
Sequence number to use to bind ODBC output parameters.
Definition: qbuilder.h:114
Querybuf sql_from
FROM part of the SQL query.
Definition: qbuilder.h:103
Querybuf sql_query
Dynamically generated SQL query.
Definition: qbuilder.h:100
ODBC statement.
Definition: internals.h:220
Implement a storage object for a group of related observation data.
Database functions and data structures used by the db module, but not exported as official API...
Functions used to manage a general DB-ALLe query.
Definition: qbuilder.h:85
DB-ALLe database connection.
Definition: v6/db.h:87
Definition: qbuilder.h:223
Definition: v6/cursor.h:244
Statement & stm
Statement to build variables to.
Definition: qbuilder.h:91
const unsigned int modifiers
Modifier flags to enable special query behaviours.
Definition: qbuilder.h:109
Definition: qbuilder.h:212