Back to Tooljet

PocketBase

docs/versioned_docs/version-3.0.0-LTS/marketplace/plugins/pocketbase.md

3.20.154-lts4.9 KB
Original Source

PocketBase

ToolJet connects to your PocketBase database, allowing you to directly interact with your PocketBase backend from the convenience of your ToolJet application.

:::info NOTE: Before following this guide, it is assumed that you have already completed the process of Using Marketplace plugins. :::

Connection

  • To connect to PocketBase, you need the Host URL, email, and password. The Host URL is the URL of your PocketBase instance. Email and password are the credentials of the user who has access to the PocketBase instance.

  • Establish a connection to PocketBase by either clicking +Add new Data source on the query panel or navigating to the Data Sources page from the ToolJet dashboard.

  • Enter your Host URL, email and password into their designated fields.

  • Click Test Connection to validate your credentials. Click Save to store the data source.

<div style={{textAlign: 'center'}}> </div>

Querying PocketBase

  • To perform queries on PocketBase in ToolJet, click the +Add button in the query manager located at the bottom panel of the editor.

  • Select the previously configured PocketBase datasource.

  • In the Operation dropdown, select the desired operation type. ToolJet currently supports five query types for PocketBase interactions.

  • Enter the collection name and other required parameters for the selected operation and click on Run button to run the query.

<div style={{textAlign: 'center'}}> </div>

:::info Query results can be transformed using transformations. Read our transformations documentation. :::

Supported Operations

You can create query for PocketBase data source to perform several operations such as:

  1. List Records
  2. Get Record
  3. Add Record to Collection
  4. Update Record to Collection
  5. Delete Record

List Records

Required parameters:

  • Collection Name - Collection name in the database.

Optional Parameters:

  • Limit - Number of records to be fetched.
  • Sort - Sort the records based on a sort rule. Add - / +(default) in front of the attribute for DESC / ASC order.
  • Where - Filter the records based on a filter conditions.
<div style={{textAlign: 'center'}}> </div>

Get Record

Required parameters:

  • Collection Name - Collection name in the database.
  • Record ID - ID of the record to be fetched.
<div style={{textAlign: 'center'}}> </div>

Add Record to Collection

Required parameters:

  • Collection Name - Collection name in the database.
  • Body - Data to be added to the collection. It should be in valid JSON format.
<div style={{textAlign: 'center'}}> </div>

Update Record to Collection

Required parameters:

  • Collection Name - Collection name in the database.
  • Record ID - ID of the record to be updated.
  • Body - Data to be updated in the collection. It should be in valid JSON format.
<div style={{textAlign: 'center'}}> </div>

Delete Record

Required parameters:

  • Collection Name - Collection name in the database.
  • Record ID - ID of the record to be deleted.
<div style={{textAlign: 'center'}}> </div>