Git Product home page Git Product logo

surrealdb / www.surrealdb.com Goto Github PK

View Code? Open in Web Editor NEW
94.0 18.0 101.0 197.1 MB

The website, and blog for SurrealDB, built using Ember.js

Home Page: https://surrealdb.com

License: Apache License 2.0

JavaScript 5.46% Makefile 0.29% HTML 0.16% SCSS 8.64% Handlebars 82.97% Shell 1.07% C 0.01% Python 0.21% Go 0.33% Java 0.06% Groovy 0.01% TypeScript 0.21% C# 0.58%
surrealdb surreal ember emberjs database serverless nosql

www.surrealdb.com's Introduction

www.surrealdb.com

The web application for surrealdb.com built using Ember.js.

Contributing

Every contribution is welcome! Here is some basic information on how to get started with running and changing the SurrealDB website locally for development.

  • Make sure you have node & npm installed on your system (Here's a great guide by NPM!)
  • Clone the repository, optionally your own fork
    • Via HTTPS: git clone https://github.com/USERNAME/www.surrealdb.com
    • Via SSH: git clone [email protected]:USERNAME/www.surrealdb.com
  • Install dependencies
    • npm install
  • Start the development version of the website
    • npm run start
  • After the process started, you can access the website at: http://localhost:4200

Where can I find what?

  • Pages are stored in app/templates
  • Snippets are often stored in app/snippets

Adding a new page

  • Add your page in app/templates
  • Add the route in app/router.js
  • Add the route in possible sidebars/overview pages/etc...

Add a language for code highlighting

Most languages should be available out of the box. Please adjust the files accordingly:

  • app/initializers/prism.js
  • app/instance-initializers/marked.js

www.surrealdb.com's People

Contributors

78wesley avatar adityab-shivamoon avatar adityahbapat avatar adminy avatar akankshadharkar avatar alexfrid avatar alexfriesen avatar amaster507 avatar annainfo avatar anupj avatar damiankocher avatar ekwuno avatar electwix avatar emmanuel-keller avatar finnbear avatar jaimemh avatar jamesrampton avatar justcursed avatar kearfy avatar matthewary avatar meadowsys avatar naisofly avatar notgovernor avatar odonno avatar phughk avatar raphaeldarley avatar rushmorem avatar rytswd avatar sgirones avatar tobiemh 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  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  avatar  avatar  avatar  avatar  avatar

www.surrealdb.com's Issues

Documentation: Incorrect function definition in docs/blog

Describe the bug

The following example is in the docs (well technically it's in a blog post but they currently serve as supplementary docs/examples):

DEFINE FUNCTION fn::get_person($first: string, $last: string, $birthday: string) {

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

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

};

But it doesn't parse and throws an error, because the branch expressions of the IF statement have semicolons at the end.

The following parses fine:

DEFINE FUNCTION fn::get_person($first: string, $last: string, $birthday: string) {

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

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

};

It also works if you leave the semicolons in and move RETURN to the branches:

DEFINE FUNCTION fn::get_person($first: string, $last: string, $birthday: string) {

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

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

};

Steps to reproduce

Attempt to parse the function definition from the docs:

DEFINE FUNCTION fn::get_person($first: string, $last: string, $birthday: string) {

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

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

};

Expected behaviour

Examples from the docs should parse.

I'm unsure whether the expected behaviour is for IF statements' branches to work with semicolons or not, so either the docs need fixing or the behaviour needs fixing.

My guess is that this is intended behaviour, but maybe I've just spent too much time with Rust.

SurrealDB version

1.0.0-beta.9+20230402.5eafebd for macos on aarch64

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

Set anchors and anchor links

There are some anchors but not everywhere.
Also add anchor link to set anchor (to copy link).

I can work on this if you want.

Adding the missing documentation

Hi,
I've recently discovered this project and it's gotten me really excited!
While trying to use it, I've found myself often looking in the code to figure out how to perform certain operations, and I would like to both contribute and make the project more accessible by documenting what I've found in the official docs.

How can I start writing docs? Is there a convention to them? What are the most important missing docs?

Thanks!

Missing information on functions for JS related clients

Add Authentication section

Being SurrealDB a database that is expected to be exposed for frontend apps, it seems that is necessary a section for authentication and authorization.

It should, at least, contain the following topics:

  • Why you should secure your database access
  • How to create an user to map authentication
  • How to allow creating an user dynamically
  • How to map authorization (permissions) over an user

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 upgrading .8 to .9

https://surrealdb.com/docs/installation/upgrading/beta8-to-beta9

At point 3:
Instead of:
user@localhost % /path/to/binary/surreal export -c http://localhost:8000 -u root -p root mydata.surql
should be:
user@localhost % /path/to/binary/surreal export --conn http://localhost:8000 --ns ns --db db --user root --pass root mydata.surql

Point 4 is missing and should be replaced by 'Stop the SurrealDB instance'

Point 5 is the copy of point 3 but it should be 'Install SurrealDB 1.0.0-beta.9'

At point 7:
Instead of:
user@localhost % surreal import -c http://localhost:8000 -u root -p root mydata.surql
should be:
user@localhost % surreal import --conn http://localhost:8000 --ns ns --db db --user root --pass root mydata.surql

No styling on the entire site?

There appears to be a major CSS problem! I just went to find the docs on running with Docker and I got hit with bare html! The issue persisted as I clicked links around the site. Somebody should look into this asap.

Add Examples to the `DEFINE` statement

At the time of writing https://surrealdb.com/docs/surrealql/statements/define only shows the syntax and provides no examples. Please add examples of how the define statement can be used to accomplish different objectives.

Define is a VERY powerful feature and may deserve several sub-pages as well to deal with it's different features.
These sub-pages may include using DEFINE with:

These sub-pages may include specific use-case examples describing how one could accomplish common objectives.

Docs: Clarify that `function()` syntax works and `function ()` doesn't

Describe the bug

In beta.8, function () { was acceptable syntax for js scripting functions, but it is now a parse error. Only function() { works.

Steps to reproduce

RETURN function () { return true }

Expected behaviour

RETURN function () { return true } should not cause a parse error.

SurrealDB version

1.0.0-beta.9+20230402.5eafebd for linux on x86_64

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

Enhancement: remove the `user@localhost` prefix in front of commands in `Installation`

Currently, the code block for installation in https://surrealdb.com/docs/start/installation looks something like this:

Screenshot 2022-11-08 at 9 47 46 AM

In interest of the first time users and for user experience, I feel it is better to remove the user@localhost prefix and either keep the command only or keep it with the % prefix. This will also make it easier to copy-paste directly without giving much thought to it.

I'm willing to take up the implementation and open a pull request if this Enhancement gets approved.

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!

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.

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 Typos

A collection of typos:

Validation Functions
In the first is::alpha example (SELECT * FROM is::alpha("ABC123");) the output should be false

JS-based Client Libraries (both Deno and Node on the server-side and JavaScript on the client side)
In the code, in the // Perform a custom advanced query example, there is a missing $ before the tb identifier in the query string

Deno driver
In the code for the Surreal.Instance example, the Surreal module is imported cjs-style, not ESM-

Thanks for the hard work! Keep it up!

Documentation: Create a quick reference for pre-defined parameters

Description

Currently, there are many variables, such as $auth, $value, and others that appear throughout the documentation, but are not easily found in a single place. Moreover, there are variables that seem to exist, but are not documented anywhere, such as $session, nor a mechanism to view all parameters available to the current connection.

I believe it would be a great idea to place all available variables in their own dedicated documentation page, or perhaps within the already existing Params page.

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

Typograph under Dart libraries

On the website https://surrealdb.com/features#libraries, under Dart [future] it reads;

A real-time, fast SDK library for Golang with bi-directional communication over WebSockets.

I think the Golang is a typo and should be Dart instead, making it read as follows;

A real-time, fast SDK library for Dart with bi-directional communication over WebSockets.

Bug: docs arent following WCAG standards

Describe the bug

The main website for this project uses a colour scheme that is not colourblind-friendly.

image

image

Steps to reproduce

  1. Be colourblind
  2. Go to site
  3. Cry as you can't read the docs

Expected behaviour

  1. Be colourblind
  2. Go to site
  3. Be able to read the text

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

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 #55
  • Scopes. Use cases (What they are used for). Links to the DEFINE SCOPES docs #55
  • SurrealDB security model, authentication, account management, roles and permissions. #50
  • Records and references
  • Graphs and relations
  • More?

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

`SELECT` statement syntax makes no mention of `AS`

I recently saw a message posted on Discord where someone was struggling with a bug in SurrealDB that was being made manifest by a SELECT statement they wrote. The bug is not related to this issue, but what is related is that they weren't sure that they could make an alias using the AS keyword in a query, which they could do.

I noticed that AS is missing from the official documented syntax for the SELECT statement on the website. I think this should be fixed.

[ Bug ] Error in connection to google analytics

When we open the home page we have linked it to google analytics to track our traffic but due to some issue, it's not getting connected.
image

I would love to fix this issue as I have worked with google analytics multiple times. Have setup this website on my local system. Please assign me this issue so can create a PR.

thanks!

Documentation is wrong for scope

The example is wrong for the usage of scopes here as mentioned in the discord here.

The NS, DB and SC parameters should be in the body not the header as shown in the example

Sidebar hidden when innerWidth is <=1024

Documentation sidebar is not visible/accessible on mobile. Because of this I couldn't find any of the documentation that was not directly linked from the "Overview" page (e.g. "SurrealQL", "CLI tool", sections).

Screen Shot 2022-09-21 at 13 12 47

Screen Shot 2022-09-21 at 13 12 29

surrealdb.dev shows up in search results and is out of date

Hey all,

While searching the internet for "querying SurrealDB" I came across this broken documentation site as the first result: https://surrealdb.dev/docs/start/querying-surrealdb

The URL is surrealdb.dev instead of surrealdb.com. I'm not sure why this site exists but my assumption is that either it shouldn't be indexed by search engines at all or it should redirect to surrealdb.com

It can be confusing because the two sites look identical.

Add Schemafull documentation

Considering the ability of SurrealDB to create schemafull tables, there is no extensive documentation to create them.

A section for schemafull tables should be present with, at least the following points:

  • Why you should use Schemafull tables.
  • Defining table and data models
  • All available data model types
  • Adding default values
  • Adding assertions to values
  • Setting permissions at column level

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.