Skip to content

Commit bacd481

Browse files
committed
update dsl sql file in go/xorm
1 parent e5622e3 commit bacd481

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

languages/go/xorm/cipherstash-encrypt-dsl.sql

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ BEGIN ATOMIC
130130
RETURN cs_unique_v1_v0_0(col);
131131
END;
132132

133-
-- extracts json containment index from an encrypted column
133+
-- extracts json ste_vec index from an encrypted column
134134
CREATE OR REPLACE FUNCTION cs_ste_vec_v1_v0_0(col jsonb)
135135
RETURNS cs_ste_vec_index_v1
136136
LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE
@@ -233,7 +233,7 @@ CREATE FUNCTION _cs_config_check_indexes(val jsonb)
233233
RETURNS BOOLEAN
234234
LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE
235235
BEGIN ATOMIC
236-
SELECT jsonb_object_keys(jsonb_path_query(val, '$.tables.*.*.indexes')) = ANY('{match, ore, unique, json}');
236+
SELECT jsonb_object_keys(jsonb_path_query(val, '$.tables.*.*.indexes')) = ANY('{match, ore, unique, ste_vec}');
237237
END;
238238

239239

@@ -299,7 +299,7 @@ DROP FUNCTION IF EXISTS cs_discard_v1();
299299
DROP FUNCTION IF EXISTS cs_refresh_encrypt_config();
300300

301301
DROP FUNCTION IF EXISTS _cs_config_default();
302-
DROP FUNCTION IF EXISTS _cs_config_match_1_default();
302+
DROP FUNCTION IF EXISTS _cs_config_match_default();
303303

304304
DROP FUNCTION IF EXISTS _cs_config_add_table(text, json);
305305
DROP FUNCTION IF EXISTS _cs_config_add_column(text, text, json);
@@ -328,8 +328,7 @@ AS $$
328328
tbl jsonb;
329329
BEGIN
330330
IF NOT config #> array['tables'] ? table_name THEN
331-
SELECT jsonb_build_object(table_name, jsonb_build_object()) into tbl;
332-
SELECT jsonb_set(config, array['tables'], tbl) INTO config;
331+
SELECT jsonb_insert(config, array['tables', table_name], jsonb_build_object()) INTO config;
333332
END IF;
334333
RETURN config;
335334
END;
@@ -377,9 +376,9 @@ $$ LANGUAGE plpgsql;
377376

378377

379378
--
380-
-- Default options for match_1 index
379+
-- Default options for match index
381380
--
382-
CREATE FUNCTION _cs_config_match_1_default()
381+
CREATE FUNCTION _cs_config_match_default()
383382
RETURNS jsonb
384383
LANGUAGE sql STRICT PARALLEL SAFE
385384
BEGIN ATOMIC
@@ -425,7 +424,7 @@ AS $$
425424

426425
-- set default options for index if opts empty
427426
IF index_name = 'match' AND opts = '{}' THEN
428-
SELECT _cs_config_match_1_default() INTO opts;
427+
SELECT _cs_config_match_default() INTO opts;
429428
END IF;
430429

431430
SELECT _cs_config_add_index(table_name, column_name, index_name, opts, _config) INTO _config;

0 commit comments

Comments
 (0)