Query Query

yaml
type: "io.kestra.plugin.surrealdb.Query"

Query a SurrealDB database with SurrealQL.

Examples

Send a SurrealQL query to a SurrealDB database.

yaml
id: "query"
type: "io.kestra.plugin.surrealdb.Query"
useTls: true
port: 8000
host: localhost
username: surreal_user
password: surreal_passwd
database: surreal_db
namespace: surreal_namespace
query: SELECT * FROM SURREAL_TABLE
fetchType: STORE

Properties

database

  • Type: string
  • Dynamic: ✔️
  • Required: ✔️
  • Min length: 1

Connection database.

fetchType

  • Type: string
  • Dynamic:
  • Required: ✔️
  • Default: STORE
  • Possible Values:
    • STORE
    • FETCH
    • FETCH_ONE
    • NONE

The way you want to store data.

FETCH_ONE - output the first row. FETCH - output all rows as output variable. STORE - store all rows to a file. NONE - do nothing.

host

  • Type: string
  • Dynamic: ✔️
  • Required: ✔️
  • Min length: 1

Connection host.

namespace

  • Type: string
  • Dynamic: ✔️
  • Required: ✔️
  • Min length: 1

Connection namespace.

query

  • Type: string
  • Dynamic: ✔️
  • Required: ✔️
  • Min length: 1

SurrealQL query to execute.

connection

connectionTimeout

  • Type: integer
  • Dynamic:
  • Required:
  • Default: 60
  • Minimum: > 0

Connection timeout. Default is 60 seconds.

parameters

  • Type: object
  • SubType: string
  • Dynamic: ✔️
  • Required:

Query parameters, can be named parameters.

See SurrealDB documentation about SurrealQL Prepared Statements for query syntax.This should be supplied with a parameter map using named parameters.

password

  • Type: string
  • Dynamic: ✔️
  • Required:

Plaintext authentication password.

port

  • Type: integer
  • Dynamic:
  • Required:
  • Default: 8000
  • Minimum: > 0

Connection port. Default value is 8000.

useTls

  • Type: boolean
  • Dynamic:
  • Required:
  • Default: false

Specify whether to use TLS for connection. Default is false.

username

  • Type: string
  • Dynamic: ✔️
  • Required:

Plaintext authentication username.

Outputs

row

  • Type: object
  • Dynamic:
  • Required:

Map containing the first row of fetched data.

Only populated if using fetchType: FETCH_ONE.

rows

  • Type: array
  • SubType: object
  • Dynamic:
  • Required:

List containing the fetched data.

Only populated if using fetchType: FETCH.

size

  • Type: integer
  • Dynamic:
  • Required:

The number of rows fetched.

uri

  • Type: string
  • Dynamic:
  • Required:
  • Format: uri

The URI of the stored result in Kestra's internal storage.

Only populated if using fetchType: STORE.

Definitions

com.surrealdb.connection.SurrealConnection