You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorials/proxy-configuration.md
+49-10Lines changed: 49 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,17 @@
3
3
Initialize the column using the `eql_v2.add_column` function to enable encryption and decryption via CipherStash Proxy.
4
4
5
5
```sql
6
-
SELECTeql_v2.add_column('users', 'encrypted_email'); -- where users is the table name and encrypted_email is the column name of type eql_v2_encrypted
6
+
SELECTeql_v2.add_column('users', 'encrypted_email', 'text'); -- where users is the table name and encrypted_email is the column name of type eql_v2_encrypted
7
+
```
8
+
9
+
**Full signature:**
10
+
```sql
11
+
SELECTeql_v2.add_column(
12
+
'table_name', -- Name of the table
13
+
'column_name', -- Name of the column (must be of type eql_v2_encrypted)
14
+
'cast_as', -- PostgreSQL type to cast decrypted data [optional, defaults to 'text']
15
+
migrating -- If true, stages changes without immediate activation [optional, defaults to false]
16
+
);
7
17
```
8
18
9
19
**Note:** This function allows you to encrypt and decrypt data but does not enable searchable encryption. See [Searching data with EQL](#searching-data-with-eql) for enabling searchable encryption.
-`eql_v2.add_search_config(table_name, column_name, index_name, cast_as DEFAULT 'text', opts DEFAULT '{}', migrating DEFAULT false)` - Add a search index to a column
355
+
-`eql_v2.remove_search_config(table_name, column_name, index_name, migrating DEFAULT false)` - Remove a specific search index (preserves column configuration)
356
+
-`eql_v2.modify_search_config(table_name, column_name, index_name, cast_as DEFAULT 'text', opts DEFAULT '{}', migrating DEFAULT false)` - Modify an existing search index
357
+
358
+
**Configuration Management:**
359
+
-`eql_v2.migrate_config()` - Manually migrate pending configuration to encrypting state
-`eql_v2.config()` - View current configuration in tabular format (returns a table with columns: state, relation, col_name, decrypts_as, indexes)
363
+
364
+
**Note:** All configuration functions automatically migrate and activate changes unless `migrating` is set to `true`. When `migrating` is `true`, changes are staged but not immediately applied, allowing for batch configuration updates.
365
+
366
+
**Important Behavior Differences:**
367
+
-`remove_search_config()` removes only the specified index but preserves the column configuration (including `cast_as` setting)
368
+
-`remove_column()` removes the entire column configuration including all its indexes
369
+
- Empty configurations (no tables/columns) are automatically maintained as active to reflect the current state
0 commit comments