SurrealDB Docs Logo

Enter a search query

Known Issues

Here are some known bugs and issues with SurrealDB.

SDKs

IF EXISTS and IF NOT EXISTS are not yet available in the DEFINE statement

  • Date added: 2024-05-21
  • Affected versions: 1.x
  • Fixed versions: -

Some query functionality is not yet available in the SDKs. Such as IF EXISTS and IF NOT EXISTS clauses in the DEFINE statement. This means that if you used these clauses in your query method (as seen in the example below), the SDK would not be able to parse the query correctly.

await db.query( 'DEFINE FIELD IF NOT EXISTS email ON TABLE user TYPE string;' );

SurrealQL

DELETE ONLY always returns an error

  • Date added: 2024-05-21
  • Issue number: #3936
  • Affected versions: 1.x
  • Fixed versions: -

In the DELETE statement the ONLY clause doesn’t work as expected because it checks for a length of 1 and DELETE doesn’t return anything by default at this time. So it always gives the following error:

  • ‘Expected a single result output when using the ONLY keyword’.

However, adding RETURN $before will force DELETE to return the deleted record, which will be the expected length of 1.

CREATE person:one; // Currently fails DELETE ONLY person:one; // Workaround: add RETURN $before DELETE ONLY person:one RETURN $before;
© SurrealDB GitHub Discord Community Cloud Features Releases Install