Package one.microstream.afs.sql.types
Interface SqlProvider
- All Known Subinterfaces:
SqlProviderHana
,SqlProviderMariaDb
,SqlProviderOracle
,SqlProviderPostgres
,SqlProviderSqlite
- All Known Implementing Classes:
SqlProvider.Abstract
,SqlProviderHana.Default
,SqlProviderMariaDb.Default
,SqlProviderOracle.Default
,SqlProviderPostgres.Default
,SqlProviderSqlite.Default
public interface SqlProvider
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
SqlProvider.Abstract
-
Field Summary
Fields Modifier and Type Field Description static String
DATA_COLUMN_NAME
static int
DATA_COLUMN_TYPE
static String
END_COLUMN_NAME
static int
END_COLUMN_TYPE
static int
IDENTIFIER_COLUMN_LENGTH
static String
IDENTIFIER_COLUMN_NAME
static int
IDENTIFIER_COLUMN_TYPE
static String
START_COLUMN_NAME
static int
START_COLUMN_TYPE
-
Method Summary
Modifier and Type Method Description String
catalog()
String
copyFileQuery(String sourceTableName, String targetTableName)
insert into [targetTableName] ('identifier', 'start', 'end', 'data') select ?, 'start', 'end', 'data' from [sourceTableName] where 'identifier' = ?String
countFilesQuery(String tableName)
select count(*) from [tableName]Iterable<String>
createDirectoryQueries(String tableName)
create table [tableName] ( 'identifier' varchar(IDENTIFIER_COLUMN_LENGTH) not null, 'start' bigint not null, 'end' bigint not null, 'blob' not null, primary key ('identifier', 'start') )String
deleteFileQuery(String tableName)
delete from [tableName] where 'identifier' = ?String
deleteFileQueryFromEnd(String tableName)
delete from [tableName] where 'identifier' = ? and 'end' >= ?String
deleteFileQueryFromStart(String tableName)
delete from [tableName] where 'identifier' = ? and 'start' >= ?<T> T
execute(SqlOperation<T> operation)
String
fileExistsQuery(String tableName)
select count(*) from [tableName] where 'identifier' = ?String
fileSizeQuery(String tableName)
select count(*), max('end') from [tableName] where 'identifier' = ?String
listFilesQuery(String tableName)
select distinct 'identifier' from [tableName]String
moveFileQuerySameParent(String tableName)
update [tableName] set 'identifier' = ? where 'identifier' = ?Set<String>
queryDirectories(Connection connection, String prefix)
boolean
queryDirectoryExists(Connection connection, String tableName)
String
readDataQuery(String tableName)
select * from [tableName] where 'identifier' = ? order by 'end' descString
readDataQueryWithLength(String tableName)
select * from [tableName] where 'identifier' = ? and 'start' < ? order by 'end' descString
readDataQueryWithOffset(String tableName)
select * from [tableName] where 'identifier' = ? and 'end' >= ? order by 'end' descString
readDataQueryWithRange(String tableName)
select * from [tableName] where 'identifier' = ? and 'end' >= ? and 'start' <= ? order by 'end' descString
readMetadataQuery(String tableName)
select 'start', 'end' from [tableName] where 'identifier' = ?String
readMetadataQuerySingleSegment(String tableName)
select 'start', 'end' from [tableName] where 'identifier' = ? and start <= ? and end >= ?String
schema()
void
setBlob(PreparedStatement statement, int index, InputStream inputStream, long length)
String
writeDataQuery(String tableName)
insert into [tableName] ('identifier', 'start', 'end', 'data') values (?, ?, ?, ?)
-
Field Details
-
IDENTIFIER_COLUMN_NAME
- See Also:
- Constant Field Values
-
IDENTIFIER_COLUMN_TYPE
static final int IDENTIFIER_COLUMN_TYPE- See Also:
- Constant Field Values
-
IDENTIFIER_COLUMN_LENGTH
static final int IDENTIFIER_COLUMN_LENGTH- See Also:
- Constant Field Values
-
START_COLUMN_NAME
- See Also:
- Constant Field Values
-
START_COLUMN_TYPE
static final int START_COLUMN_TYPE- See Also:
- Constant Field Values
-
END_COLUMN_NAME
- See Also:
- Constant Field Values
-
END_COLUMN_TYPE
static final int END_COLUMN_TYPE- See Also:
- Constant Field Values
-
DATA_COLUMN_NAME
- See Also:
- Constant Field Values
-
DATA_COLUMN_TYPE
static final int DATA_COLUMN_TYPE- See Also:
- Constant Field Values
-
-
Method Details
-
catalog
String catalog() -
schema
String schema() -
execute
-
setBlob
void setBlob(PreparedStatement statement, int index, InputStream inputStream, long length) throws SQLException- Throws:
SQLException
-
queryDirectoryExists
- Throws:
SQLException
-
queryDirectories
- Throws:
SQLException
-
fileSizeQuery
select count(*), max('end') from [tableName] where 'identifier' = ?
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
listFilesQuery
select distinct 'identifier' from [tableName]
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
countFilesQuery
select count(*) from [tableName]
-
readMetadataQuery
select 'start', 'end' from [tableName] where 'identifier' = ?
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
readMetadataQuerySingleSegment
select 'start', 'end' from [tableName] where 'identifier' = ? and start <= ? and end >= ?
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
readDataQuery
select * from [tableName] where 'identifier' = ? order by 'end' desc
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
readDataQueryWithLength
select * from [tableName] where 'identifier' = ? and 'start' < ? order by 'end' desc
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
readDataQueryWithOffset
select * from [tableName] where 'identifier' = ? and 'end' >= ? order by 'end' desc
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
readDataQueryWithRange
select * from [tableName] where 'identifier' = ? and 'end' >= ? and 'start' <= ? order by 'end' desc
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
fileExistsQuery
select count(*) from [tableName] where 'identifier' = ?
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
createDirectoryQueries
create table [tableName] ( 'identifier' varchar(IDENTIFIER_COLUMN_LENGTH) not null, 'start' bigint not null, 'end' bigint not null, 'blob' not null, primary key ('identifier', 'start') )
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
deleteFileQuery
delete from [tableName] where 'identifier' = ?
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
deleteFileQueryFromStart
delete from [tableName] where 'identifier' = ? and 'start' >= ?
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
deleteFileQueryFromEnd
delete from [tableName] where 'identifier' = ? and 'end' >= ?
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
writeDataQuery
insert into [tableName] ('identifier', 'start', 'end', 'data') values (?, ?, ?, ?)
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
moveFileQuerySameParent
update [tableName] set 'identifier' = ? where 'identifier' = ?
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
copyFileQuery
insert into [targetTableName] ('identifier', 'start', 'end', 'data') select ?, 'start', 'end', 'data' from [sourceTableName] where 'identifier' = ?
- Parameters:
sourceTableName
- the source table name to querytargetTableName
- the target table name to query- Returns:
- the native query string
-