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

me.archdev.foundationdb.FoundationDB.scala Maven / Gradle / Ivy

The newest version!
package me.archdev.foundationdb

import com.apple.foundationdb.{ Database, FDB }
import me.archdev.foundationdb.clients.{ DatabaseClient, InMemoryClient }

import scala.concurrent.ExecutionContext

object FoundationDB {

  def connect(apiVersion: Int)(implicit ec: ExecutionContext): FoundationDB =
    connect(apiVersion, null)

  def connect(apiVersion: Int, clusterFilePath: String)(implicit ec: ExecutionContext): FoundationDB =
    connect(FDB.selectAPIVersion(apiVersion).open(clusterFilePath, ExecutionContextExecutorServiceBridge(ec)))

  def connect(database: Database): FoundationDB =
    new DatabaseClient(database).asInstanceOf[FoundationDB]

  def inMemory(): FoundationDB =
    new InMemoryClient().asInstanceOf[FoundationDB]

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy