add searchableJson query type for automatic operation inference#283
add searchableJson query type for automatic operation inference#283
Conversation
…inference Add searchableJson as a new query type that auto-infers the correct query operation (ste_vec_selector or ste_vec_term) from the plaintext value type: - String values → ste_vec_selector (JSONPath queries) - Object/Array/Number/Boolean → ste_vec_term (containment queries) This provides a friendlier API compared to explicitly specifying steVecSelector or steVecTerm. Existing query types remain unchanged.
Add documentation explaining that searchableJson behaves identically to omitting queryType on ste_vec columns - both auto-infer the query operation. The explicit queryType is useful for code clarity.
|
📝 WalkthroughWalkthroughAdds a new Changes
Sequence Diagram(s)sequenceDiagram
participant Client as ProtectClient
participant Resolver as InferIndexType
participant FFI as ste_vec FFI
participant DB as Database
Client->>Resolver: resolveIndexType(column, queryType='searchableJson', plaintext)
alt plaintext is string
Resolver-->>Client: indexType='ste_vec', queryOp='ste_vec_selector'
else plaintext is object/array
Resolver-->>Client: indexType='ste_vec', queryOp='ste_vec_term'
else plaintext is null/undefined
Resolver-->>Client: indexType='ste_vec' (no queryOp)
end
Client->>FFI: encryptQuery(payload with indexType, queryOp?)
FFI->>DB: store/encrypt using ste_vec semantics
DB-->>FFI: ack
FFI-->>Client: encrypted result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
@CodeRabbit full review |
✅ Actions performedFull review triggered. |
Summary by CodeRabbit
New Features
Tests