Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:APIJSON APIJSON Demo RediSQLClient

From Leeroopedia
Knowledge Sources
Domains Database, Redis, Client_Library
Last Updated 2026-10-14 00:00 GMT

Overview

Concrete tool for communicating with a RediSQL instance over the Redis protocol, extending Jedis to execute RediSQL SQL commands.

Description

The RediSQLClient class extends redis.clients.jedis.Jedis to add RediSQL-specific command execution. It provides constructors for all Jedis connection variants (host/port, SSL, timeout, URI) and sends RediSQL commands by encoding command names and arguments through the Jedis sendCommand protocol. It supports creating databases, executing SQL statements, and retrieving results.

Usage

Use this class when you need to connect directly to a RediSQL-enabled Redis instance to execute SQL commands via the Redis wire protocol.

Code Reference

Source Location

Signature

public class RediSQLClient extends redis.clients.jedis.Jedis {
    public RediSQLClient(String host, int port);
    public RediSQLClient(String host, int port, boolean ssl);
    // ... all Jedis constructors

    public Object exec(String... args);
    public Object createDb(String dbName);
    public Object executeStatement(String dbName, String sql);
    // ...
}

Import

import com.redbeardlab.redisql.client.RediSQLClient;

I/O Contract

Inputs

Name Type Required Description
host String Yes Redis server hostname
port int Yes Redis server port
dbName String No RediSQL database name
sql String No SQL statement to execute

Outputs

Name Type Description
exec() returns Object Raw RediSQL response
createDb() returns Object Database creation result
executeStatement() returns Object SQL execution result

Usage Examples

Connect and Execute RediSQL

import com.redbeardlab.redisql.client.RediSQLClient;

// Connect to RediSQL instance
RediSQLClient client = new RediSQLClient("127.0.0.1", 6379);

// Create a database
client.createDb("mydb");

// Execute SQL
Object result = client.executeStatement("mydb", "CREATE TABLE test (id INT, name TEXT)");
System.out.println(result);

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment