Skip to content

Commit c62fd28

Browse files
committed
fix: update duckdb dep
1 parent 555f7d0 commit c62fd28

File tree

9 files changed

+332
-195
lines changed

9 files changed

+332
-195
lines changed

CLAUDE.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
This is a DuckDB extension that provides Redis client functionality, allowing interaction with Redis servers directly from SQL queries. It uses Boost.Asio for network communication and implements the Redis protocol directly.
8+
9+
## Build Commands
10+
11+
```sh
12+
# Build release (default)
13+
GEN=ninja make
14+
15+
# Build debug
16+
GEN=ninja make debug
17+
18+
# Run tests
19+
make test
20+
21+
# Format code
22+
make format
23+
24+
# Run clang-tidy
25+
make tidy-check
26+
```
27+
28+
It is best to test with a debug build since it tests more assertions.
29+
30+
All extension functions should be documented inside of DuckDB with CreateScalarFunctionInfo or CreateAggregateFunctionInfo or the appropriate type for the function. This documentation of the function should include examples, parameter types and parameter names. The function should be categorized.
31+
32+
When making changes the version should always be updated to the current date plus an ordinal counter in the form of YYYYMMDDCC.
33+
34+
## Project Structure
35+
36+
- `src/redis_extension.cpp` - Main extension code containing:
37+
- `RedisProtocol` class: Redis RESP protocol formatting/parsing
38+
- `RedisConnection` class: TCP socket connection management via Boost.Asio
39+
- `ConnectionPool` class: Singleton connection pooling
40+
- All scalar and table function implementations (redis_get, redis_set, redis_hget, etc.)
41+
- `src/redis_secret.cpp` - DuckDB secret type registration for storing Redis connection credentials
42+
- `src/include/` - Header files
43+
- `test/sql/` - SQLLogicTest files
44+
- `duckdb/` - DuckDB submodule (source)
45+
- `extension-ci-tools/` - Build infrastructure submodule
46+
47+
## Dependencies
48+
49+
- **Boost.Asio** - Network I/O (installed via vcpkg, see `vcpkg.json`)
50+
- Build uses vcpkg toolchain: set `VCPKG_TOOLCHAIN_PATH` environment variable
51+
52+
## Architecture Notes
53+
54+
- Extension registers a `redis` secret type that stores host, port, and password
55+
- All Redis functions take a secret name as the last parameter to identify which connection to use
56+
- Connection pooling is per host:port combination
57+
- Redis protocol is implemented directly (no external Redis client library)
58+
- Scalar functions: `redis_get`, `redis_set`, `redis_hget`, `redis_hset`, `redis_lpush`, `redis_lrange`, `redis_mget`, `redis_scan`, `redis_hscan`, `redis_del`, `redis_exists`, `redis_type`
59+
- Table functions: `redis_keys`, `redis_hgetall`, `redis_lrange_table`, `redis_hscan_over_scan`
60+
61+
## Testing
62+
63+
Tests use DuckDB's SQLLogicTest format. Test files are in `test/sql/`. The current test file needs updating as it references a `quack` extension (template leftover).

duckdb

Submodule duckdb updated 5850 files

src/include/redis_extension.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@
55

66
namespace duckdb {
77

8+
class ExtensionLoader;
9+
810
class RedisExtension : public Extension {
911
public:
10-
void Load(DuckDB &db) override;
12+
void Load(ExtensionLoader &loader) override;
1113
std::string Name() override;
14+
std::string Version() const override;
1215
};
1316

1417
} // namespace duckdb

src/include/redis_secret.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
#include "duckdb/main/secret/secret.hpp"
44
#include "duckdb/main/secret/secret_manager.hpp"
5-
#include "duckdb/main/extension_util.hpp"
65

76
namespace duckdb {
87

8+
class ExtensionLoader;
9+
910
class CreateRedisSecretFunctions {
1011
public:
11-
static void Register(DatabaseInstance &instance);
12+
static void Register(ExtensionLoader &loader);
1213
};
1314

1415
} // namespace duckdb

0 commit comments

Comments
 (0)