Skip to content
Merged
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
20 changes: 20 additions & 0 deletions sql/002-ste-vec.sql
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ DECLARE
i integer;
BEGIN
ste_vec_index := cs_ste_vec_v1(col);

IF ste_vec_index IS NULL THEN
RETURN NULL;
END IF;

target_selector := selector->>'svs';

FOR i IN 1..array_length(ste_vec_index.entries, 1) LOOP
Expand Down Expand Up @@ -236,6 +241,11 @@ DECLARE
term_array cs_ste_vec_encrypted_term_v1[];
BEGIN
ste_vec_index := cs_ste_vec_v1(col);

IF ste_vec_index IS NULL THEN
RETURN NULL;
END IF;

target_selector := selector->>'svs';

FOR i IN 1..array_length(ste_vec_index.entries, 1) LOOP
Expand Down Expand Up @@ -268,6 +278,11 @@ DECLARE
i integer;
BEGIN
ste_vec_index := cs_ste_vec_v1(col);

IF ste_vec_index IS NULL THEN
RETURN NULL;
END IF;

target_selector := selector->>'svs';

FOR i IN 1..array_length(ste_vec_index.entries, 1) LOOP
Expand All @@ -292,6 +307,11 @@ DECLARE
ste_vec_index cs_ste_vec_index_v1;
BEGIN
ste_vec_index := cs_ste_vec_v1(col);

IF ste_vec_index IS NULL THEN
RETURN NULL;
END IF;

RETURN ste_vec_index.entries[1].term;
END;
$$ LANGUAGE plpgsql;
Expand Down
Loading