Skip to content

Commit 13bdcdd

Browse files
committed
docs(sql): document <= comparison operator (Phase 2 checkpoint 3)
Add Doxygen documentation for less-than-or-equal operator: - lte: Internal comparison helper - <= operator: Three overloads (encrypted/encrypted, encrypted/jsonb, jsonb/encrypted) All include @brief, @param, @return tags with example usage. Part of: add-doxygen-sql-comments plan Phase: 2 (Core modules - checkpoint 3/7)
1 parent 3e96b26 commit 13bdcdd

File tree

1 file changed

+31
-12
lines changed

1 file changed

+31
-12
lines changed

src/operators/<=.sql

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@
22
-- REQUIRE: src/encrypted/types.sql
33
-- REQUIRE: src/operators/compare.sql
44

5-
6-
-- Operators for <= less than or equal to comparisons of eql_v2_encrypted types
7-
--
8-
-- Uses `eql_v2.compare` for the actual comparison logic.
9-
--
10-
--
5+
--! @brief Less-than-or-equal comparison helper for encrypted values
6+
--! @internal
7+
--!
8+
--! Internal helper that delegates to eql_v2.compare for <= testing.
9+
--! Returns true if first value is less than or equal to second using ORE comparison.
10+
--!
11+
--! @param a eql_v2_encrypted First encrypted value
12+
--! @param b eql_v2_encrypted Second encrypted value
13+
--! @return Boolean True if a <= b (compare result <= 0)
14+
--!
15+
--! @see eql_v2.compare
16+
--! @see eql_v2."<="
1117
CREATE FUNCTION eql_v2.lte(a eql_v2_encrypted, b eql_v2_encrypted)
1218
RETURNS boolean
1319
AS $$
@@ -16,8 +22,21 @@ AS $$
1622
END;
1723
$$ LANGUAGE plpgsql;
1824

19-
20-
25+
--! @brief Less-than-or-equal operator for encrypted values
26+
--!
27+
--! Implements the <= operator for comparing encrypted values using ORE index terms.
28+
--! Enables range queries with inclusive lower bounds without decryption.
29+
--!
30+
--! @param a eql_v2_encrypted Left operand
31+
--! @param b eql_v2_encrypted Right operand
32+
--! @return Boolean True if a <= b
33+
--!
34+
--! @example
35+
--! -- Find records with encrypted age 18 or under
36+
--! SELECT * FROM users WHERE encrypted_age <= '18'::int::text::eql_v2_encrypted;
37+
--!
38+
--! @see eql_v2.compare
39+
--! @see eql_v2.add_search_config
2140
CREATE FUNCTION eql_v2."<="(a eql_v2_encrypted, b eql_v2_encrypted)
2241
RETURNS boolean
2342
AS $$
@@ -36,8 +55,8 @@ CREATE OPERATOR <=(
3655
JOIN = scalarltjoinsel
3756
);
3857

39-
40-
58+
--! @brief <= operator for encrypted value and JSONB
59+
--! @see eql_v2."<="(eql_v2_encrypted, eql_v2_encrypted)
4160
CREATE FUNCTION eql_v2."<="(a eql_v2_encrypted, b jsonb)
4261
RETURNS boolean
4362
AS $$
@@ -56,8 +75,8 @@ CREATE OPERATOR <=(
5675
JOIN = scalarltjoinsel
5776
);
5877

59-
60-
78+
--! @brief <= operator for JSONB and encrypted value
79+
--! @see eql_v2."<="(eql_v2_encrypted, eql_v2_encrypted)
6180
CREATE FUNCTION eql_v2."<="(a jsonb, b eql_v2_encrypted)
6281
RETURNS boolean
6382
AS $$

0 commit comments

Comments
 (0)