SurrealDB
SurrealDB is a cloud-native, real-time, multi-model database designed to combine the best features of traditional relational databases, document stores, and graph databases, all in a single system. It aims to simplify backend development by allowing developers to build applications faster with fewer layers and tools.
How to use SurrealDB in ZBrain Flow
To leverage SurrealDB within ZBrain Flow, follow the steps outlined below:
Click the β+β button
In your ZBrain Flow, click the β+β button to add a new action.
Search for SurrealDB
In the search bar, type SurrealDB to locate the integration option.
Select SurrealDB
Once found, select SurrealDB from the list of available options.
Choose the action
The primary action for SurrealDB integration is to run a query. This allows you to run database queries directly from within your ZBrain workflows.
How to connect SurrealDB to ZBrain Flow
To set up the connection to SurrealDB, you need to provide specific connection details. Follow these steps for a seamless connection:
Enter the connection name
Give your connection a meaningful name to easily identify it later.
Connection URL
Enter the connection URL for your SurrealDB instance. This URL points to the database server, for example,
http://1.2.3.5:8000
.
Specify the database
Provide the database name you want to connect to. This should be the exact name of the SurrealDB database you wish to work with.
Enter the namespace
Enter the namespace associated with your SurrealDB instance. This helps to further organize and manage your database connections, especially when dealing with multiple namespaces.
Enter the username
Input the username for authenticating the connection to the database.
Enter the password
Provide the password corresponding to the username for secure access.
Click save
After entering the necessary details, click βSaveβ to finalize your connection setup. Your connection will now be available for use in subsequent steps.
How to run a query in SurrealDB via ZBrain Flow
Once connected, you can execute queries against SurrealDB from within ZBrain Flow. Hereβs how to run a query:
Select an existing connection or create a new one
Choose an already saved connection from the dropdown or create a new one by providing the connection details as outlined in the previous section.
Enter the query
Provide the SurrealDB query string you want to execute.
This can be any valid SurrealDB SQL or NoSQL query depending on your needs, such as selecting data, inserting new records, or updating existing entries.
Add arguments
If your query requires additional parameters, click the β+ Add Itemβ button to add query arguments dynamically.
These could include placeholders or dynamic values pulled from earlier steps in the flow.
Set query timeout
Define a query timeout. This specifies the maximum time (in seconds) to wait for the query to complete before timing out. Set an appropriate value based on your query's expected execution time to avoid long delays.
Enter application name
Provide an application name, which serves as an identifier for the client application that is executing the query. This is helpful for tracking and identifying the source of queries.
Insert dynamic values: Use the 'f' icon to inject dynamic inputs from other steps in your ZBrain Flow.
Last updated