See main repository Data Documents for instructions.
composer require level51/silverstripe-data-documents-pocketbase
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 | - |
Check out the main repository Data Documents for general usage description. Also note the following:
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');
}
Custom write options can be defined for each model by defining a getDocumentWriteOptions
method.
public function getDocumentWriteOptions(): array
{
return [
'merge' => false // defaults to true
];
}