Skip to content

Commit 619049f

Browse files
committed
Revert "chore(sql): remove disabled ORE block operator files"
This reverts commit bcca4b8.
1 parent bcca4b8 commit 619049f

File tree

2 files changed

+239
-0
lines changed

2 files changed

+239
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
-- NOTE FILE IS DISABLED
2+
-- REPLACE `!REQUIRE` with `REQUIRE` to enable in the build
3+
4+
-- !REQUIRE: src/schema.sql
5+
-- !REQUIRE: src/ore_block_u64_8_256/types.sql
6+
7+
8+
--! @brief B-tree operator family for ORE block types
9+
--!
10+
--! Defines the operator family for creating B-tree indexes on ORE block types.
11+
--!
12+
--! @note FILE IS DISABLED - Not included in build
13+
--! @see eql_v2.ore_block_u64_8_256_operator_class
14+
CREATE OPERATOR FAMILY eql_v2.ore_block_u64_8_256_operator_family USING btree;
15+
16+
--! @brief B-tree operator class for ORE block encrypted values
17+
--!
18+
--! Defines the operator class required for creating B-tree indexes on columns
19+
--! using the ore_block_u64_8_256 type. Enables range queries and ORDER BY on
20+
--! ORE-encrypted data without decryption.
21+
--!
22+
--! Supports operators: <, <=, =, >=, >
23+
--! Uses comparison function: compare_ore_block_u64_8_256_terms
24+
--!
25+
--! @note FILE IS DISABLED - Not included in build
26+
--!
27+
--! @example
28+
--! -- Would be used like (if enabled):
29+
--! CREATE INDEX ON events USING btree (
30+
--! (encrypted_timestamp::jsonb->'ob')::eql_v2.ore_block_u64_8_256
31+
--! );
32+
--!
33+
--! @see CREATE OPERATOR CLASS in PostgreSQL documentation
34+
--! @see eql_v2.compare_ore_block_u64_8_256_terms
35+
CREATE OPERATOR CLASS eql_v2.ore_block_u64_8_256_operator_class DEFAULT FOR TYPE eql_v2.ore_block_u64_8_256 USING btree FAMILY eql_v2.ore_block_u64_8_256_operator_family AS
36+
OPERATOR 1 <,
37+
OPERATOR 2 <=,
38+
OPERATOR 3 =,
39+
OPERATOR 4 >=,
40+
OPERATOR 5 >,
41+
FUNCTION 1 eql_v2.compare_ore_block_u64_8_256_terms(a eql_v2.ore_block_u64_8_256, b eql_v2.ore_block_u64_8_256);
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
-- NOTE FILE IS DISABLED
2+
-- REPLACE `!REQUIRE` with `REQUIRE` to enable in the build
3+
4+
-- !REQUIRE: src/schema.sql
5+
-- !REQUIRE: src/crypto.sql
6+
-- !REQUIRE: src/ore_block_u64_8_256/types.sql
7+
-- !REQUIRE: src/ore_block_u64_8_256/functions.sql
8+
9+
--! @brief Equality operator for ORE block types
10+
--! @internal
11+
--!
12+
--! Implements the = operator for direct ORE block comparisons.
13+
--!
14+
--! @param a eql_v2.ore_block_u64_8_256 Left operand
15+
--! @param b eql_v2.ore_block_u64_8_256 Right operand
16+
--! @return Boolean True if ORE blocks are equal
17+
--!
18+
--! @note FILE IS DISABLED - Not included in build
19+
--! @see eql_v2.compare_ore_block_u64_8_256_terms
20+
CREATE FUNCTION eql_v2.ore_block_u64_8_256_eq(a eql_v2.ore_block_u64_8_256, b eql_v2.ore_block_u64_8_256)
21+
RETURNS boolean AS $$
22+
SELECT eql_v2.compare_ore_block_u64_8_256_terms(a, b) = 0
23+
$$ LANGUAGE SQL;
24+
25+
26+
27+
--! @brief Not equal operator for ORE block types
28+
--! @internal
29+
--!
30+
--! Implements the <> operator for direct ORE block comparisons.
31+
--!
32+
--! @param a eql_v2.ore_block_u64_8_256 Left operand
33+
--! @param b eql_v2.ore_block_u64_8_256 Right operand
34+
--! @return Boolean True if ORE blocks are not equal
35+
--!
36+
--! @note FILE IS DISABLED - Not included in build
37+
--! @see eql_v2.compare_ore_block_u64_8_256_terms
38+
CREATE FUNCTION eql_v2.ore_block_u64_8_256_neq(a eql_v2.ore_block_u64_8_256, b eql_v2.ore_block_u64_8_256)
39+
RETURNS boolean AS $$
40+
SELECT eql_v2.compare_ore_block_u64_8_256_terms(a, b) <> 0
41+
$$ LANGUAGE SQL;
42+
43+
44+
45+
--! @brief Less than operator for ORE block types
46+
--! @internal
47+
--!
48+
--! Implements the < operator for direct ORE block comparisons.
49+
--!
50+
--! @param a eql_v2.ore_block_u64_8_256 Left operand
51+
--! @param b eql_v2.ore_block_u64_8_256 Right operand
52+
--! @return Boolean True if left operand is less than right operand
53+
--!
54+
--! @note FILE IS DISABLED - Not included in build
55+
--! @see eql_v2.compare_ore_block_u64_8_256_terms
56+
CREATE FUNCTION eql_v2.ore_block_u64_8_256_lt(a eql_v2.ore_block_u64_8_256, b eql_v2.ore_block_u64_8_256)
57+
RETURNS boolean AS $$
58+
SELECT eql_v2.compare_ore_block_u64_8_256_terms(a, b) = -1
59+
$$ LANGUAGE SQL;
60+
61+
62+
63+
--! @brief Less than or equal operator for ORE block types
64+
--! @internal
65+
--!
66+
--! Implements the <= operator for direct ORE block comparisons.
67+
--!
68+
--! @param a eql_v2.ore_block_u64_8_256 Left operand
69+
--! @param b eql_v2.ore_block_u64_8_256 Right operand
70+
--! @return Boolean True if left operand is less than or equal to right operand
71+
--!
72+
--! @note FILE IS DISABLED - Not included in build
73+
--! @see eql_v2.compare_ore_block_u64_8_256_terms
74+
CREATE FUNCTION eql_v2.ore_block_u64_8_256_lte(a eql_v2.ore_block_u64_8_256, b eql_v2.ore_block_u64_8_256)
75+
RETURNS boolean AS $$
76+
SELECT eql_v2.compare_ore_block_u64_8_256_terms(a, b) != 1
77+
$$ LANGUAGE SQL;
78+
79+
80+
81+
--! @brief Greater than operator for ORE block types
82+
--! @internal
83+
--!
84+
--! Implements the > operator for direct ORE block comparisons.
85+
--!
86+
--! @param a eql_v2.ore_block_u64_8_256 Left operand
87+
--! @param b eql_v2.ore_block_u64_8_256 Right operand
88+
--! @return Boolean True if left operand is greater than right operand
89+
--!
90+
--! @note FILE IS DISABLED - Not included in build
91+
--! @see eql_v2.compare_ore_block_u64_8_256_terms
92+
CREATE FUNCTION eql_v2.ore_block_u64_8_256_gt(a eql_v2.ore_block_u64_8_256, b eql_v2.ore_block_u64_8_256)
93+
RETURNS boolean AS $$
94+
SELECT eql_v2.compare_ore_block_u64_8_256_terms(a, b) = 1
95+
$$ LANGUAGE SQL;
96+
97+
98+
99+
--! @brief Greater than or equal operator for ORE block types
100+
--! @internal
101+
--!
102+
--! Implements the >= operator for direct ORE block comparisons.
103+
--!
104+
--! @param a eql_v2.ore_block_u64_8_256 Left operand
105+
--! @param b eql_v2.ore_block_u64_8_256 Right operand
106+
--! @return Boolean True if left operand is greater than or equal to right operand
107+
--!
108+
--! @note FILE IS DISABLED - Not included in build
109+
--! @see eql_v2.compare_ore_block_u64_8_256_terms
110+
CREATE FUNCTION eql_v2.ore_block_u64_8_256_gte(a eql_v2.ore_block_u64_8_256, b eql_v2.ore_block_u64_8_256)
111+
RETURNS boolean AS $$
112+
SELECT eql_v2.compare_ore_block_u64_8_256_terms(a, b) != -1
113+
$$ LANGUAGE SQL;
114+
115+
116+
117+
--! @brief = operator for ORE block types
118+
--! @note FILE IS DISABLED - Not included in build
119+
CREATE OPERATOR = (
120+
FUNCTION=eql_v2.ore_block_u64_8_256_eq,
121+
LEFTARG=eql_v2.ore_block_u64_8_256,
122+
RIGHTARG=eql_v2.ore_block_u64_8_256,
123+
NEGATOR = <>,
124+
RESTRICT = eqsel,
125+
JOIN = eqjoinsel,
126+
HASHES,
127+
MERGES
128+
);
129+
130+
131+
132+
--! @brief <> operator for ORE block types
133+
--! @note FILE IS DISABLED - Not included in build
134+
CREATE OPERATOR <> (
135+
FUNCTION=eql_v2.ore_block_u64_8_256_neq,
136+
LEFTARG=eql_v2.ore_block_u64_8_256,
137+
RIGHTARG=eql_v2.ore_block_u64_8_256,
138+
NEGATOR = =,
139+
RESTRICT = eqsel,
140+
JOIN = eqjoinsel,
141+
HASHES,
142+
MERGES
143+
);
144+
145+
146+
--! @brief > operator for ORE block types
147+
--! @note FILE IS DISABLED - Not included in build
148+
CREATE OPERATOR > (
149+
FUNCTION=eql_v2.ore_block_u64_8_256_gt,
150+
LEFTARG=eql_v2.ore_block_u64_8_256,
151+
RIGHTARG=eql_v2.ore_block_u64_8_256,
152+
COMMUTATOR = <,
153+
NEGATOR = <=,
154+
RESTRICT = scalargtsel,
155+
JOIN = scalargtjoinsel
156+
);
157+
158+
159+
160+
--! @brief < operator for ORE block types
161+
--! @note FILE IS DISABLED - Not included in build
162+
CREATE OPERATOR < (
163+
FUNCTION=eql_v2.ore_block_u64_8_256_lt,
164+
LEFTARG=eql_v2.ore_block_u64_8_256,
165+
RIGHTARG=eql_v2.ore_block_u64_8_256,
166+
COMMUTATOR = >,
167+
NEGATOR = >=,
168+
RESTRICT = scalarltsel,
169+
JOIN = scalarltjoinsel
170+
);
171+
172+
173+
174+
--! @brief <= operator for ORE block types
175+
--! @note FILE IS DISABLED - Not included in build
176+
CREATE OPERATOR <= (
177+
FUNCTION=eql_v2.ore_block_u64_8_256_lte,
178+
LEFTARG=eql_v2.ore_block_u64_8_256,
179+
RIGHTARG=eql_v2.ore_block_u64_8_256,
180+
COMMUTATOR = >=,
181+
NEGATOR = >,
182+
RESTRICT = scalarlesel,
183+
JOIN = scalarlejoinsel
184+
);
185+
186+
187+
188+
--! @brief >= operator for ORE block types
189+
--! @note FILE IS DISABLED - Not included in build
190+
CREATE OPERATOR >= (
191+
FUNCTION=eql_v2.ore_block_u64_8_256_gte,
192+
LEFTARG=eql_v2.ore_block_u64_8_256,
193+
RIGHTARG=eql_v2.ore_block_u64_8_256,
194+
COMMUTATOR = <=,
195+
NEGATOR = <,
196+
RESTRICT = scalarlesel,
197+
JOIN = scalarlejoinsel
198+
);

0 commit comments

Comments
 (0)