level51 / silverstripe-data-documents-pocketbase
Pocketbase Adapter for Data Documents
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:silverstripe-vendormodule
Requires
- level51/silverstripe-data-documents: ^0.2.0
- silverstripe/framework: >=4.0
Requires (Dev)
README
See main repository Data Documents for instructions.
Installation
composer require level51/silverstripe-data-documents-pocketbase
Configuration
Environment Variable | Description | Required | Example |
---|---|---|---|
POCKETBASE_URL | URL of your Pocketbase instance | Yes | http://localhost:8181 |
POCKETBASE_ADMIN_USER | Superuser identifier | Yes | - |
POCKETBASE_ADMIN_PASS | Superuser password | Yes | - |
Usage
Check out the main repository Data Documents for general usage description. Also note the following:
Collection name
Make sure that you pass the collection name when you create the adapter instance using the getDocumentStore
method in your data model.
public function getDocumentStore(): DataDocumentStore { return PocketbaseAdapter::create('myCollectionName'); }
Document write options
Custom write options can be defined for each model by defining a getDocumentWriteOptions
method.
public function getDocumentWriteOptions(): array { return [ 'merge' => false // defaults to true ]; }