Relix

Install

The library

Relix ships as one artifact, on Maven Central. Add it to a Java 21 project and the engine, the standard function library, and the readers for files, web APIs and databases come with it. The solver is a separate artifact (below), needed only by OPTIMIZE and COVER EXACT.

Add it to your build Maven Central · 1.0.0-rc13
dependencies {
    implementation("com.darkcollective.relix:relix:1.0.0-rc13")
}

Nothing else is needed to resolve it: Maven Central is already a repository your build reads, so the coordinate above is the whole of the setup. The twenty-odd modules the engine is assembled from are internal to the build and are not published separately — the module graph is a claim the build enforces about itself, not a set of names a program should depend on.

The solver

OPTIMIZE and COVER EXACT need a solver, which is published beside the engine at the same version: com.darkcollective.relix:relix-solver-ojalgo. Without it, a query using either operator fails before it reads any input, with an error naming the artifact to add; every other operator runs. The solver is found at run time, so it belongs on the runtime class path and nothing compiles against it:

dependencies {
    runtimeOnly("com.darkcollective.relix:relix-solver-ojalgo:1.0.0-rc13")
}

ojalgo arrives as a dependency of that artifact rather than merged into its jar. Shading it would hide it from your dependency report and from whatever scans that report for vulnerabilities, which is a worse trade than one visible dependency. Two other artifacts are published at the same version: relix-docs, the language reference and the class that reads it, and relix-all, which has no code and names the engine and both of the others.

A JDBC driver is the one thing that is not included: add the driver for your database alongside it. Getting the library covers both, and shows how to ask a session what it actually found on the classpath.

There is no server to install and no daemon to keep running. Relix runs inside your own program, in your own process, and reads data through the connections you hand it.

Database drivers

The H2 driver is enough to run every example in the manuals. For PostgreSQL, MySQL or anything else, add that database's JDBC driver to your project alongside the artifact above, and Relix will use it. A session downloads nothing on your behalf: what it can reach is what you put on the classpath, and the version relation reports what it actually found.

The command line

The relix command runs scripts from a shell, as one stage of a Unix pipeline. It ships as a self-contained archive for macOS, Linux and Windows, with its own Java runtime, so no Java is needed on the machine.

On macOS and Linux, with Homebrew:

brew tap DarkCollective/relix
brew trust --formula darkcollective/relix/relix
brew install relix

Homebrew 7 loads a formula from a tap outside Homebrew only once you trust it, and --formula trusts the relix formula alone rather than the whole tap. A Homebrew without a brew trust command does not ask for it; skip that line.

On Windows, with Scoop:

scoop bucket add relix https://github.com/DarkCollective/scoop-relix
scoop install relix

Or download the archive for your platform from the releases page and put its bin directory on your PATH. The relix command runs a first query and shows the shape every command shares.

Building from source

The artifact is what most programs want; building from source is for working on Relix itself, or for depending on a change that is not released. Relix builds with Gradle and targets Java 21; the wrapper provisions the toolchain if your Gradle is configured for it.

./gradlew publishToMavenLocal

That publishes the single artifact named above to your local Maven repository, under the version in the build. Add mavenLocal() to the consuming build's repositories and it resolves from there. ./gradlew build runs the whole test suite, both manuals' examples included: the guide's Java is compiled and run, and the reference's queries are analysed and executed.