25 #ifndef LSST_MWI_PERSISTENCE_DBTSVSTORAGE_H 26 #define LSST_MWI_PERSISTENCE_DBTSVSTORAGE_H 64 namespace persistence {
82 bool mayAlreadyExist =
false);
94 T* location,
bool isExpr =
false);
DbTsvStorage(void)
Constructor.
virtual void startTransaction(void)
Start a transaction.
int _getColumnIndex(std::string const &columnName)
Get the index of a given column.
virtual void setPersistLocation(LogicalLocation const &location)
Set the database location to persist to.
Interface for DbStorage class.
std::vector< std::string > _rowBuffer
Class for logical location of a persisted Persistable instance.
virtual void setPolicy(lsst::pex::policy::Policy::Ptr policy)
Allow a policy to be used to configure the DbTsvStorage.
char * _fileName
Full pathname for temporary TSV file.
virtual void setColumnToNull(std::string const &columnName)
Set a given column to NULL.
std::string _location
Database location URL.
Class for database storage.
void outParam(std::string const &columnName, T *location, bool isExpr=false)
Request a column in the query output and bind a destination location.
std::map< std::string, int > _colMap
Map from column names to positions.
std::ostringstream _convertStream
Stream to convert to text.
std::string _tempPath
Directory pathname for temporary TSV file.
~DbTsvStorage(void)
Minimal destructor.
virtual void truncateTable(std::string const &tableName)
Truncate a table.
bool _saveTemp
Do not delete temporary TSV file if true.
A base class for image defects.
virtual void setTableForInsert(std::string const &tableName)
Set the table to insert rows into.
Class for database storage with data loading from TSV files.
virtual void endTransaction(void)
End a transaction.
std::shared_ptr< DbTsvStorage > Ptr
T const & getColumnByPos(int pos)
Get the value of a column of the query result row by position.
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 insertRow(void)
Insert the row.
std::unique_ptr< std::ofstream > _osp
Output TSV stream.
Interface for LogicalLocation class.
void setColumn(std::string const &columnName, T const &value)
Set the value to insert in a given column.
virtual void setRetrieveLocation(LogicalLocation const &location)
Set the database location to retrieve from.
void condParam(std::string const ¶mName, T const &value)
Bind a value to a WHERE condition parameter.
virtual void dropTable(std::string const &tableName)
Drop a table.