-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathschema-example.sql
More file actions
47 lines (41 loc) · 846 Bytes
/
schema-example.sql
File metadata and controls
47 lines (41 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
TRUNCATE TABLE public.eql_v2_configuration;
-- Exciting cipherstash table
DROP TABLE IF EXISTS users;
CREATE TABLE users (
id SERIAL PRIMARY KEY,
encrypted_email eql_v2_encrypted,
encrypted_dob eql_v2_encrypted,
encrypted_salary eql_v2_encrypted
);
SELECT eql_v2.add_search_config(
'users',
'encrypted_email',
'unique',
'text'
);
SELECT eql_v2.add_search_config(
'users',
'encrypted_email',
'match',
'text'
);
-- 'ore' supports ordering and range comparisons. 'ope' is a drop-in
-- alternative with the same operator support — choose one per column.
SELECT eql_v2.add_search_config(
'users',
'encrypted_email',
'ore',
'text'
);
SELECT eql_v2.add_search_config(
'users',
'encrypted_salary',
'ore',
'int'
);
SELECT eql_v2.add_search_config(
'users',
'encrypted_dob',
'ore',
'date'
);