@@ -67,8 +67,8 @@ Example for a text field:
67
67
` ` ` go
68
68
func (et EncryptedTextField) ToDB () ([]byte, error) {
69
69
etCs := goeql.EncryptedText(et)
70
- // e.g table name is " examples " and field is " encrypted_text_field"
71
- return (& etCs).Serialize(" examples " , " encrypted_text_field" )
70
+ // e.g table name is " goexamples " and field is " encrypted_text_field"
71
+ return (& etCs).Serialize(" goexamples " , " encrypted_text_field" )
72
72
}
73
73
74
74
func (et * EncryptedTextField) FromDB(data []byte) error {
@@ -90,8 +90,8 @@ Example for a jsonb field:
90
90
` ` ` go
91
91
func (ej EncryptedJsonbField) ToDB () ([]byte, error) {
92
92
ejCs := goeql.EncryptedJsonb(ej)
93
- // e.g table name is " examples " and field is " encrypted_jsonb_field"
94
- return (& ejCs).Serialize(" examples " , " encrypted_jsonb_field" )
93
+ // e.g table name is " goexamples " and field is " encrypted_jsonb_field"
94
+ return (& ejCs).Serialize(" goexamples " , " encrypted_jsonb_field" )
95
95
}
96
96
97
97
func (ej * EncryptedJsonbField) FromDB(data []byte) error {
@@ -115,10 +115,10 @@ These checks will validate that the json payload is correct and that encrypted d
115
115
Example:
116
116
117
117
` ` ` sql
118
- ALTER TABLE examples ADD CONSTRAINT encrypted_text_field_encrypted_check
118
+ ALTER TABLE goexamples ADD CONSTRAINT encrypted_text_field_encrypted_check
119
119
CHECK ( cs_check_encrypted_v1(encrypted_text_field) );
120
120
121
- ALTER TABLE examples ADD CONSTRAINT encrypted_jsonb_encrypted_check
121
+ ALTER TABLE goexamples ADD CONSTRAINT encrypted_jsonb_encrypted_check
122
122
CHECK ( cs_check_encrypted_v1(encrypted_jsonb_field) );
123
123
` ` `
124
124
@@ -127,17 +127,17 @@ Example:
127
127
Example:
128
128
129
129
` ` ` sql
130
- SELECT cs_add_index_v1(' examples ' , ' encrypted_text_field' , ' unique' , ' text' , ' {"token_filters": [{"kind": "downcase"}]}' );
131
- SELECT cs_add_index_v1(' examples ' , ' encrypted_text_field' , ' match' , ' text' );
132
- SELECT cs_add_index_v1(' examples ' , ' encrypted_text_field' , ' ore' , ' text' );
133
- SELECT cs_add_index_v1(' examples ' , ' encrypted_jsonb_field' , ' ste_vec' , ' jsonb' , ' {"prefix": "examples /encrypted_jsonb_field"}' );
130
+ SELECT cs_add_index_v1(' goexamples ' , ' encrypted_text_field' , ' unique' , ' text' , ' {"token_filters": [{"kind": "downcase"}]}' );
131
+ SELECT cs_add_index_v1(' goexamples ' , ' encrypted_text_field' , ' match' , ' text' );
132
+ SELECT cs_add_index_v1(' goexamples ' , ' encrypted_text_field' , ' ore' , ' text' );
133
+ SELECT cs_add_index_v1(' goexamples ' , ' encrypted_jsonb_field' , ' ste_vec' , ' jsonb' , ' {"prefix": "goexamples /encrypted_jsonb_field"}' );
134
134
135
135
-- The below indexes will also need to be added to enable full search functionality on the encrypted columns
136
136
137
- CREATE UNIQUE INDEX ON examples (cs_unique_v1(encrypted_text_field));
138
- CREATE INDEX ON examples USING GIN (cs_match_v1(encrypted_text_field));
139
- CREATE INDEX ON examples (cs_ore_64_8_v1(encrypted_text_field));
140
- CREATE INDEX ON examples USING GIN (cs_ste_vec_v1(encrypted_jsonb_field));
137
+ CREATE UNIQUE INDEX ON goexamples (cs_unique_v1(encrypted_text_field));
138
+ CREATE INDEX ON goexamples USING GIN (cs_match_v1(encrypted_text_field));
139
+ CREATE INDEX ON goexamples (cs_ore_64_8_v1(encrypted_text_field));
140
+ CREATE INDEX ON goexamples USING GIN (cs_ste_vec_v1(encrypted_jsonb_field));
141
141
142
142
-- Run these functions to activate
143
143
@@ -174,7 +174,7 @@ Examples of how to use these are in the [e2e_test.go](./e2e_test.go) file.
174
174
Below is an example of running a match query on a text field.
175
175
176
176
```go
177
- query, errTwo := goeql.MatchQuery("some", "examples ", "encrypted_text_field")
177
+ query, errTwo := goeql.MatchQuery("some", "goexamples ", "encrypted_text_field")
178
178
if errTwo != nil {
179
179
log.Fatalf("Error marshaling encrypted_text_field: %v", errTwo)
180
180
}
0 commit comments