Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

[target.x86_64-unknown-linux-gnu]
rustflags = "-L deps/readies/wd40/linux-x64"

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jsonpath_lib = { git="https://github.com/RedisJSON/jsonpath.git", branch="public
# redis-module = { version="0.12.0", features = ["experimental-api"]}
redis-module = { git = "https://github.com/RedisLabsModules/redismodule-rs", branch = "feature-search-json", features = ["experimental-api"] }
lazy_static = "1.4.0"
# readies-wd40 = { path = "deps/readies/wd40" }

[features]
# Workaround to allow cfg(feature = "test") in redismodue-rs dependencies:
Expand Down
5 changes: 5 additions & 0 deletions src/c_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ use std::{
};

use redis_module::key::RedisKeyWritable;
use redis_module::logging::log_notice;
use redis_module::{raw as rawmod, RedisError};
use redis_module::{Context, NotifyEvent, Status};
use serde_json::Value;

use crate::{redisjson::RedisJSON, REDIS_JSON_TYPE};

// extern crate readies_wd40;
// use crate::readies_wd40::{BB, _BB, getenv};

//
// structs
//
Expand Down Expand Up @@ -362,6 +366,7 @@ pub extern "C" fn JSONAPI_get(
static REDISJSON_GETAPI: &str = concat!("RedisJSON_V1", "\0");

pub fn export_shared_api(ctx: &Context) {
log_notice("Exported RedisJSON_V1 API");
ctx.export_shared_api(
&JSONAPI as *const RedisJSONAPI_V1 as *const c_void,
REDISJSON_GETAPI.as_ptr() as *mut i8,
Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ use crate::c_api::{export_shared_api, notify_keyspace_event};
use crate::error::Error;
use crate::redisjson::{Format, Path, RedisJSON, SetOptions};

// extern crate readies_wd40;
// use crate::readies_wd40::{BB, _BB, getenv};

pub const REDIS_JSON_TYPE_VERSION: i32 = 2;

static REDIS_JSON_TYPE: RedisType = RedisType::new(
Expand Down Expand Up @@ -771,6 +774,7 @@ redis_module! {
data_types: [
REDIS_JSON_TYPE,
],
init: init,
commands: [
["json.del", json_del, "write", 1,1,1],
["json.get", json_get, "readonly", 1,1,1],
Expand Down