Skip to content

Commit 18b1c6e

Browse files
committed
docs: remove incorrect bulk docs
1 parent 557824d commit 18b1c6e

File tree

1 file changed

+0
-74
lines changed

1 file changed

+0
-74
lines changed

README.md

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -528,46 +528,6 @@ const decryptedUsers = decryptedResult.data;
528528
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.
529529
They automatically handle the mapping between your model's structure and the encrypted fields defined in your schema.
530530

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
540-
const plaintexts = [
541-
{ id: "1", plaintext: "user1@example.com" },
542-
{ id: "2", plaintext: "user2@example.com" },
543-
{ id: "3", plaintext: null },
544-
];
545-
546-
// Encrypt multiple values at once
547-
const encryptedResult = await protectClient.bulkEncrypt(plaintexts, {
548-
column: users.email,
549-
table: users,
550-
});
551-
552-
if (encryptedResult.failure) {
553-
// Handle the failure
554-
}
555-
556-
const encryptedData = encryptedResult.data;
557-
// Returns: [
558-
// { id: "1", c: "encrypted_value_1" },
559-
// { id: "2", c: "encrypted_value_2" },
560-
// { id: "3", c: null }
561-
// ]
562-
563-
// You can then decrypt individual values using the decrypt method
564-
const decryptedResult = await protectClient.decrypt(encryptedData[0].c);
565-
```
566-
567-
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-
571531
### Store encrypted data in a database
572532

573533
Encrypted data can be stored in any database that supports JSONB, noting that searchable encryption is only supported in PostgreSQL at the moment.
@@ -759,40 +719,6 @@ const bulkDecryptedResult = await protectClient
759719
.withLockContext(lockContext);
760720
```
761721

762-
### Bulk encryption operations with lock context
763-
764-
Bulk encryption operations also support lock contexts for identity-aware encryption:
765-
766-
```typescript
767-
import { protectClient } from "./protect";
768-
import { users } from "./protect/schema";
769-
770-
const plaintexts = [
771-
{ id: "1", plaintext: "user1@example.com" },
772-
{ id: "2", plaintext: "user2@example.com" },
773-
{ id: "3", plaintext: null },
774-
];
775-
776-
// Bulk encrypt with lock context
777-
const encryptedResult = await protectClient
778-
.bulkEncrypt(plaintexts, {
779-
column: users.email,
780-
table: users,
781-
})
782-
.withLockContext(lockContext);
783-
784-
if (encryptedResult.failure) {
785-
// Handle the failure
786-
}
787-
788-
const encryptedData = encryptedResult.data;
789-
790-
// Decrypt individual values with lock context
791-
const decryptedResult = await protectClient
792-
.decrypt(encryptedData[0].c)
793-
.withLockContext(lockContext);
794-
```
795-
796722
## Supported data types
797723

798724
Protect.js currently supports encrypting and decrypting text.

0 commit comments

Comments
 (0)