Giter VIP home page Giter VIP logo

docs.surrealdb.com's Introduction


SurrealDB Logo SurrealDB Logo

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

Develop easier.   Build faster.   Scale quicker.


The documentation for SurrealDB, built using Docusaurus.

If you want to contribute, then please read the contributing guidelines.


       

Blog   Github	  LinkedIn   Twitter   Youtube   Dev   Discord   StackOverflow


Getting started with SurrealDB

Visit surrealdb.com/docs to get started with SurrealDB.

Contributing to the documentation

Please see our contributing guidelines.

Good First Issues

We have a list of good first issues that contain bugs that have a relatively limited scope. This is a great place to get started, gain experience, and get familiar with our contribution process.

Installation

To get started with contributing to the SurrealDB documentation, first install the required packages using the following command.

$ pnpm install

Development

The following command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

$ pnpm start

Building

The following command builds and generates static content into the build directory, and can then be served using any static contents hosting service.

$ pnpm build

docs.surrealdb.com's People

Contributors

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 kharbanda14 avatar lizzieh01 avatar macjuul avatar naisofly avatar nazmul-pro avatar ochibobo avatar odonno avatar oskar-gmerek avatar phughk avatar rschooley avatar sgirones 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  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

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

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

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

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

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: 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

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: `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

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: 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: 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

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: 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: 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

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

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

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: 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: 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

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

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

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: 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

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: 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

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

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: 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

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

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

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

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

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.

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

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.

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: 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: 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

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

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

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

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

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

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.