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
The model encryption methods provide a higher-level interface that's particularly useful when working with ORMs or when you need to encrypt multiple fields in an object.
529
529
They automatically handle the mapping between your model's structure and the encrypted fields defined in your schema.
530
530
531
-
#### Bulk encryption operations
532
-
533
-
For encrypting multiple individual values (rather than entire models), use the `bulkEncrypt` method:
534
-
535
-
```typescript
536
-
import { protectClient } from"./protect";
537
-
import { users } from"./protect/schema";
538
-
539
-
// Array of payloads with IDs and plaintext values
The `bulkEncrypt` method is useful when you need to encrypt multiple values for the same column and table, but don't want to encrypt entire model objects. Each encrypted value maintains its own unique key while benefiting from ZeroKMS's bulk operation performance.
568
-
569
-
The model encryption methods provide a higher-level interface that's particularly useful when working with ORMs or when you need to encrypt multiple fields in an object.
570
-
571
531
### Store encrypted data in a database
572
532
573
533
Encrypted data can be stored in any database that supports JSONB, noting that searchable encryption is only supported in PostgreSQL at the moment.
0 commit comments