Questions tagged [surrealdb]

SurrealDB is an innovative NewSQL cloud database, suitable for serverless applications, jamstack applications, single-page applications, and traditional applications. It is unmatched in its versatility and financial value, with the ability for deployment on cloud, on-premise, embedded, and edge computing environments. For a hassle-free setup, get started with SurrealDB Cloud in one-click.

More info can be found here: https://surrealdb.com/

A highly-scalable NewSQL database

SurrealDB is a flexible, developer-friendly, fully ACID transactional, realtime document-graph web database for serverless applications. Never again worry about database provisioning, scaling, sharding, replication, or correctness.

Single-node or distributed

SurrealDB can be run in on a single-node (both in-memory or using durable on-disk storage), or in a highly-available distributed cluster. It consumes very few resources making it perfect for embedding within other stacks or applications.

Flexible data modelling

Using an advanced query language, SurrealDB lets you store and access data using relational, document, graph, and embedded methodologies. The innovative data model enables you to model and access links between data records in an efficient way without complicated JOINs.

Distributed ACID transactions

Have peace-of-mind when working with your data, by using strictly serialisable multi-table and multi-record transactions, with no limit on the number of keys or documents, or the transaction duration.

Built with Rust

SurrealDB is designed from the ground up to be stable and scalable, with a focus on performance and functionality. When running, SurrealDB uses minimal machine resources, with highly-efficient memory access and caching.

Structured and unstructured data

SurrealDB doesn't force you into using pre-specified columns or fields. You can specify that a table is schemaless allowing any data keys to be stored, or instead, schemafull mode ensures that only certain fields and data types can be stored.

Query using SQL

The primary method of querying SurrealDB is using SurrealQL, a similar but modified version of traditional SQL. SurrealQL enables linked documents to be traversed and queried efficiently, while still using an imperative language which remains understandable by data scientists.

GraphQL, REST, or WebSockets

When connecting directly from an end-user device, you can choose to query the data using SurrealQL, GraphQL, or using a traditional REST API. In addition, WebSockets enable high-performance bi-directional realtime syncing of any updated data.

Multi-column indexing on-the-fly

Indexes can be easily added and removed as your application evolves. Indexes allow for strongly consistent reads and writes, enabling highly-performant reads, whilst multi-column unique indexes ensure custom data guarantees.

Full-text indexing with no effort

In SurrealDB, records can be indexed automatically using distributed full-text-indexes, allowing for performant Lucene-based querying over all record data fields, including boolean searches, fuzzy searches, wildcard searches, range searches, and weighted results.

Incrementally computed views

In addition to traditional indexes, SurrealDB allows data to be selected, grouped, and ordered into pre-computed views. These views enable efficient data access for specific incrementally aggregated analytics queries.

Real-time data syncing

When connecting with SurrealDB, all connections are made using WebSockets, allowing for bi-directional data syncing. Dependent on data access permissions, client-based document subscriptions are triggered in real-time whenever changes are made to the data.

In-built access and permissions

SurrealDB is designed as a web database, with clients connecting directly to it from browsers, mobile devices, and desktop apps. Configure your access rules easily using SQL statements, ensuring only the correct users have access to their respective data.

Web-native secure access

With support for SSL/TLS, Single-Sign-On, external 3rd party authentication, JWT token based authentication, and custom business authentication logic - SurrealDB offers strong security, with the flexibility of custom authentication methods that suit your app or business.

Versioned temporal data

Temporal queries enable easy auditing of whole datasets. See how your data, and the graph, evolved over time, and what changes were made by whom - by specifying a certain timestamp when running a query.

Multi-tenant databases

With support for namespaces and databases, SurrealDB enables you to separate your data out however you wish, simplifying the development of SaaS applications.

Global low-latency

Choose where you want your data to reside, and serve customers anywhere - with consistent data, replicated in real-time across multiple regions, allowing you to keep application loading speeds super-fast.

Hands-free elasticity

When using SurrealDB in the cloud, transparent behind-the-scenes scaling ensures that your apps never run out of capacity or storage, while you pay only for the data storage that you use.

Hassle free operation

SurrealDB is built from the ground-up to run as a cloud-first database. Configurable with just a single command, either as a binary, or from within a Docker instance, SurrealDB is easy to start, easy to scale, and easy to maintain. All the hard work is done for you.

62 questions
1
vote
1 answer

How to remove a relation in surrealdb

RELATE ( SELECT * from user where username = 'user_male' )->interested_in->gender:female; I used the above RELATE statement to specify that the user_male user is interested in women. I can't figure out how to UNRELATE this user to that gender; or…
John
  • 1,081
  • 1
  • 9
  • 34
0
votes
0 answers

Surrealdb JavaScript SDK Like operation

I am trying to implement Surrealdb in a NodeJS app. It supports 4 operations: get: Get by a key value as a string set: Set the value of a key findKeys: Select a key by %key% doBulk: Simply performs a bulk operation of set or remove remove: Removes a…
Samuel
  • 547
  • 1
  • 3
  • 14
0
votes
0 answers

Update records stored in array in other record

I have the following record-structures shown in JSON/Typescript format: (tablename = dimension) interface Dimension { name: string, units: Unit[] } (tablename = unit) interface Unit { symbol: string, is_base: boolean, } I want to…
Ólavur Nón
  • 161
  • 1
  • 13
0
votes
0 answers

SurrealDB - How to use Record ID as LET defined variable

I want to give the record id as a LET defined variable like this: LET $item_id = 1; SELECT ->Contain->Ingredient as ingredients FROM Product:$barcode; But it doesn't work. I also tried where clause but it didn't work either: SELECT…
eminfedar
  • 558
  • 3
  • 16
0
votes
1 answer

SurrealDB - How to change table name in SurrealQL?

I have a table called "Computers". I want to change it to "computer". There must be no data loss while changing the name. How can I change it? How to change table name in SurrealQL?
eminfedar
  • 558
  • 3
  • 16
0
votes
1 answer

How can you access individual values in the ON DUPLICATE KEY UPDATE section of an INSERT INTO statement in SurrealDB?

How can you access individual values in the ON DUPLICATE KEY UPDATE section of an INSERT INTO statement in SurrealDB? In SQL you can access it with the VALUES operator in the ON DUPLICATE KEY UPDATE as shown here: INSERT INTO users (id, username,…
0
votes
0 answers

Trying to implement Surrealdb in etherpad ueberdb

I am trying to implement Surrealdb in ueberdb. When I call the init method in the tests it says after 5 seconds it reads: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it…
Samuel
  • 547
  • 1
  • 3
  • 14
0
votes
0 answers

vite error when importing surrealdb.wasm into tauri project

I have problems on running surrealdb.wasm on a tauri project. I have installed the library, but when i try to do import { Surreal } from 'surrealdb.wasm';, vite gives me compiling error in development: Error: Build failed with 6…
Ólavur Nón
  • 161
  • 1
  • 13
0
votes
1 answer

SurrealDB embedded into tauri project

I'm building a desktop application using tauri, and I want to store data locally at the client using SurrealDB. I either want to store data on a specified path, or store the data in a similar way as IndexedDB stores data on the browser itself. I…
Ólavur Nón
  • 161
  • 1
  • 13
0
votes
1 answer

SurrealDB: How to add a day, week, month to a datetime?

I need to add "2 weeks" to time::now()'s value. For example: -- Now: 2023-07-09T21:48:57.676702494Z time::now() -- Two weeks later than now: 2023-07-21T21:48:57.676702494Z time::now() + How can I add to a datetime value a week, a day…
eminfedar
  • 558
  • 3
  • 16
0
votes
0 answers

Execute multiple commands in docker compose with surrealDB

I am currently trying to set up surrealDB with a docker-compose-file for a new project. When executing docker compose up --build, I want to start surrealDB and then import a provided surql-file, so that the started db already has data to work…
marvin
  • 15
  • 5
0
votes
1 answer

How to sort NULLs/NONEs last when SELECTing in SurrealDB?

I use SurrealDB as my go-to database for just about everything nowadays--it's just so damn powerful. Today, I have encountered a minor issue: While implementing it as a datastore as part of a 3rd-party framework, I need to sort the output by a field…
M1N3R
  • 33
  • 4
0
votes
1 answer

How can I generate a user table with email verification and automatic deletion of unverified accounts within 24 hours in SurrealDB?

I'm working on a project where I need to create a user table. One of the requirements is that users should verify their email addresses, and if an account remains unverified for 24 hours, it should be automatically deleted. I'm wondering if…
Bitfinicon
  • 1,045
  • 1
  • 8
  • 22
0
votes
1 answer

Calling function with multi argument on surrealdb

I want to define function in surrealdb to be able to call it later. Why calling this function (fn::insert_user(...);) fails? Table: DEFINE TABLE user SCHEMAFULL; DEFINE FIELD email ON TABLE user TYPE string ASSERT $value != NONE AND…
obei
  • 115
  • 2
  • 10
0
votes
1 answer

How do you get the total row count of a surrealdb select query?

Using SurrealDB. is there a way that I can get the total amount of records for a query, like you would do in traditional SQL databases? select count(*) from person
TuinBoy
  • 185
  • 1
  • 9