Skip to content

Commit 4be28f8

Browse files
committed
feat(schema) schemify aggregates
1 parent 43188bc commit 4be28f8

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

sql/040-aggregate-ore.sql

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
-- Aggregate functions for ORE
2-
DROP FUNCTION IF EXISTS cs_min_encrypted_v1;
3-
CREATE FUNCTION cs_min_encrypted_v1(a cs_encrypted_v1, b cs_encrypted_v1)
4-
RETURNS cs_encrypted_v1
2+
DROP FUNCTION IF EXISTS eql_v1.min_encrypted;
3+
CREATE FUNCTION eql_v1.min_encrypted(a eql_v1_encrypted, b eql_v1_encrypted)
4+
RETURNS eql_v1_encrypted
55
LANGUAGE plpgsql
66
STRICT
77
AS $$
88
BEGIN
9-
IF cs_ore_64_8_v1(a) < cs_ore_64_8_v1(b) THEN
9+
IF eql_v1.ore_64_8_v1(a) < eql_v1.ore_64_8_v1(b) THEN
1010
RETURN a;
1111
ELSE
1212
RETURN b;
1313
END IF;
1414
END;
1515
$$;
1616

17-
CREATE AGGREGATE cs_min_v1(cs_encrypted_v1)
17+
CREATE AGGREGATE eql_v1.min(eql_v1_encrypted)
1818
(
19-
sfunc = cs_min_encrypted_v1,
20-
stype = cs_encrypted_v1
19+
sfunc = eql_v1.min_encrypted,
20+
stype = eql_v1_encrypted
2121
);
2222

23-
DROP FUNCTION IF EXISTS cs_max_encrypted_v1;
24-
CREATE FUNCTION cs_max_encrypted_v1(a cs_encrypted_v1, b cs_encrypted_v1)
25-
RETURNS cs_encrypted_v1
23+
DROP FUNCTION IF EXISTS eql_v1.max_encrypted;
24+
CREATE FUNCTION eql_v1.max_encrypted(a eql_v1_encrypted, b eql_v1_encrypted)
25+
RETURNS eql_v1_encrypted
2626
LANGUAGE plpgsql
2727
STRICT
2828
AS $$
2929
BEGIN
30-
IF cs_ore_64_8_v1(a) > cs_ore_64_8_v1(b) THEN
30+
IF eql_v1.ore_64_8_v1(a) > eql_v1.ore_64_8_v1(b) THEN
3131
RETURN a;
3232
ELSE
3333
RETURN b;
3434
END IF;
3535
END;
3636
$$;
3737

38-
CREATE AGGREGATE cs_max_v1(cs_encrypted_v1)
38+
CREATE AGGREGATE eql_v1.max(eql_v1_encrypted)
3939
(
40-
sfunc = cs_max_encrypted_v1,
41-
stype = cs_encrypted_v1
40+
sfunc = eql_v1.max_encrypted,
41+
stype = eql_v1_encrypted
4242
);

0 commit comments

Comments
 (0)