@soulcraft/brainy 0.25.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -598,6 +598,37 @@ await db.deleteVerb(verbId)
598
598
 
599
599
  ## Advanced Configuration
600
600
 
601
+ ### Database Modes
602
+
603
+ Brainy supports special operational modes that restrict certain operations:
604
+
605
+ ```typescript
606
+ import { BrainyData } from '@soulcraft/brainy'
607
+
608
+ // Create and initialize the database
609
+ const db = new BrainyData()
610
+ await db.init()
611
+
612
+ // Set the database to read-only mode (prevents write operations)
613
+ db.setReadOnly(true)
614
+
615
+ // Check if the database is in read-only mode
616
+ const isReadOnly = db.isReadOnly() // Returns true
617
+
618
+ // Set the database to write-only mode (prevents search operations)
619
+ db.setWriteOnly(true)
620
+
621
+ // Check if the database is in write-only mode
622
+ const isWriteOnly = db.isWriteOnly() // Returns true
623
+
624
+ // Reset to normal mode (allows both read and write operations)
625
+ db.setReadOnly(false)
626
+ db.setWriteOnly(false)
627
+ ```
628
+
629
+ - **Read-Only Mode**: When enabled, prevents all write operations (add, update, delete). Useful for deployment scenarios where you want to prevent modifications to the database.
630
+ - **Write-Only Mode**: When enabled, prevents all search operations. Useful for initial data loading or when you want to optimize for write performance.
631
+
601
632
  ### Embedding
602
633
 
603
634
  ```typescript