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 DemoSQLExecutor RediSQL

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

Overview

Concrete tool for executing SQL queries against Redis via RediSQL, translating results to JDBC ResultSet using DataBuildResultSet.

Description

The DemoSQLExecutor class (RediSQL variant) extends APIJSONSQLExecutor<String> and overrides executeQuery to detect Redis datasource targets. When config.isRedis() is true, it delegates to redisExecuteQuery, which routes queries to JedisClusterUtil.crudBySearch for RediSQL table queries, or to native Redis data type operations (STRING, HASH, LIST, SET, ZSET) via JedisBuildData constants. Results are wrapped in DataBuildResultSet to satisfy the JDBC ResultSet contract.

Usage

Use this class when the APIJSON RediSQL demo needs to execute queries against Redis data types or RediSQL virtual tables.

Code Reference

Source Location

Signature

@Log4j2
public class DemoSQLExecutor extends APIJSONSQLExecutor<String> {
    @Override
    public Connection getConnection(SQLConfig config) throws Exception;
    @Override
    public ResultSet executeQuery(@NotNull SQLConfig config, String sql) throws Exception;
    public ResultSet redisExecuteQuery(@NotNull SQLConfig config, String sql) throws Exception;
}

Import

import apijson.demo.DemoSQLExecutor;

I/O Contract

Inputs

Name Type Required Description
config SQLConfig Yes SQL config with Redis flag and table/column info
sql String Yes Generated SQL or Redis command

Outputs

Name Type Description
executeQuery() returns ResultSet JDBC ResultSet wrapping Redis results (DataBuildResultSet)

Usage Examples

Query Redis STRING via APIJSON

// APIJSON GET request for Redis STRING
{
  "REDIS_STRING": {
    "key": "mykey"
  }
}
// DemoSQLExecutor routes to Redis get and wraps result in DataBuildResultSet

Related Pages

Page Connections

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