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: surrealdb_query
namespace: company.team

tasks:
  - id: select
    type: io.kestra.plugin.surrealdb.Query
    useTls: true
    host: localhost
    port: 8000
    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:
  • Default: {}

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
  • Required:

Map containing the first row of fetched data.

Only populated if using fetchType: FETCH_ONE.

rows

  • Type: array
  • SubType: object
  • Required:

List containing the fetched data.

Only populated if using fetchType: FETCH.

size

  • Type: integer
  • Required:

The number of rows fetched.

uri

  • Type: string
  • 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

Properties

Was this page helpful?