@Default @Singleton public class SQLDatabaseWrangler extends Object implements DatabaseWrangler
| Constructor and Description |
|---|
SQLDatabaseWrangler(org.gcube.data.analysis.tabulardata.cube.data.connection.DatabaseConnectionProvider adminConnectionProvider,
org.gcube.data.analysis.tabulardata.cube.data.connection.DatabaseConnectionProvider unprivilegedConnectionProvider,
org.gcube.data.analysis.tabulardata.model.mapping.SQLModelMapper sqlModelMapper,
ResourceFinder resourceFinder) |
| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(String tableName,
String columnName,
org.gcube.data.analysis.tabulardata.model.datatype.DataType type) |
void |
addColumn(String tableName,
String columnName,
org.gcube.data.analysis.tabulardata.model.datatype.DataType type,
org.gcube.data.analysis.tabulardata.model.datatype.value.TDTypeValue defaultValue) |
void |
alterColumnType(String tableName,
String columnName,
org.gcube.data.analysis.tabulardata.model.datatype.DataType newType) |
String |
cloneTable(String tableName,
boolean withData,
boolean unsafe) |
void |
createIndex(String tableName,
String columnName) |
String |
createTable() |
String |
createTable(boolean unsafe) |
void |
createTable(String name) |
void |
createTriggerOnTable(String triggerName,
List<Condition> conditions,
HTime htime,
String targetTableName,
String procedure) |
void |
createUniqueIndex(String tableName,
String columnName) |
void |
executeQuery(String query) |
boolean |
exists(String tableName) |
void |
removeColumn(String tableName,
String columnName) |
void |
removeTable(String tableName) |
void |
setNullable(String tableName,
String columnName,
boolean nullable) |
@Inject
public SQLDatabaseWrangler(org.gcube.data.analysis.tabulardata.cube.data.connection.DatabaseConnectionProvider adminConnectionProvider,
org.gcube.data.analysis.tabulardata.cube.data.connection.DatabaseConnectionProvider unprivilegedConnectionProvider,
org.gcube.data.analysis.tabulardata.model.mapping.SQLModelMapper sqlModelMapper,
@Default
ResourceFinder resourceFinder)
public String createTable()
createTable in interface DatabaseWranglerpublic void createTable(String name)
createTable in interface DatabaseWranglerpublic String createTable(boolean unsafe)
createTable in interface DatabaseWranglerunsafe - a boolean telling if the table can should be unsafe or not (tradeoff performance/reliability)public void removeTable(String tableName)
removeTable in interface DatabaseWranglerpublic String cloneTable(String tableName, boolean withData, boolean unsafe)
cloneTable in interface DatabaseWranglerpublic boolean exists(String tableName)
exists in interface DatabaseWranglerpublic void addColumn(String tableName, String columnName, org.gcube.data.analysis.tabulardata.model.datatype.DataType type)
addColumn in interface DatabaseWranglerpublic void addColumn(String tableName, String columnName, org.gcube.data.analysis.tabulardata.model.datatype.DataType type, org.gcube.data.analysis.tabulardata.model.datatype.value.TDTypeValue defaultValue)
addColumn in interface DatabaseWranglerpublic void removeColumn(String tableName, String columnName)
removeColumn in interface DatabaseWranglerpublic void alterColumnType(String tableName, String columnName, org.gcube.data.analysis.tabulardata.model.datatype.DataType newType)
alterColumnType in interface DatabaseWranglerpublic void executeQuery(String query)
public void createIndex(String tableName, String columnName)
createIndex in interface DatabaseWranglerpublic void setNullable(String tableName, String columnName, boolean nullable)
setNullable in interface DatabaseWranglerpublic void createTriggerOnTable(String triggerName, List<Condition> conditions, HTime htime, String targetTableName, String procedure)
createTriggerOnTable in interface DatabaseWranglerpublic void createUniqueIndex(String tableName, String columnName)
createUniqueIndex in interface DatabaseWranglerCopyright © 2014. All Rights Reserved.