All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.scalar.db.storage.jdbc.JdbcProvider Maven / Gradle / Ivy

Go to download

A universal transaction manager that achieves database-agnostic transactions and distributed transactions that span multiple databases

There is a newer version: 3.14.0
Show newest version
package com.scalar.db.storage.jdbc;

import com.scalar.db.api.DistributedStorage;
import com.scalar.db.api.DistributedStorageAdmin;
import com.scalar.db.api.DistributedStorageProvider;
import com.scalar.db.common.CheckedDistributedStorageAdmin;
import com.scalar.db.config.DatabaseConfig;

public class JdbcProvider implements DistributedStorageProvider {
  @Override
  public String getName() {
    return "jdbc";
  }

  @Override
  public DistributedStorage createDistributedStorage(DatabaseConfig config) {
    return new JdbcDatabase(config);
  }

  @Override
  public DistributedStorageAdmin createDistributedStorageAdmin(DatabaseConfig config) {
    // If the database is SQLite, the namespace check is skipped because SQLite does not support
    // namespaces.
    boolean isSqlite = JdbcUtils.isSqlite(new JdbcConfig(config));
    return new CheckedDistributedStorageAdmin(new JdbcAdmin(config), !isSqlite);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy