Package one.microstream.afs.sql.types
Interface SqlProvider
- All Known Subinterfaces:
SqlProviderMariaDb
,SqlProviderPostgres
,SqlProviderSqlite
- All Known Implementing Classes:
SqlProvider.Abstract
,SqlProviderMariaDb.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' = ?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' = ?
-
listFilesQuery
select distinct 'identifier' from [tableName]
-
readMetadataQuery
select 'start', 'end' from [tableName] where 'identifier' = ?
-
readMetadataQuerySingleSegment
select 'start', 'end' from [tableName] where 'identifier' = ? and start <= ? and end >= ?
-
readDataQuery
select * from [tableName] where 'identifier' = ? order by 'end' desc
-
readDataQueryWithLength
select * from [tableName] where 'identifier' = ? and 'start' < ? order by 'end' desc
-
readDataQueryWithOffset
select * from [tableName] where 'identifier' = ? and 'end' >= ? order by 'end' desc
-
readDataQueryWithRange
select * from [tableName] where 'identifier' = ? and 'end' >= ? and 'start' <= ? order by 'end' desc
-
fileExistsQuery
select count(*) from [tableName] where 'identifier' = ?
-
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') )
-
deleteFileQuery
delete from [tableName] where 'identifier' = ?
-
deleteFileQueryFromStart
delete from [tableName] where 'identifier' = ? and 'start' >= ?
-
deleteFileQueryFromEnd
delete from [tableName] where 'identifier' = ? and 'end' >= ?
-
writeDataQuery
insert into [tableName] ('identifier', 'start', 'end', 'data') values (?, ?, ?, ?)
-
moveFileQuerySameParent
update [tableName] set 'identifier' = ? where 'identifier' = ?
-
copyFileQuery
insert into [targetTableName] ('identifier', 'start', 'end', 'data') select ?, 'start', 'end', 'data' from [sourceTableName] where 'identifier' = ?
-