Skip to content

teaql/teaql-java-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TeaQL Java Client

Java 17+ client for the TeaQL API, with a fluent builder-style entry point.

Usage

import io.teaql.client.TeaQLClient;
import java.nio.file.Path;
import java.time.Duration;
import java.util.List;
import java.util.Map;

public class Example {
    public static void main(String[] args) {
        var client = TeaQLClient.builder()
            .endpoint("https://api.teaql.io/latest/")
            .licenseFile(Path.of("/path/to/license"))
            .timeout(Duration.ofSeconds(30))
            .build();

        // Run a named query
        List<Map<String, Object>> users = client.query(
            "User",
            "list",
            Map.of("merchantId", "M001")
        );

        // Run a mutation
        Object result = client.mutate(
            "User",
            "create",
            Map.of("name", "Alice", "email", "alice@example.com")
        );

        // Health check
        boolean ok = client.ping();
    }
}

License configuration

Three ways to provide a license key:

// 1. Explicit file path
.licenseFile(Path.of("/path/to/license"))

// 2. Default location (TEAQL_LICENSE env var, then ~/.teaql/license)
.licenseFile()

// 3. Raw string (for environments without a file)
.licenseKey("your-license-key-here")

Maven

<dependency>
  <groupId>io.teaql</groupId>
  <artifactId>teaql-java-client</artifactId>
  <version>0.1.0</version>
</dependency>

Requirements

  • Java 17 or later

License

Apache-2.0

About

Java client to access teaql generative services

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages