• Start

Languages

/

Kotlin

/

API Reference

/

Data Types

RecordId

The RecordId type identifies a single record in the SurrealDB Kotlin SDK.

RecordId identifies a single record by its table and ID, rendered as table:id. Pass it to the CRUD builders to target one record.

Source: surrealdb.kotlin

Import

import com.surrealdb.kotlin.query.RecordId

Method Syntax

RecordId(table, id)
ParameterTypeDescription
table StringThe table name.
id StringThe record identifier within the table.

Example

val ada = RecordId("person", "ada")

client.select(ada).awaitAs<Person>()

When bound into a query, a RecordId is rendered with type::record(table, id) so the value is always passed safely.

Was this page helpful?