GithubHelp home page GithubHelp logo

surrealdb / docs.surrealdb.com Goto Github PK

View Code? Open in Web Editor NEW
59.0 13.0 99.0 32.74 MB

The documentation for SurrealDB, powered by Docusaurus

Home Page: https://surrealdb.com/docs/

CSS 0.26% JavaScript 4.14% MDX 92.08% TypeScript 1.46% SCSS 2.00% Makefile 0.06%
documentation docusaurus openapi surreal surrealdb surrealml vector-database vector-search

docs.surrealdb.com's Introduction


SurrealDB Icon


SurrealDB Logo SurrealDB Logo

SurrealDB SurrealDB is the ultimate cloud
database for tomorrow's applications

Develop easier.   Build faster.   Scale quicker.


       

           

       

Blog   Github	  LinkedIn   Twitter   Youtube   Dev   Discord   StackOverflow


  What is SurrealDB?

SurrealDB is an end-to-end cloud-native database designed for modern applications, including web, mobile, serverless, Jamstack, backend, and traditional applications. With SurrealDB, you can simplify your database and API infrastructure, reduce development time, and build secure, performant apps quickly and cost-effectively.

Key features of SurrealDB include:

  • Reduces development time: SurrealDB simplifies your database and API stack by removing the need for most server-side components, allowing you to build secure, performant apps faster and cheaper.
  • Real-time collaborative API backend service: SurrealDB functions as both a database and an API backend service, enabling real-time collaboration.
  • Support for multiple querying languages: SurrealDB supports SQL querying from client devices, GraphQL, ACID transactions, WebSocket connections, structured and unstructured data, graph querying, full-text indexing, and geospatial querying.
  • Granular access control: SurrealDB provides row-level permissions-based access control, giving you the ability to manage data access with precision.

View the features, the latest releases, and documentation.

  Contents

  Features

  • Database server, or embedded library
  • Multi-row, multi-table ACID transactions
  • Single-node, or highly-scalable distributed mode
  • Record links and directed typed graph connections
  • Store structured and unstructured data
  • Incrementally computed views for pre-computed advanced analytics
  • Realtime-api layer, and security permissions built in
  • Store and model data in any way with tables, documents, and graph
  • Simple schema definition for frontend and backend development
  • Connect and query directly from web-browsers and client devices
  • Use embedded JavaScript functions for custom advanced functionality

  Documentation

For guidance on installation, development, deployment, and administration, see our documentation.

  Getting started

Getting started with SurrealDB is as easy as starting up the SurrealDB database server, choosing your platform, and integrating its SDK into your code. You can easily get started with your platform of choice by reading one of our tutorials.

Server side code

                 

Client side apps

       

  Installation

SurrealDB is designed to be simple to install and simple to run - using just one command from your terminal. In addition to traditional installation, SurrealDB can be installed and run with HomeBrew, Docker, or using any other container orchestration tool such as Docker Compose, Docker Swarm, Rancher, or in Kubernetes.

 Install on macOS

The quickest way to get going with SurrealDB on macOS is to use Homebrew. This will install both the command-line tools, and the SurrealDB server as a single executable. If you don't use Homebrew, follow the instructions for Linux below to install SurrealDB.

brew install surrealdb/tap/surreal

If you want to test a version with the latest features, published every night, install the nightly version:

brew install surrealdb/tap/surreal-nightly

 Install on Linux

The easiest and preferred way to get going with SurrealDB on Unix operating systems is to install and use the SurrealDB command-line tool. Run the following command in your terminal and follow the on-screen instructions.

curl --proto '=https' --tlsv1.2 -sSf https://install.surrealdb.com | sh

If you want to run a beta release, before the next version is released, the beta version:

curl --proto '=https' --tlsv1.2 -sSf https://install.surrealdb.com | sh -s -- --beta

If you want to test a version with the latest features, published every night, install the nightly version:

curl --proto '=https' --tlsv1.2 -sSf https://install.surrealdb.com | sh -s -- --nightly

 Install on Windows

The easiest and preferred way to get going with SurrealDB on Windows is to install and use the SurrealDB command-line tool. Run the following command in your terminal and follow the on-screen instructions.

iwr https://windows.surrealdb.com -useb | iex

If you want to test a version with the latest features, published every night, install the nightly version:

iex "& { $(irm https://windows.surrealdb.com) } -Nightly"

 Run using Docker

Docker can be used to manage and run SurrealDB database instances without the need to install any command-line tools. The SurrealDB docker container contains the full command-line tools for importing and exporting data from a running server, or for running a server itself.

docker run --rm --pull always --name surrealdb -p 8000:8000 surrealdb/surrealdb:latest start

For just getting started with a development server running in memory, you can pass the container a basic initialization to set the user and password as root and enable logging.

docker run --rm --pull always --name surrealdb -p 8000:8000 surrealdb/surrealdb:latest start --log trace --user root --pass root memory

  Quick look

With strongly-typed data types, data can be fully modelled right in the database.

UPDATE person SET
    waist = <int> "34",
    height = <float> 201,
    score = <decimal> 0.3 + 0.3 + 0.3 + 0.1
;

Store dynamically computed fields which are calculated when retrieved.

CREATE person SET
    birthday = <datetime> "2007-06-22",
    can_drive = <future> { time::now() > birthday + 18y }
;

Easily work with unstructured or structured data, in schema-less or schema-full mode.

-- Create a schemafull table
DEFINE TABLE user SCHEMAFULL;

-- Specify fields on the user table
DEFINE FIELD name ON TABLE user TYPE object;
DEFINE FIELD name.first ON TABLE user TYPE string;
DEFINE FIELD name.last ON TABLE user TYPE string;
DEFINE FIELD email ON TABLE user TYPE string ASSERT string::is::email($value);

-- Add a unique index on the email field preventing duplicate values
DEFINE INDEX email ON TABLE user COLUMNS email UNIQUE;

-- Create a new event whenever a user changes their email address
DEFINE EVENT email ON TABLE user WHEN $before.email != $after.email THEN (
    CREATE event SET user = $value, time = time::now(), value = $after.email, action = 'email_changed'
);

Connect records together with fully directed graph edge connections.

-- Add a graph edge between user:tobie and article:surreal
RELATE user:tobie->write->article:surreal
    SET time.written = time::now()
;

-- Add a graph edge between specific users and developers
LET $from = (SELECT users FROM company:surrealdb);
LET $devs = (SELECT * FROM user WHERE tags CONTAINS 'developer');
RELATE $from->like->$devs UNIQUE
    SET time.connected = time::now()
;

Query data flexibly with advanced expressions and graph queries.

-- Select a nested array, and filter based on an attribute
SELECT emails[WHERE active = true] FROM person;

-- Select all 1st, 2nd, and 3rd level people who this specific person record knows, or likes, as separate outputs
SELECT ->knows->(? AS f1)->knows->(? AS f2)->(knows, likes AS e3 WHERE influencer = true)->(? AS f3) FROM person:tobie;

-- Select all person records (and their recipients), who have sent more than 5 emails
SELECT *, ->sent->email->to->person FROM person WHERE count(->sent->email) > 5;

-- Select other products purchased by people who purchased this laptop
SELECT <-purchased<-person->purchased->product FROM product:laptop;

-- Select products purchased by people in the last 3 weeks who have purchased the same products that we purchased
SELECT ->purchased->product<-purchased<-person->(purchased WHERE created_at > time::now() - 3w)->product FROM person:tobie;

Store GeoJSON geographical data types, including points, lines and polygons.

UPDATE city:london SET
    centre = (-0.118092, 51.509865),
    boundary = {
        type: "Polygon",
        coordinates: [[
            [-0.38314819, 51.37692386], [0.1785278, 51.37692386],
            [0.1785278, 51.61460570], [-0.38314819, 51.61460570],
            [-0.38314819, 51.37692386]
        ]]
    }
;

Write custom embedded logic using JavaScript functions.

CREATE film SET
    ratings = [
        { rating: 6, user: user:bt8e39uh1ouhfm8ko8s0 },
        { rating: 8, user: user:bsilfhu88j04rgs0ga70 },
    ],
    featured = function() {
        return this.ratings.filter(r => {
            return r.rating >= 7;
        }).map(r => {
            return { ...r, rating: r.rating * 10 };
        });
    }
;

Specify granular access permissions for client and application access.

-- Specify access permissions for the 'post' table
DEFINE TABLE post SCHEMALESS
    PERMISSIONS
        FOR select
            -- Published posts can be selected
            WHERE published = true
            -- A user can select all their own posts
            OR user = $auth.id
        FOR create, update
            -- A user can create or update their own posts
            WHERE user = $auth.id
        FOR delete
            -- A user can delete their own posts
            WHERE user = $auth.id
            -- Or an admin can delete any posts
            OR $auth.admin = true
;

  Why SurrealDB?

Database, API, and permissions

SurrealDB combines the database layer, the querying layer, and the API and authentication layer into one platform. Advanced table-based and row-based customisable access permissions allow for granular data access patterns for different types of users. There's no need for custom backend code and security rules with complicated database development.

Tables, documents, and graph

As a multi-model database, SurrealDB enables developers to use multiple techniques to store and model data, without having to choose a method in advance. With the use of tables, SurrealDB has similarities with relational databases, but with the added functionality and flexibility of advanced nested fields and arrays. Inter-document record links allow for simple to understand and highly-performant related queries without the use of JOINs, eliminating the N+1 query problem.

Advanced inter-document relations and analysis. No JOINs. No pain.

With full graph database functionality SurrealDB enables more advanced querying and analysis. Records (or vertices) can be connected to one another with edges, each with its own record properties and metadata. Simple extensions to traditional SQL queries allow for multi-table, multi-depth document retrieval, efficiently in the database, without the use of complicated JOINs and without bringing the data down to the client.

Simple schema definition for frontend and backend development

With SurrealDB, specify your database and API schema in one place, and define column rules and constraints just once. Once a schema is defined, database access is automatically granted to the relevant users. No more custom API code, and no more GraphQL integration. Simple, flexible, and ready for production in minutes not months.

Connect and query directly from web-browsers and client devices

Connect directly to SurrealDB from any end-user client device. Run SurrealQL queries directly within web-browsers, ensuring that users can only view or modify the data that they are allowed to access. Highly-performant WebSocket connections allow for efficient bi-directional queries, responses and notifications.

Query the database with the tools you want

Your data, your choice. SurrealDB is designed to be flexible to use, with support for SurrealQL, GraphQL (coming soon), CRUD support over REST, and JSON-RPC querying and modification over WebSockets. With direct-to-client connection with in-built permissions, SurrealDB speeds up the development process, and fits in seamlessly into any tech stack.

Realtime live queries and data changes direct to application

SurrealDB keeps every client device in-sync with data modifications pushed in realtime to the clients, applications, end-user devices, and server-side libraries. Live SQL queries allow for advanced filtering of the changes to which a client subscribes, and efficient data formats, including DIFFing and PATCHing enable highly-performant web-based data syncing.

Scale effortlessly to hundreds of nodes for high-availability and scalability

SurrealDB can be run as a single in-memory node, or as part of a distributed cluster - offering highly-available and highly-scalable system characteristics. Designed from the ground up to run in a distributed environment, SurrealDB makes use of special techniques when handling multi-table transactions, and document record IDs - with no use of table or row locks.

Extend your database with JavaScript functions

Embedded JavaScript functions allow for advanced, custom functionality, with computation logic being moved to the data layer. This improves upon the traditional approach of moving data to the client devices before applying any computation logic, ensuring that only the necessary data is transferred remotely. These advanced JavaScript functions, with support for the ES2020 standard, allow any developer to analyse the data in ever more simple-yet-advanced ways.

Designed to be embedded or to run distributed in the cloud

Built entirely in Rust as a single library, SurrealDB is designed to be used as both an embedded database library with advanced querying functionality, and as a database server which can operate in a distributed cluster. With low memory usage and cpu requirements, the system requirements have been specifically thought through for running in all types of environment.

  Community

Join our growing community around the world, for help, ideas, and discussions regarding SurrealDB.

  Contributing

We would    for you to get involved with SurrealDB development! If you wish to help, you can learn more about how you can contribute to this project in the contribution guide.

  Security

For security issues, view our vulnerability policy, view our security policy, and kindly email us at [email protected] instead of posting a public issue on GitHub.

  License

Source code for SurrealDB is variously licensed under a number of different licenses. A copy of each license can be found in each repository.

For more information, see the licensing information.

docs.surrealdb.com's People

Contributors

actuallyhappening avatar akkie avatar alexfrid avatar aravindputrevu avatar athanclark avatar auipga avatar byarbrough avatar christophsanz avatar delskayn avatar dhghomon avatar dimitrianoudi avatar ekwuno avatar emmanuel-keller avatar gguillemas avatar hades2510 avatar ivan-kiselev avatar kearfy avatar lkwr avatar lucascherzer avatar m-c-frank avatar macjuul avatar mananruck avatar matthewary avatar maxwellflitton avatar naisofly avatar odonno avatar phughk avatar timpratim avatar tobiemh avatar welpie21 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docs.surrealdb.com's Issues

Bug: misspelled "table"

Describe the bug

https://docs.surrealdb.com/docs/integration/sdks/javascript#sdk-methods misspells table:
async db.live<T>(tabel, callback,diff)

Steps to reproduce

visit [https://docs.surrealdb.com/docs/integration/sdks/javascript#sdk-methods](https://docs.surrealdb.com/docs/integration/sdks/javascript#sdk-methods] and search for the definition for db.live<T>

Expected behaviour

spell table instead of tabel

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Documentation: Responsive Menu

Description

In some cases, the side menu expands too wide (if the site is displayed on smaller screens.) For a phone there's no issue but this could be awkward to use on a tablet:
2023-12-05 10 18 02

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Add DEFINE FIELD optional Record link example

Description

-- Optional Record Link
DEFINE FIELD user ON TABLE post TYPE option<record>;

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Documentation: import statement,object creation statement mentioned for `surrealdb.js'` doesnot work

Description

below import statement,object creation statement mentioned for surrealdb.js' doesnot work

import { Surreal } from 'surrealdb.js';
const db = new Surreal();

after checking the source code in surrealdb.js', i modified tried below statement, it worked

import {ExperimentalSurrealHTTP} from 'surrealdb.js';
const db = new ExperimentalSurrealHTTP();

i'm using nodejs 18.17, typescript 5.1.3

please let me know if the documentation can be updated with this information

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Documentation: PERMISSIONS

Description

Provide an explanation for statement PERMISSIONS.

https://surrealdb.com/docs/security/authentication#scope-users
https://surrealdb.com/docs/security/capabilities#guest-access

  • NONE
  • FULL
  • FOR @actions WHERE @expr

It this FOR is the same as https://surrealdb.com/docs/surrealql/statements/for ?

Or its like from DEFINE https://surrealdb.com/docs/surrealql/statements/define

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Feature: Allow for retrieving the unique id of a given record

Is your feature request related to a problem?

Currently, when you deserialize the id field of a Thing you will get something like table:thingId which is great, however this becomes an issue when you want to use that id for routing elsewhere (such as in a URL on a website). In order to do this currently, I must either split the string at the colon and get the first part, or I have to add another field to my structs (like userId, entityId, carId) that is an exact copy of the unique id that I provided. This obviously doesn't work with surreal-generated ids.

Describe the solution

Ideally, I'd want a way to just deserialize that thingId for a given record without exposing the table name to my API- whether that's through an method that just slices that table name from the string, or if there's more integrated way to do this deeper within the database, either way works.

The best way would be to allow for deserializing the id field in the struct- but this may negatively impact other consumers who rely on the current behavior. But even a method like get_id() that will return the unique if of the record would be more than sufficient.

Alternative methods

I can just live with the table name being there and copy over a unique id to both a column (such as entityId) and specifying the record id with whatever I generated.

Maybe there's a way to do this already in the SDKs, but after using both the JS and Rust SDK I was unable to find anything close to meeting this need, so I had started duplicating the id field to my structs as a workaround.

SurrealDB version

1.0.0-beta.9+20230402.5eafebd

Contact Details

This github issue

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Documentation: websocket signup and signin docs are not consistent

Description

https://docs.surrealdb.com/docs/integration/websocket/#signup

https://docs.surrealdb.com/docs/integration/websocket/#signin

Method syntax says

signup [ NS, DB, SC, ... ]
signin [ NS, DB, SC, ... ]

but then the example doesn't use an array of prams but an array with a object

{
    "id": 1,
    "method": "signup",
    "params": [
        {
            "NS": "surrealdb",
            "DB": "docs",
            "SC": "commenter",

            "username": "johndoe",
            "password": "SuperStrongPassword!"
        }
    ]
}

Should the Method Syntax be changed to

signup [ { NS, DB, SC, ... } ] ?

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Documentation: `ngram` filter is not documented

Description

I saw the ngram analyzer filter being implemented in the code and used it myself, but it's not mentioned in the docs, so I'm not entirely sure about its behavior.

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Documentation: Add example of insert-only array field

Description

You should add an example of constraining an array field to only allow additions like this:

DEFINE TABLE person SCHEMALESS;
DEFINE FIELD skills ON TABLE person TYPE any
    ASSERT ($before = NONE AND $value != NONE) OR $value != NONE
    VALUE array::union($before, $value) OR $value;

CREATE person:100 CONTENT {
    skills: ["Rust", "Go", "JavaScript"]
};

UPDATE person:100 SET skills = ["TypeScript", "Carbon", "C#"];

This would be useful for referencing historical versions of objects and maintaining audit changes on an object.

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Official .NET driver

The C# .NET driver for SurrealDB has reached a stable point in development.

  • Most of the client sided issues except for JWT Authentication are sorted out.
  • We have API documentation.
  • Examples are available.
    I would love to make .NET support official.
    The aim of this issue is to determine required changes for becoming the official driver. And subsequently adding Surreal.Net as the driver for the dotnet framework in the www.surrealdb.com website.

Documentation: Text wrapping or scrolling.

Description

Severity: Minor
URL: https://surrealdb.com/docs/surrealql/datamodel/overview

  1. On 100% zoom have a look at code that is at the bottom of the screen; can you see the right edge?
  2. Use Ctrl + to increase font size text in right column and text in code section is neither wrapping nor having scroll capabilities.

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Documentation: lack of important documentation in multiple areas

Description

After reading the documentation I've noticed the lack of multiple important areas. Since in the roadmap there is no explicit information regarding documentation improvement, I think I need to leave the areas, which are important at least to me, and should be described in the documentation.

  • Does it support replication and sharding? How exactly it could be configured?
  • Does it support any kind of multi-cluster support? E.g. Cross-Cluster Replication, Stand-By Clusters.
  • How could I secure my cluster? Users support, roles, permissions, authentication methods, and how it could be configured.
  • Is there any quotas support? E.g. specify request quotas per user and deny requests if the quota is exceeded.
  • Supported Hardware Architectures/OS combinations. From the Install page, it's not clear, which hardware architectures (like x86-64, ARM, etc.) are supported on which Operating systems. If you have special requirements for the instruction sets (like AVX) - write about this in the documentation too.
  • How to install on Kubernetes? Is it supported? If yes, please describe, how SurrealDB should be installed on k8s. Would be awesome to have something like an official Helm chart (or any other way to deploy on k8s)
  • Are there any recommendations regarding setup on cloud environments (like AWS/Azure/GCP)? E.g. reference architectures, recommended hardware (e.g. recommended AWS EC2 machine type)? What about reference deploy architectures for on-premise installations?
  • How could I install Highly-Available (HA) cluster? Are there any restrictions/recommendations regarding network latency between nodes?
  • How to upgrade/downgrade SurrealDB? Does it support zero-downtime upgrade and downgrade? What about compatibility between releases - what is the current policy?
  • How to backup and restore SurrealDB? Are there any built-in integrity checks for the backup?
  • How to monitor SurrealDB? Does it support any kind of integrated monitoring (like Prometheus endpoint, stated integration, etc)? If yes, how to configure it, and which metrics are supported? Is there a ready-to-use Grafana dashboard for SurrealDB?

I think this list could be somehow transformed into the documentation task epic, and could be resolved step by step.

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Add inferred relation example

Can we add an example of relating nested hierarchy to the docs?

This showcases the ability to resolve relationships dynamically based on another object's record

REMOVE TABLE car;
REMOVE TABLE engine;
REMOVE TABLE piston;

DEFINE TABLE car SCHEMALESS;
    DEFINE FIELD name ON TABLE car TYPE string;

DEFINE TABLE engine SCHEMALESS;
    DEFINE FIELD parent ON TABLE engine TYPE any;

DEFINE TABLE piston SCHEMALESS;
    DEFINE FIELD parent ON TABLE piston TYPE any;
    DEFINE FIELD grandparent ON TABLE piston TYPE any
        VALUE { $this.parent.parent };


CREATE car:ulid() CONTENT {
	label: 'I am a generic car',
};
CREATE engine:ulid() CONTENT {
	label: 'I am an engine in  the car',
    parent: (SELECT * from car LIMIT 1)[0]
};
CREATE piston:ulid() CONTENT {
	label: 'I am a piston',
    parent: (SELECT * from engine LIMIT 1)[0]
};

SELECT * from piston;

This will yield the following result, which lets the piston read the car through the engine without needing to dereference engine. Yes, I am aware that this can be redundant, but with complex filters applied it can be useful and not duplicating data.

[
    {
        "grandparent": {
            "id": "car:01H5ACKCSFYJJ5QN1KM4EKNMR5",
            "label": "I am a generic car"
        },
        "id": "piston:01H5ACKCSFXPAWAW932DERSCFG",
        "label": "I am a piston",
        "parent": {
            "id": "engine:01H5ACKCSFEWVAT38CAZB7K471",
            "label": "I am an engine in  the car",
            "parent": {
                "id": "car:01H5ACKCSFYJJ5QN1KM4EKNMR5",
                "label": "I am a generic car"
            }
        }
    }
]

I don't mind submitting a PR, but i'm not really sure where it fits in or what adjustments should be made

C# server side examples

Is your feature request related to a problem?

Doesn't seem to have a C# client or examples. Would love to use it when it becomes available.

Describe the solution

Make a C# client with examples.

Alternative methods

None.

SurrealDB version

N/A

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Documentation: embedded usage

Description

I'd love to see documentation about how to use surrealdb in embedded mode. Eg, how would you use it in a python or javascript clientside-only application? Does the embedded mode compile to wasm for javascript? does the embedded mode support syncing with a server? can embedded mode be queried from the command line? is embedded mode at all a viable replacement for sqlite, or for datascript? I have many many questions :)

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Bug: SSL certificate has expired or is invalid

Describe the bug

Browser won't display docs.surrealdb.com because
Screenshot 2023-12-06 151823
SSL certificate has expired or is invalid.

Steps to reproduce

visit https://docs.surrealdb.com in any browser.
I'm located in Thailand.

Expected behaviour

Expect browser to display the site without any error.

Contact Details

[email protected]

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Feature: add a guide like "introduction to SurrealQL typing"

Is your feature request related to a problem?

Yes, there is no clear guide that introduces typings in surrealql

Describe the solution

add a guide for it

Alternative methods

search for examples and look at docs, but not cohesive

SurrealDB version

not related

Contact Details

[email protected]

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Documentation: Object-based Record IDs – need more detailed documentation

Description

It would be nice to have more detailed information on how object-based Record IDs works. I'm missing information about whether it depends on the order of the keys in the object. I would expect SurrealDB to sort the property keys themselves in a natural order, but this information should be provided in the documentation as well. Furthermore, information is missing on whether and how record ranges can be used in conjunction with object Record IDs.

I assume that object-based Record IDs can be used similarly to array-based Record IDs to retrieve records by groups/ranges, but for this, the documentation needs to describe how object Record IDs are stored and how they can be manipulated.

Current documentation:

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Bug: incorrect docs for websocket `let` and `unset` method

Describe the bug

https://docs.surrealdb.com/docs/integration/websocket#let

described as This method specifies the namespace and database for the current connection

and the example is the same as authenticate

Steps to reproduce

https://docs.surrealdb.com/docs/integration/websocket#let

Expected behaviour

correct docs

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Bug: "<" not shown correctly

Describe the bug

In the API definition of some functions the "<" letter is not displayed correctly

Steps to reproduce

Visit this example in the docs

This api definition of some functions looks like this:
math::trimean(array{{ "<" }}number>) -> number

Expected behaviour

the API definition should look like this:
math::trimean(array<number>) -> number

Contact Details

[email protected]

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Documentation: How to start surrealdb with the SpeeDB engine

Description

Thanks to SpeeDB storage engine implementation surrealdb/surrealdb#2076, surrealdb can also be started with Speed.
However, there is no documentation for this.

If you start the current version 1.0 with surreal start --user root speedb://database.db the user gets the following back:

ERROR surreal::cli: There was a problem with the database: There was a problem with the underlying datastore: Cannot connect to the speedb storage engine as it is not enabled in this build of SurrealDB

So how do you start or enabled surrealdb with the speedb engine? Especially in cloud environments, Speedb is many times better than RocksDB, which is mainly designed for SSDs and high IO. Cloud environments usually have network storage.

Do I need to recompile surrealdb or copy the binary from speedb somewhere. It would be great if you could describe this in more detail somewhere. Thank you

Documentation: Search not ranking most relevant results highest

Description

Search should assign higher weight if the searched terms appear in the title or path. Instead, they dont seem to be considered at all

For example, searching for "start" produces a list where the actual start command is ranked fifth.

search

Likewise, searching for "select", I would expect to find documentation for the SELECT statement raked high, but instead it does not appear at all

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Documentation: It's not obvious how to use backup command

Description

Current docs say:

USAGE:
surreal backup [OPTIONS]

ARGS:
Path to the sql file to export , Path to the remote database or file into which to import

but when I
surreal backup https://blalba.com:8000 file -u user -p qwerty12345
it says:

error: invalid value 'file' for '[INTO]': Provide a valid database connection string, or the path to a file

For more information, try '--help'.

following values are considered invalid, but I'd argue that they seem pretty standard for filename:

file
file.txt
"file.txt"
./file.txt
.\file.txt
.\file.sql
./file.sql
C:\Users\a\file.sql

<and many more>

If you have some specific format for file implemented there should be at least one example with real values. I don't understand how to provide file path for argument in backup command from this documentation. Please extend it

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Statements section should be listed alphabetically

Currently, the statements are listed non-alphabetically. This makes it difficult to navigate to a statement doc when you know what you are looking for.

It would be convenient to have the statements listed alphabetically

Feature: Firebase Auth integration documentation

Is your feature request related to a problem?

The documentation refers to Auth0. Problem is: Auth0 is VERY expansive (for instance: I have 10 million users which are all in Firebase Auth for free, while Auth0 pricing table says "contact us" (for only 20K users it would cost me USD 1400, which is totally insane!!!))

It would be nice if the original token could be used by mapping its properties instead of making it compatible with SurrealDB (that would require a call to the Firebase Auth API using some kind of computing, which is never free).

Describe the solution

There are free alternatives, such as Firebase Auth, which is compatible with a lot of client solutions, such as Flutter.

Alternative methods

None

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Typo on Deno SDK example code

Description

The example code snippet provided in the Deno documentation on the SurrealDB website contains a typo. The correct code should be provided to ensure accuracy and clarity for users trying to integrate SurrealDB into their Deno applications. (https://surrealdb.com/docs/integration/sdks/deno)

Incorrect Code:

// Select a specific namespace / database
await db.use('test', 'test');

Proposed Correction:

// Select a specific namespace / database
await db.use({ns: 'test', db: 'test'});

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Feature: Add i18n

Is your feature request related to a problem?

Yes, lack of i18n

Describe the solution

Add i18n

Alternative methods

None

Contact Details

[email protected]

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Bug: type::point() behaviour incorrect

Describe the bug

The type::point function errors with two arguments even though its supposed to work
https://surrealdb.com/docs/surrealql/functions/type#point

Steps to reproduce

return type::point(-0.118092, 51.509865);
--There was a problem with the database: Incorrect arguments for function type::point(). Expected 1 argument.

Expected behaviour

[(-0.118092, 51.509865)]

SurrealDB version

1.0.0-beta10

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

SurrealQL needs more/better documentation

Description

It is pretty clear to me from my experience with the documentation that SurrealQL is in need of both more/better documentation and potentially some reorganization to put the more important stuff first.

I have opened a PR surrealdb/www.surrealdb.com#369 which I would use to fix this issue, but I want to get feedback first. Please let me know any documentation you would like written, and any general questions or comments you have about this effort as a whole.

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Documentation: Array::slice output is wrong

Description

The output here is wrong:
https://surrealdb-docs.netlify.app/docs/surrealql/functions/array#arrayslice

Noticed by user on discord:

So... the array::slice function. It is specifically designed to inject things like ( Null | "something" ) automagically? Hopefully this is just a documentation mistake.

https://discord.com/channels/902568124350599239/1018618253695795261/1178754319181418607

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

i18n in documentation

Hello there!

Needlessly to say, I've fallen in love with this project and I'm already using it in an app I'm building (secret for now).

I'd love to start translating the docs to Spanish if you agree. Have you got any plans to add i18n support to the website? If you do I will start translating right away!

Documentation: live queries over websocket example?

Description

I can't find any examples of performing live queries over web sockets.

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Documentation: IF ELSE statment rule error

Description

IF ELSE rule in offical

IF @condition {
	@expression
}
ELSE IF @condition {
	@expression ...
}
// look here
ELSE
	@expression {
}

correct

ELSE {
	@expression
}

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Documentation: the SurrealQL Statement `DEFINE FIELD` page is missing table of data types

Description

The page documenting the SurrealQL statement DEFINE FIELD used to have a table detailing the different data types supported by SurrealDB. This table seems to have been moved exclusively to the SurrealQL Data Model Overview Page. IMHO this table should exist on both pages. Users who are looking at the DEFINE FIELD documentation will also want to reference the allowed types they can use when working to produce statements.

Note: I authored a great deal of the DEFINE statement documentation. I will probably contribute more to it in the future as well, but I am waiting for an upcoming revamp (which I've been told is coming) of the documentation site to land first.

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Documentation: Rust SDK `db.create` missing an ` an Option<>`

Description

From discord: https://discord.com/channels/902568124350599239/1014970959461105664/1179274456951164999

Hey all, just a note the docs (https://github.com/surrealdb/www.surrealdb.com/blob/main/app/snippets/docs/embedding/libraries/rust/create.rust) for the db.create(resource).content(data) method in the Rust SDK are missing an Option<> in the code snippet. Interestingly the code snippet seems correct on Github (https://github.com/surrealdb/www.surrealdb.com/blob/main/app/snippets/docs/embedding/libraries/rust/create.rust) and in the crate docs (https://docs.rs/surrealdb/1.0.0/surrealdb/struct.Surreal.html#method.create).

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Add Concepts Section

This section should cover the following topics:

  • Namespaces, their purpose and why databases are in them
  • Tokens. Use cases where you would need to use the token functionality and how they are solved. Links to the DEFINE TOKEN docs surrealdb/www.surrealdb.com#55
  • Scopes. Use cases (What they are used for). Links to the DEFINE SCOPES docs surrealdb/www.surrealdb.com#55
  • SurrealDB security model, authentication, account management, roles and permissions. surrealdb/www.surrealdb.com#50
  • Records and references
  • Graphs and relations
  • More?

These topics would be sub-pages under the concepts section.

Feat: Implement search function

The website has no search ability and taking into account the fact that the content will grow over time, I think it is necessary for such a feature.

Maybe something like Algolia or Elasticsearch will provides the best user experience.

Documentation: Actually supported types?

Description

I was experimenting with schemafull and schemaless tables and also with graph edges. As I did, I found out that the documentation did not actually list all available types, so I souced them from here: https://github.com/surrealdb/surrealdb/blob/main/lib/src/sql/kind.rs#L39-L52

However, definining a table with TYPE record(nonexistent) still passes although the table does not exist.

This led me to be curious about which types are actually supported/recognized at this time. Does kind.rs list all of them or is there something more to take note of?

Thanks!

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Documentation: Explain why you can't use the `CREATE` statement to create a relation

Description

I recently posted a question to Discord


So I've run into a curious behavior that I would like to understand. It seems that

CREATE projectUser SET in = project:r3dyjmgco14t93p1ga84, out = userAccount:v2uuten5fk4se471kzag;

and

RELATE ONLY project:r3dyjmgco14t93p1ga84->projectUser->userAccount:zzcdk6et3q74lgh409b7;

do not produce the same results. Because when I do

SELECT ->projectUser as users FROM $project;

I only get 1 result instead of 2. If I run

SELECT * FROM projectUser WHERE in = project:r3dyjmgco14t93p1ga84;

I get 2 results. What is RELATE doing that is different from my CREATE statement?


The answer I got is that there RELATE is not simply syntactic sugar but is actually needed to enable graph traversal functionality. This important information is absent from the documentation as far as I can tell. I request that either the CREATE Statement and or the RELATE statement documentation gets updated to include this important bit of information. It would also be nice to have some sort of blog post or additional information posted somewhere that explains what RELATE is doing under the hood.

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Documentation: Clarify expected arguments for queries.

Description

Right now there's a large number of query types that accept queries only accept idents/literals, I've seen many users run into confusing parser errors/invalid queries due to this as it's not clearly noted anywhere.

Ideally these queries should at least support $variables, this way users don't have to open themselves to sql injections (by formatting their queries manually).
In the interim it should at least be documented for beta.9 and maybe beta.10 (as it's still an issue on nightly).

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Documentation: SQL type definitions lack documentation

Description

Some types have minimal documentation, but most of the SQL type definitions are lacking it entirely. While not a high priority, as I expect most users would use the query language instead of the types directly, it would be good to document them so that users of the surrealdb crate can understand the types to create queries without needing to do runtime parsing.

My use-case is that I want to do things like build update queries where each @field = @expr is appended dynamically based on whether the field was set in a patch object given to the API. I've been able to do this, but mostly through source-code reading and debug-printing parsed example queries to figure out how things are structured. Having more complete documentation would prevent the need for every user of the crate to do this, and would make the more complex use-cases more accessible.

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Documentation: Suggestion - Display all content for each section on one page

Description

So there is most-likely a good reason to NOT do this, but I'll share my thoughts anyways. (Feel free to close this issue!)

Oftentimes I've found that searching documentation with ctrl+f (find in page) is a really user-friendly experience as I am able to just iterate through the discovered text to find what I'm looking for. I know that is what the full-text search functionality aims to help with, but I think this would still be very useful.

So, for example, in the SurrealQL > Statements section (https://docs.surrealdb.com/docs/surrealql/statements/begin), it would be great if ALL the statements were shown on a single web page. I've mentioned this before, so I apologize if this is annoying, but here's an example of what I'm thinking of: https://knexjs.org/guide/query-builder.html

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Found a typo in array::distinct

Description

image

Its written "DISTANT"

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Bug: the behavior of the equality operator "= or IS" does not match the documentation

Describe the bug

According to the documentation, the operator = or IS should implicitly convert types, but in fact it works like the "==" operator.

Steps to reproduce

true = "true";
10 = "10";

return:
[false]
[false]

Expected behaviour

[true]
[true]

SurrealDB version

1.0.0+20230913.54aedcd for linux on x86_64

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.