25 #ifndef LSST_MWI_PERSISTENCE_DBSTORAGE_H 26 #define LSST_MWI_PERSISTENCE_DBSTORAGE_H 57 namespace persistence {
61 class DbStorageLocation;
79 bool mayAlreadyExist =
false);
97 T* location,
bool isExpr =
false);
103 virtual void query(
void);
104 virtual bool next(
void);
void outParam(std::string const &columnName, T *location, bool isExpr=false)
Request a column in the query output and bind a destination location.
virtual void executeSql(std::string const &sqlStatement)
Execute an arbitrary SQL statement.
virtual void outColumn(std::string const &columnName, bool isExpr=false)
Request a column in the query output.
void setColumn(std::string const &columnName, T const &value)
Set the value to insert in a given column.
Class for logical location of a persisted Persistable instance.
virtual void setQueryWhere(std::string const &whereClause)
Set the condition for the WHERE clause of the query.
virtual void dropTable(std::string const &tableName)
Drop a table.
bool columnIsNull(int pos)
Determine if the value of a column is NULL.
void condParam(std::string const ¶mName, T const &value)
Bind a value to a WHERE condition parameter.
Class for database storage.
virtual bool next(void)
Move to the next (first) row of the query result.
virtual void startTransaction(void)
Start a transaction.
A base class for image defects.
DbStorage(void)
Constructor.
std::unique_ptr< DbStorageImpl > _impl
Implementation class for isolation.
virtual void groupBy(std::string const &expression)
Request that the query output be grouped by an expression.
virtual void setPolicy(lsst::pex::policy::Policy::Ptr policy)
Allow a policy to be used to configure the DbStorage.
virtual void orderBy(std::string const &expression)
Request that the query output be sorted by an expression.
virtual void setRetrieveLocation(LogicalLocation const &location)
Set the database location to retrieve from.
virtual void endTransaction(void)
End a transaction.
virtual void insertRow(void)
Insert the row.
std::shared_ptr< DbStorage > Ptr
virtual void setTableForQuery(std::string const &tableName, bool isExpr=false)
Set the table to query (single-table queries only).
virtual void query(void)
Execute the query.
T const & getColumnByPos(int pos)
Get the value of a column of the query result row by position.
virtual void setTableListForQuery(std::vector< std::string > const &tableNameList)
Set a list of tables to query (multiple-table queries).
~DbStorage(void)
Minimal destructor.
virtual void finishQuery(void)
Indicate that query processing is finished.
virtual void setTableForInsert(std::string const &tableName)
Set the table to insert rows into.
virtual void setPersistLocation(LogicalLocation const &location)
Set the database location to persist to.
virtual void createTableFromTemplate(std::string const &tableName, std::string const &templateName, bool mayAlreadyExist=false)
Create a new table from an existing template table.
virtual void setColumnToNull(std::string const &columnName)
Set a given column to NULL.
virtual void truncateTable(std::string const &tableName)
Truncate a table.