---
title: "Release 1.0 | SurrealDB"
description: "Bug fixes: Support connecting to beta servers from the Rust SDK."
url: https://surrealdb.com/releases/1.0
---

# SurrealDB 1.0

[Latest patch: 1.0.2](https://surrealdb.com/releases/1.0#release-1-0-2) [All releases](https://surrealdb.com/releases)

**Patches.** 3 patch releases on the 1.0 line, with the release date and full notes for each below.

**Latest.** 1.0.2, released Dec 21, 2023, is the newest patch release on this line and the first set of notes below.

**Stable.** Ready for production, with every patch's release date and full notes below, newest first.

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.0.2](https://surrealdb.com/releases/1.0#release-1-0-2)

[Version 1.0.1](https://surrealdb.com/releases/1.0#release-1-0-1)

[Version 1.0.0](https://surrealdb.com/releases/1.0#release-1-0-0)

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

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

1.0

Bug fixes: Support connecting to beta servers from the Rust SDK.

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

Released Dec 21, 2023

## 1.0.2

Bug fixes:

- Support connecting to beta servers from the Rust SDK.

Upgrade or install

## Get SurrealDB v1.0.2

Upgrade a Cloud instance from SurrealDB Studio, or copy the command for your platform.

SurrealDB Cloud

macOS

Linux

Windows

Docker

Already installed

Upgrade a Cloud instance to v1.0.2 in four steps:

1. Open [SurrealDB Studio](https://studio.surrealdb.com/current/instances)
2. Select your organisation and instance
3. On the dashboard, select “Upgrade”
4. The instance updates and restarts automatically

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

Released Dec 14, 2023

## 1.0.1

Bug fixes:

- Add a patch for [GHSA-x5fr-7hhj-34j3](https://github.com/surrealdb/surrealdb/security/advisories/GHSA-x5fr-7hhj-34j3).
- Tables defined without explicit permissions have NONE instead of FULL permissions.
- Table permissions are always explicitly displayed with the INFO FOR DB statement.

Newer patch available

## Upgrade to 1.0.2

This is the 1.0.1 changelog. 1.0.2 is the newest patch in this release line, with the latest fixes and improvements.

[View 1.0.2 release notes](https://surrealdb.com/releases/1.0#release-1-0-2)

Released Sep 13, 2023

## 1.0.0

After numerous beta releases crammed into just months of development, we are releasing SurrealDB v1.0.0! 🎉

Here follow some of our 1.0.0 highlights:

### Introducing new type validation methods in SurrealQL

`v1.0.0` introduces new type validation methods. These new methods allow you to check which type any sort of value is on the go.

```surql
LET $value = "I am a string";

RETURN [
  type::is::string($value),
  type::is::record($value),
  type::is::number($value),
];
```

### Guaranteed single item results with the new ONLY keyword

It was previously difficult to select, create, update or delete just a single record, so we simplified it a bit.

```surql
// Will return an object, as we can guarantee just a single record is requested
SELECT * FROM ONLY person:tobie;

// This will throw an error, as multiple records are being created and returned
CREATE ONLY person:tobie, person:jaime;
```

### Get realtime updates in your application with SurrealDB Live Queries

`v1.0.0` introduces Live Queries. This powerful technology allows you to write applications where you can serve realtime updates to your frontend.

```surql
// You can initiate the live query in your application
LET $lq = LIVE SELECT * FROM person WHERE age > 18;
// And you can dispose the live query once it is no longer needed
KILL $lq;
```

```js
// SurrealDB SDKs allow you to easily initiate live queries, and to process the received messages.
const lq = await db.live('person', function ({ action, result }) {
    if (action == 'CREATE') {
        renderPersonInFrontend(result);
    }
});

// Once you no longer need the live feed of updates, you can dispose the live query
await db.kill(lq);
```

### Efficiently index and search your data with SurrealDB Full Text Search

With Full Text Search, you can efficiently store and index data, and search through it.

```surql
// We can define an analyzer on our database,
// Then, define an index to dictate which content we want to index (yep, that easy)
DEFINE ANALYZER simple TOKENIZERS blank,class FILTERS snowball(english);
DEFINE INDEX content ON article FIELDS content SEARCH ANALYZER simple BM25 HIGHLIGHTS;

// We can then create some content
CREATE article SET content = "Join us at SurrealDB World, as we unveil our version 1.0.0 to the world!";
CREATE article SET content = "We will absolutely be at Surreal World!";

// And lastly, select some data from the article table.
// We use the special "@num@" operator, where we define a reference.
// We can then reference back in the search::* functions.
SELECT
  *,
  search::score(1) AS score,
  search::offsets(1) AS offsets,
  search::highlight('<b>', '</b>', 1) AS highlighted
FROM article WHERE
  content @1@ 'world'
ORDER BY score DESC;
```

### Allow or deny capabilities when starting your SurrealDB instance

All capabilities are disabled by default. This means that by default, you are not able to use any methods, embedded scripting functions, make outbound network calls, or access the database anonymously. Down below follows a set of examples to showcase how one can configure capabilities.

Capabilities are further documented in the Capabilities documentation.

```shell
## Allow all capabilities {#1-0-0-allow-all-capabilities}
user@localhost % surreal start --allow-all

## Allow all functions, except for custom functions {#1-0-0-allow-all-functions-except-for-custom-functions}
user@localhost % surreal start --allow-funcs --deny-funcs fn

## Allow all capabilities, but deny guest/anonymous access to the database {#1-0-0-allow-all-capabilities-but-deny-guestanonymous-access-to-the-database}
user@localhost % surreal start --allow-all --deny-guests
```

### Revamped root users

It is now possible to define multiple root users in SurrealDB. This change did require some changes in the way that you start your database, however.

With this change, you will now only initially have to provide the `--user` and `--pass` flags to create the initial root user, but once the first root user exists, they will no longer be utilised.

For more information, check out the Authentication guide, and the surreal start and `DEFINE USER` documentation.

```shell
## When you initially start the database, you can create the first root user. {#1-0-0-when-you-initially-start-the-database-you-can-create-the-first-root-user}
user@localhost % surreal start --auth --user root --pass root file:database.db

## In the future, you don't need to specify the --user and --pass flags anymore {#1-0-0-in-the-future-you-dont-need-to-specify-the---user-and---pass-flags-anymore}
user@localhost % surreal start --auth file:database.db
```

```surql
// Afterwards, you are able to create multiple root users.
DEFINE USER tobie ON ROOT PASSWORD "SecurePassword!" ROLES OWNER;
DEFINE USER jaime ON ROOT PASSWORD "SecurePassword!" ROLES EDITOR;
DEFINE USER john  ON ROOT PASSWORD "SecurePassword!" ROLES VIEWER;
```

### Strict typing in SurrealQL

`v1.0.0` introduces a more strict and powerful typing system. It makes things more simple to understand, and it goes a long way in preventing all kinds of weird bugs in your schemas!

```surql
// Where you previously had to manually assert that a field does not contain NONE or NULL
DEFINE FIELD age ON person TYPE number ASSERT $value != NONE AND $value != NULL;

// You can now simply set the type and be ensured that only a number will be stored in that field.
DEFINE FIELD age ON person TYPE number;

// To make types optional, you can use the newly introduced "option<type>" type.
// This guarantees the field to be either empty (NONE), or a number.
DEFINE FIELD age ON person TYPE option<number>;

// We also introduces some new types!
DEFINE FIELD ratings     ON movie   TYPE array<number>;
DEFINE FIELD best_ratings   ON movie   TYPE array<number, 5>;
DEFINE FIELD unique_ratings ON movie   TYPE set<number, 5>;

// And we made sure that the record type is also in-line with this new format
DEFINE FIELD author     ON book   TYPE record<person>;

// Lastly, it is now possible to set a union type.
DEFINE FIELD title       ON article   TYPE string | number;
// They can also be used in "nested" types
DEFINE FIELD description   ON article   TYPE option<string | number>;
DEFINE FIELD author     ON article   TYPE record<person | admin>;
```

### Set a `DEFAULT` value on field definitions

```surql
// You previously needed to involve logic with the "VALUE" clause to set a default value.
DEFINE FIELD enabled ON user TYPE bool VALUE $value OR $before OR true;
// You can now simply use the DEFAULT clause for this.
DEFINE FIELD enabled ON user TYPE bool DEFAULT true;

// As an added bonus, when you only define a VALUE clause with a simple value,
// then that will also act as the default value.
DEFINE FIELD constant ON demo VALUE 123;
// This will act the same as the following
DEFINE FIELD constant ON demo VALUE 123 DEFAULT 123;
```

### `PERMISSIONS` on global parameters and custom functions

Scope and anonymous users previously had access to every defined global parameter and function. You can now define these resources with a `PERMISSIONS` clause to protect them.

```surql
DEFINE PARAM $perms_none VALUE 'Nobody can see me' PERMISSIONS NONE;
DEFINE PARAM $perms_full VALUE 'Everybody can see me' PERMISSIONS FULL;
DEFINE PARAM $perms_scope VALUE 'Only admins can see me' PERMISSIONS WHERE $scope = 'admin';

DEFINE FUNCTION fn::perms::none() {
  RETURN 'Nobody can invoke me';
} PERMISSIONS NONE;

DEFINE FUNCTION fn::perms::full() {
  RETURN 'Everybody can invoke me';
} PERMISSIONS FULL;

DEFINE FUNCTION fn::perms::scope() {
  RETURN 'Only admins can invoke me';
} PERMISSIONS WHERE $scope = 'admin';
```

### `FOR`, `BREAK` and `CONTINUE` statements

```surql
// Here, we loop through an array with three numbers.
// For any number under two, we skip the iteration
// For any number above two, we break the loop
// The result is that only when the number is two, we will create the "person:two" record.

FOR $num IN [1, 2, 3] {
  IF $num < 2 {
    CONTINUE;
  };

  IF $num > 2 {
    BREAK;
  };

  CREATE person:two;
};

// Here, we select the id for every person in the database, and we gift them a ticket to SurrealDB World.
FOR $person IN (SELECT VALUE id FROM person) {
  CREATE gift CONTENT {
    recipient: $person,
    type: "ticket",
    event: "SurrealDB World"
  };
};
```

### `THROW` statement

Did something unexpected happen, and do you want to throw an error to the client? Now you can!

```surql
LET $message = "Some error message";
THROW "Failed to perform action: " + $message;
```

### `COMMENT` away on resource definitions!

```surql
// Give extra context about a certain resource
DEFINE TABLE user COMMENT "This table will store users!";
```

### Less bulky `IF ELSE` statements

We found the `IF ELSE` statement to be a bit bulky at times. Now, when you use a block (`{}`) as the body of the statement, you can skip out on the `THEN` and `END` keywords!

```surql
// Previously
IF something = true THEN {
  RETURN 123;
} END;

// Now
IF something = true {
  RETURN 123;
};
```

### More features for our embedded scripting functions

With `fetch()`, `query()`, `value()` and basically every SurrealQL function now being available within the embedded scripting functions, they are a very powerful extension to SurrealQL, and can be used to solve complex problems otherwise impossible!

Read more about them in the [Embedded scripting functions](https://surrealdb.com/docs/surrealql/functions/script) documentation.

```surql
function() {
  const page = await fetch('https://google.com');
  const people = await surrealdb.query('SELECT * FROM person');
  const auth = await surrealdb.value('auth');
  const uuid = surrealdb.functions.rand.uuid.v4();
}
```

### Support for `FLEXIBLE` fields on `SCHEMAFULL` tables

`SCHEMAFULL` and `SCHEMALESS` functionality can now be used together, suitable for capturing schema-free log data.

```surql
// We want to define a SCHEMAFULL table
DEFINE TABLE person SCHEMAFULL;
// But we want one field to allow any content
DEFINE FIELD settings on person TYPE object FLEXIBLE;
// We can then set the field value without a schema
CREATE person:test CONTENT {
  settings: {
    nested: {
      object: {
        thing: 'test'
      }
    }
  }
};
```

### Support code blocks and advanced expressions

It is now possible to run blocks of code, with support for an arbitrary number of statements, including `LET` and `RETURN` statements. This allows for writing advanced custom logic, and allowing for more complicated handling of data operations.

```surql
DEFINE FIELD average_sales ON metrics VALUE {
  LET $sales = (SELECT VALUE quantity FROM sales);
  LET $total = math::sum($sales);
  LET $count = count($sales);
  RETURN ($total / $count);
};
```

### Define custom functions with DEFINE FUNCTION statements

SurrealDB now supports the ability to define global database-wide custom functions, which allow for complicated or repeated user-defined code, to be run seamlessly within any query across the database. Custom functions support typed arguments, and multiple nested queries with custom logic.

```surql
-- Define a global function which can be used in any query
DEFINE FUNCTION fn::get_person($first: string, $last: string, $birthday: string) {

  LET $person = SELECT * FROM person WHERE [first, last, birthday] = [$first, $last, $birthday];

  RETURN IF $person[0].id THEN
    $person[0]
  ELSE
    CREATE person SET first = $first, last = $last, birthday = $birthday
  END;

};

-- Call the global custom function, receiving the returned result
LET $person = fn::get_person('Tobie', 'Morgan Hitchcock', '2022-09-21');
```

Newer patch available

## Upgrade to 1.0.2

This is the 1.0.0 changelog. 1.0.2 is the newest patch in this release line, with the latest fixes and improvements.

[View 1.0.2 release notes](https://surrealdb.com/releases/1.0#release-1-0-2)

Every release line

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

Newer release line

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

Updated Jan 16, 2024

Older release line

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

Updated Dec 14, 2021

GET STARTED

## Start building with SurrealDB. The database and memory for every agent, from object storage up.

[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.0","item":"https://surrealdb.com/releases/1.0"}]}
```

```json
{"@context":"https://schema.org","@type":"TechArticle","headline":"SurrealDB 1.0 release notes","description":"Bug fixes: Support connecting to beta servers from the Rust SDK.","datePublished":"2023-12-21T00:00:00.000Z","dateModified":"2023-12-21T00:00:00.000Z","url":"https://surrealdb.com/releases/1.0","mainEntityOfPage":{"@type":"WebPage","@id":"https://surrealdb.com/releases/1.0"},"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.0"}}
```

```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 a database for every agent. It starts on its first query, scales to zero when idle, speaks PostgreSQL and MySQL, and remembers in one query.","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","AI agent database","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"]}
```
