org.jsimpledb.kv.cockroach.CockroachKVImplementation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsimpledb-kv-cockroach Show documentation
Show all versions of jsimpledb-kv-cockroach Show documentation
JSimpleDB key/value store implementation based on CockroachDB.
/*
* Copyright (C) 2015 Archie L. Cobbs. All rights reserved.
*/
package org.jsimpledb.kv.cockroach;
import java.util.ArrayDeque;
import org.jsimpledb.kv.sql.SQLDriverKVImplementation;
public class CockroachKVImplementation extends SQLDriverKVImplementation {
public static final String POSTGRESQL_DRIVER_CLASS_NAME = "org.postgresql.Driver";
/**
* Default constructor.
*/
public CockroachKVImplementation() {
this(POSTGRESQL_DRIVER_CLASS_NAME);
}
/**
* Constructor allowing alternative driver.
*
* @param driverClassName Cockroach {@link java.sql.Driver} implementation class name
*/
public CockroachKVImplementation(String driverClassName) {
super(driverClassName);
}
@Override
public String[][] getCommandLineOptions() {
return new String[][] {
{ "--cockroach URL", "Use CockroachDB key/value store with the given JDBC URL" },
};
}
@Override
public String parseCommandLineOptions(ArrayDeque options) {
return this.parseCommandLineOption(options, "--cockroach");
}
@Override
public String getDescription(Object configuration) {
return "CockroachDB";
}
@Override
protected CockroachKVDatabase createSQLKVDatabase(Object configuration) {
return new CockroachKVDatabase();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy