---
title: "Release 1.3 | SurrealDB"
description: "Bug fixes: Add JWT ID claim to tokens issued by SurrealDB. Consistently enforce session expiration."
url: https://surrealdb.com/releases/1.3
---

# SurrealDB 1.3

[Latest patch: 1.3.1](https://surrealdb.com/releases/1.3#release-1-3-1) [All releases](https://surrealdb.com/releases)

**Patches.** 2 patch releases on the 1.3 line.

**Latest.** 1.3.1, released Mar 15, 2024.

**Stable.** Ready for production, with every patch's notes below.

1. ![Babcock](https://surrealdb.com/assets/static/babcock.lo4rnVg1.svg)
2. ![ING](https://surrealdb.com/assets/static/ing.X3I6S3_V.svg)
3. ![British Airways](https://surrealdb.com/assets/static/british-airways.KEsZiwV-.svg)
4. ![Nvidia](https://surrealdb.com/assets/static/nvidia.DaIEuMil.svg)
5. ![Apple](https://surrealdb.com/assets/static/apple.D5pq4flY.svg)
6. ![SpaceX](https://surrealdb.com/assets/static/spacex.CQJEk-IL.svg)
7. ![Samsung](https://surrealdb.com/assets/static/samsung.CH-vQgnb.svg)
8. ![adidas](https://surrealdb.com/assets/static/adidas.DdTC5qhk.svg)
9. ![Tencent](https://surrealdb.com/assets/static/tencent.paQmLxyy.svg)
10. ![Alibaba](https://surrealdb.com/assets/static/alibaba.B16idgfM.svg)
11. ![PolyAI](https://surrealdb.com/assets/static/poly-ai.c3w_fAg6.svg)
12. ![Later](https://surrealdb.com/assets/static/later.Ds736jFO.svg)
13. ![Verizon](https://surrealdb.com/assets/static/verizon.BI7CajdX.svg)
14. ![Liberty Mutual](https://surrealdb.com/assets/static/liberty-mutual.B7qOU1pd.svg)
15. ![Walmart](https://surrealdb.com/assets/static/walmart.BjDg_Sr8.svg)
16. ![Carrier](https://surrealdb.com/assets/static/carrier.D21gC6NX.svg)
17. ![Saks Fifth Avenue](https://surrealdb.com/assets/static/saks-fifth-avenue.COIDpLSb.svg)
18. ![San Francisco Compute Company](https://surrealdb.com/assets/static/sfcc.B7jlImq4.svg)
19. ![Shield AI](https://surrealdb.com/assets/static/shield-ai.pINZ0KJr.svg)
20. ![Wix](https://surrealdb.com/assets/static/wix.DvHhmoBi.svg)

Back to top

[Version 1.3.1](https://surrealdb.com/releases/1.3#release-1-3-1)

[Version 1.3.0](https://surrealdb.com/releases/1.3#release-1-3-0)

[Home](https://surrealdb.com/)

[Releases](https://surrealdb.com/releases)

1.3

Bug fixes: Add JWT ID claim to tokens issued by SurrealDB. Consistently enforce session expiration.

[Newer release line available: 1.4 →](https://surrealdb.com/releases/1.4)

Released Mar 15, 2024

## 1.3.1

Bug fixes:

- Add JWT ID claim to tokens issued by SurrealDB.
- Consistently enforce session expiration.

Upgrade or install

## Get SurrealDB v1.3.1

Pick how you want to install or upgrade. SurrealDB Studio can update connected instances in place, or choose a platform below to copy a CLI command for v1.3.1.

SurrealDB Cloud

macOS

Linux

Windows

Docker

Already installed

You can upgrade your SurrealDB Cloud instance to v1.3.1 effortlessly through SurrealDB Studio.

1. Open the [SurrealDB Studio](https://studio.surrealdb.com/current/instances)
2. Select your organisation and instance
3. On the dashboard, click on the "Upgrade" button
4. Your instance will be updated and restarted automatically

[Full install guide](https://surrealdb.com/surrealdb/install)

Released Mar 12, 2024

## 1.3.0

Features:

- Introduced [`IF NOT EXISTS` clause on `DEFINE` statements](https://surrealdb.com/docs/surrealql/statements/define).
- Implemented [`IF EXISTS` for additional `REMOVE` statements](https://surrealdb.com/docs/surrealql/statements/remove#using-if-exists-clause-since-130).
- Changed the KNN operator from `<2>` to `<|2|>` in the new parser and added support in the old parser for the new syntax.
- Implemented WebSocket session expiration.
- Added support for tables and geometries in CBOR.
- Added support for parsing decimal numbers with scientific notation.
- Added support for printing a warning in the CLI when using an outdated version of SurrealDB.
- Added `Surreal::wait_for` to make it possible for the client to wait for certain events.
- Added SurrealKV as an unstable feature.
- Added more error message improvements for the new parser.

Bug fixes:

- More consistent handling of negative numbers in record IDs.
- Removed the unimplemented `backup` command from the CLI.
- Fixed document not being available to delete permissions clause.
- Ensured objects properties are recognised by the query planner.
- Implemented the union strategy on unique indexes.

Performance improvements:

- Added compile-time feature for flamegraph and pprof profiling.

### `IF NOT EXISTS` clause on `DEFINE` statements

`DEFINE` statements now allow you to include an `IF NOT EXISTS` clause which ensures that the define statement is only run if the resource doesn't already exist. If it exists, you will get an error. Learn more about this in [the documentation](https://surrealdb.com/docs/surrealql/statements/define).

```surql
DEFINE DATABASE IF NOT EXISTS example
```

### New KNN syntax

The KNN operator now supports a new syntax using `<|` and `|>` instead of `<` and `>`. Learn more about this in [the documentation](https://surrealdb.com/docs/surrealql/operators#knn-since-130)

```surql
SELECT id FROM point WHERE point_b <|2|> [2, 3, 4, 5]
```

### Waiting for client events

It's now possible to initialise the connection and run setup actions like authentication and selecting the database concurrently with other queries by making it possible to wait for the SDK to connect or select the database to use before allowing other queries to execute.

Something like this would be susceptible to a race condition before:

```rust
// A static, global instance of the client
static DB: Lazy<Surreal<Any>> = Lazy::new(|| {
    // Connect and setup the database connection in the background
    tokio::spawn(async {
        // This example is for demonstration purposes only.
        // If the `unwrap` panics the client will be left hanging,
        // waiting for the setup to happen when using `Surreal::wait_for`.
        setup_db().await.unwrap();
    });
    // Initialise a new unconnected instance of the client
    Surreal::init()
});

// Connect to the server and run setup actions
async fn setup_db() -> surrealdb::Result<()> {
    // Connect to the server
    DB.connect("ws://localhost:8000").await?;

    // Signin as a namespace, database, or root user
    DB.signin(Root {
        username: "root",
        password: "root",
    }).await?;

    // Select a specific namespace / database
    DB.use_ns("namespace").use_db("database").await?;

    Ok(())
}

// Whether this would run successfully or return an error would depend on whether
// `DB::setup` was able to execute before getting to this point.
DB.create(Resource::from("person")).await?;
```

Now it's possible to make the client wait for either the connection to be established

```rust
use surrealdb::opt::WaitFor::Connection;

// This will wait until the connection is established.
// As soon as it is, it will return and allow the client to continue.
DB.wait_for(Connection).await;

// This will still likely return an error.
// While we know that the connection is already established at this point,
// there is no guarantee that the database has already been selected.
// This query requires the database to be selected first.
DB.create(Resource::from("person")).await?;
```

or the database to be selected.

```rust
use surrealdb::opt::WaitFor::Database;

// This will wait until the database is selected.
// As soon as it is, it will return and allow the client to continue.
DB.wait_for(Database).await;

// At this point, the database is guaranteed to be selected already
// so this query should run successfully.
DB.create(Resource::from("person")).await?;
```

Newer patch available

## Upgrade to 1.3.1

You are viewing the 1.3.0 changelog. A newer patch in this release line is available - we recommend running 1.3.1 for the latest fixes and improvements.

[View 1.3.1 release notes](https://surrealdb.com/releases/1.3#release-1-3-1)

Newer release line

### [1.4](https://surrealdb.com/releases/1.4)

Updated Apr 20, 2024

Older release line

### [1.2](https://surrealdb.com/releases/1.2)

Updated Mar 7, 2024

[All releases](https://surrealdb.com/releases)

GET STARTED

## Start building with SurrealDB. One data layer for AI, from object storage to agent memory.

[Start free with SurrealDB](https://studio.surrealdb.com/current/instances/deploy) [Learn more](https://surrealdb.com/docs/what-is-surrealdb)

![ISO 27001](https://surrealdb.com/assets/static/iso.BzQy4FFy.svg)

![AICPA SOC 2 Type 2](https://surrealdb.com/assets/static/aicpa-soc.CE_YjqhK.svg)

![Cyber Essentials](https://surrealdb.com/assets/static/cyber-essentials.CtbmbYfL.svg)

![GDPR](https://surrealdb.com/assets/static/gdpr.IadR7loS.svg)

![Cyber Essentials Plus](https://surrealdb.com/assets/static/cyber-essentials-plus.Cl5P05xe.svg)

```json
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://surrealdb.com"},{"@type":"ListItem","position":2,"name":"Releases","item":"https://surrealdb.com/releases"},{"@type":"ListItem","position":3,"name":"1.3","item":"https://surrealdb.com/releases/1.3"}]}
```

```json
{"@context":"https://schema.org","@type":"TechArticle","headline":"SurrealDB 1.3 release notes","description":"Bug fixes: Add JWT ID claim to tokens issued by SurrealDB. Consistently enforce session expiration.","datePublished":"2024-03-15T00:00:00.000Z","dateModified":"2024-03-15T00:00:00.000Z","url":"https://surrealdb.com/releases/1.3","mainEntityOfPage":{"@type":"WebPage","@id":"https://surrealdb.com/releases/1.3"},"author":{"@type":"Organization","name":"SurrealDB","url":"https://surrealdb.com"},"publisher":{"@type":"Organization","name":"SurrealDB","logo":{"@type":"ImageObject","url":"https://surrealdb.com/assets/static/logo.BG7_TG2b.svg"}},"about":{"@type":"SoftwareApplication","name":"SurrealDB","applicationCategory":"DeveloperApplication","operatingSystem":"Linux, macOS, Windows","softwareVersion":"1.3"}}
```

```json
{"@context":"https://schema.org","@type":"Organization","@id":"https://surrealdb.com/#organization","name":"SurrealDB","url":"https://surrealdb.com","logo":"https://surrealdb.com/assets/static/logo.BG7_TG2b.svg","description":"SurrealDB is the context and memory layer for AI agents. A multi-model database for documents, graphs, vectors, and time-series.","foundingDate":"2022","legalName":"SurrealDB Ltd","identifier":{"@type":"PropertyValue","propertyID":"GB-COH","value":"13615201"},"address":{"@type":"PostalAddress","streetAddress":"3rd Floor, 1 Ashley Road","addressLocality":"Altrincham","addressRegion":"Cheshire","postalCode":"WA14 2DT","addressCountry":"GB"},"contactPoint":[{"@type":"ContactPoint","contactType":"customer support","email":"support@surrealdb.com","url":"https://surrealdb.com/contact","availableLanguage":"English"},{"@type":"ContactPoint","contactType":"sales","email":"info@surrealdb.com","url":"https://surrealdb.com/contact","availableLanguage":"English"},{"@type":"ContactPoint","contactType":"security","email":"security@surrealdb.com","url":"https://surrealdb.com/.well-known/security.txt","availableLanguage":"English"},{"@type":"ContactPoint","contactType":"legal","email":"legal@surrealdb.com","url":"https://surrealdb.com/legal","availableLanguage":"English"}],"hasCertification":[{"@type":"Certification","name":"SOC 2 Type 2"},{"@type":"Certification","name":"GDPR"},{"@type":"Certification","name":"Cyber Essentials Plus"},{"@type":"Certification","name":"ISO 27001"}],"owns":[{"@type":"SoftwareApplication","name":"SurrealDB","url":"https://surrealdb.com/surrealdb"},{"@type":"SoftwareApplication","name":"Agent Memory","url":"https://surrealdb.com/agent-memory"}],"knowsAbout":["multi-model databases","document databases","graph databases","vector search","time-series databases","SurrealQL","Agent Memory","real-time databases","embedded databases","context layer","graph ontology","distributed database","knowledge graphs","distributed transaction protocols","highly-scalable databases"],"sameAs":["https://www.wikidata.org/wiki/Q124316308","https://github.com/surrealdb/surrealdb","https://twitter.com/surrealdb","https://www.youtube.com/@surrealdb","https://www.linkedin.com/company/surrealdb","https://discord.gg/surrealdb","https://www.reddit.com/r/surrealdb","https://www.instagram.com/surrealdb","https://medium.com/surrealdb","https://dev.to/surrealdb"]}
```
