Scalar DB SQL is an SQL layer for Scalar DB. Specifically, it parses SQL and converts it to a set of Scalar DB (API) operations.

Install

The library and the JDBC Scalar DB driver are available on Packages in this repository. Since they are available under a commercial license, you need to get the license and permission to access them. For more details, please contact us.

Before you add the dependency, you need to add the Maven repository using your build tool such as Gradle and Maven.

To add the Maven repository using Gradle, add the following repository to your build.gradle:

repositories {
    maven {
        url = uri("https://maven.pkg.github.com/scalar-labs/scalardb-sql")
        credentials {
            username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
            password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
        }
    }
}

In this case, you need the gpr.user property for your GitHub username and the gpr.key property for your personal access token. So you need to have the properties in ~/.gradle/gradle.properties, or specify the properties with the -P option when running the gradle command as follows:

$ gradle build -Pgpr.user=<your GitHub username> -Pgpr.key=<your personal access token>

Or you can also use environment variables, USERNAME for your GitHub username and TOKEN for your personal access token.

$ export USERNAME=<your GitHub username>
$ export TOKEN=<your personal access token>

To add the Maven repository using Maven, edit your ~/.m2/settings.xml file as follows:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">

  <activeProfiles>
    <activeProfile>github</activeProfile>
  </activeProfiles>

  <profiles>
    <profile>
      <id>github</id>
      <repositories>
        <repository>
          <id>central</id>
          <url>https://repo1.maven.org/maven2</url>
        </repository>
        <repository>
          <id>github</id>
          <url>https://maven.pkg.github.com/scalar-labs/scalardb-sql</url>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
      </repositories>
    </profile>
  </profiles>

  <servers>
    <server>
      <id>github</id>
      <username>USERNAME</username>
      <password>TOKEN</password>
    </server>
  </servers>
</settings>

In the servers tag, add a child server tag with an id, replacing USERNAME with your GitHub username, and TOKEN with your personal access token.

Please see also the following documents for more details:

And then, you can install the library in your application using your build tool such as Gradle and Maven.

To add a dependency on Scalar DB SQL using Gradle, use the following:

dependencies {
    implementation 'com.scalar-labs:scalardb-sql:3.7.3'
}

To add a dependency using Maven:

<dependency>
  <groupId>com.scalar-labs</groupId>
  <artifactId>scalardb-sql</artifactId>
  <version>3.7.3</version>
</dependency>

You can also install the Scalar DB JDBC driver in your application.

To add a dependency on Scalar DB JDBC driver using Gradle, use the following:

dependencies {
    implementation 'com.scalar-labs:scalardb-sql-jdbc:3.7.3'
}

To add a dependency using Maven:

<dependency>
  <groupId>com.scalar-labs</groupId>
  <artifactId>scalardb-sql-jdbc</artifactId>
  <version>3.7.3</version>
</dependency>

Docs