public class CockroachKVDatabase extends SQLKVDatabase
KVDatabase implementation based on CockroachDB.
Automatically creates the key/value table on startup if it doesn't already exist.
WARNING: not fully working yet; see issue #1962.
dataSource, DEFAULT_KEY_COLUMN_NAME, DEFAULT_TABLE_NAME, DEFAULT_VALUE_COLUMN_NAME, isolationLevel, keyColumnName, log, OPTION_ISOLATION, tableName, valueColumnName| Constructor and Description |
|---|
CockroachKVDatabase() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
beginTransaction(Connection connection) |
String |
createPutStatement() |
protected org.jsimpledb.kv.cockroach.CockroachKVTransaction |
createSQLKVTransaction(Connection connection) |
protected void |
initializeDatabaseIfNecessary(Connection connection) |
String |
limitSingleRow(String sql)
Appends
LIMIT 1 to the statement. |
protected void |
postBeginTransaction(Connection connection) |
String |
quote(String name)
Encloses the given
name in backticks. |
KVTransactionException |
wrapException(SQLKVTransaction tx,
SQLException e) |
configureConnection, createGetAllStatement, createGetAtLeastStatement, createGetAtMostStatement, createGetRangeStatement, createGetStatement, createRemoveAllStatement, createRemoveAtLeastStatement, createRemoveAtMostStatement, createRemoveRangeStatement, createRemoveStatement, createTransaction, createTransaction, createTransactionConnection, getDataSource, getIsolationLevel, getIsolationLevel, getKeyColumnName, getTableName, getValueColumnName, isRollbackForReadOnly, preBeginTransaction, setDataSource, setIsolationLevel, setKeyColumnName, setRollbackForReadOnly, setTableName, setValueColumnName, start, stopprotected void initializeDatabaseIfNecessary(Connection connection) throws SQLException
initializeDatabaseIfNecessary in class SQLKVDatabaseSQLExceptionprotected void beginTransaction(Connection connection) throws SQLException
beginTransaction in class SQLKVDatabaseSQLExceptionprotected void postBeginTransaction(Connection connection) throws SQLException
postBeginTransaction in class SQLKVDatabaseSQLExceptionprotected org.jsimpledb.kv.cockroach.CockroachKVTransaction createSQLKVTransaction(Connection connection) throws SQLException
createSQLKVTransaction in class SQLKVDatabaseSQLExceptionpublic String createPutStatement()
createPutStatement in class SQLKVDatabasepublic String quote(String name)
name in backticks.quote in class SQLKVDatabasepublic String limitSingleRow(String sql)
LIMIT 1 to the statement.limitSingleRow in class SQLKVDatabasepublic KVTransactionException wrapException(SQLKVTransaction tx, SQLException e)
wrapException in class SQLKVDatabaseCopyright © 2017. All rights reserved.