Skip to content

Commit

Permalink
Merge branch 'main' into emmanuel/surreal-search
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuel-keller committed Oct 13, 2023
2 parents 2dc3e18 + 4809875 commit 3c27227
Show file tree
Hide file tree
Showing 39 changed files with 1,221 additions and 18 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ This website is built using [Docusaurus 2](https://docusaurus.io/), a modern sta
### Installation

```
$ yarn
$ pnpm
```

### Local Development

```
$ yarn start
$ pnpm start
```

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

### Build

```
$ yarn build
$ pnpm build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.
Expand All @@ -29,13 +29,13 @@ This command generates static content into the `build` directory and can be serv
Using SSH:

```
$ USE_SSH=true yarn deploy
$ USE_SSH=true pnpm deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
$ GIT_USER=<Your GitHub username> pnpm deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
38 changes: 37 additions & 1 deletion docs/CLI tool/backup_command.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,40 @@
sidebar_position: 5
---

# Backup command
import TableImportComponent from '../../src/components/TableData/TableImportComponent';
import { data } from '../../src/components/TableData/CLI/Backup/TableData';
import { PositionalData } from '../../src/components/TableData/CLI/Backup/PositionalData';
import CommandHelp from '../../src/components/TableData/CLI/Backup/commandHelp';

# Backup command
## Backup command

The Backup command backs up data into or from an existing database.

:::note
<em>BEFORE YOU START</em> Make sure you’ve installed SurrealDB — it should only take a second!
:::

## Command options

<TableImportComponent data={data} />

## Positional argument
<TableImportComponent data={PositionalData} />

### Example usage
To perform a SurrealQL database Backup, in a terminal run the `surreal backup` command with the required arguments.

```bash
surreal backup [OPTIONS] <from> <into>
```

## Command help
To see the help information and usage instructions, in a terminal run the `surreal backup --help` command without any further arguments. This command gives general information on the arguments, inputs, and additional options for the `backup` command.

```bash
surreal backup --help
```

The output of the above command :
<CommandHelp />
38 changes: 37 additions & 1 deletion docs/CLI tool/export_command.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
---
sidebar_position: 4
---
import TableImportComponent from '../../src/components/TableData/TableImportComponent';
import { data } from '../../src/components/TableData/CLI/Export/TableData';
import { PositionalData } from '../../src/components/TableData/CLI/Export/PositionalData';
import CommandHelp from '../../src/components/TableData/CLI/Export/commandHelp';

# Export command
# Export command

## Export command

The export command exports a SurrealQL script file from a local or remote SurrealDB database server.

:::note
<em>BEFORE YOU START</em> Make sure you’ve installed SurrealDB — it should only take a second!
:::

## Command options

<TableImportComponent data={data} />

## Positional argument
<TableImportComponent data={PositionalData} />

### Example usage
To perform a SurrealQL database export into a local file, in a terminal run the `surreal export` command with the required arguments.

```bash
surreal export --conn http://localhost:8000 --user root --pass root --ns test --db test export.surql
```

## Command help
To see the help information and usage instructions, in a terminal run the surreal export --help command without any further arguments. This command gives general information on the arguments, inputs, and additional options for the export command.

```bash
surreal help export
```

The output of the above command :
<CommandHelp />
17 changes: 16 additions & 1 deletion docs/CLI tool/help_command.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,19 @@
sidebar_position: 11
---

# Help command
# Help command

## Help command

The help command displays help information and instructions on the command-line tool and its arguments.

:::note
<em>BEFORE YOU START</em> Make sure you’ve installed SurrealDB — it should only take a second!
:::

## Show the command-line help information
To see the general help information for the command-line tool, in a terminal run the `surreal help` command without any further arguments. This command gives general information on the other functionality which can be run with the command-line tool.

```bash
surreal help
```
33 changes: 31 additions & 2 deletions docs/CLI tool/import_command.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,41 @@ sidebar_position: 3
---

import TableImportComponent from '../../src/components/TableData/TableImportComponent';
import { data } from '../../src/components/TableData/Import/TableData';
import { data } from '../../src/components/TableData/CLI/Import/TableData';
import { PositionalData } from '../../src/components/TableData/CLI/import/PositionalData';

import CommandHelp from '../../src/components/TableData/Import/commandHelp';
import CommandHelp from '../../src/components/TableData/CLI/Import/commandHelp';

# Import command

## Import command

The import command imports a SurrealQL script file into a local or remote SurrealDB database server.

:::note
<em>BEFORE YOU START</em> Make sure you’ve installed SurrealDB — it should only take a second!
:::


## Command options
<TableImportComponent data={data} />

## Positional argument
<TableImportComponent data={PositionalData} />

### Example usage
To perform a SurrealQL database import from a local file, in a terminal run the `surreal import` command with the required arguments.

```bash
surreal import --conn http://localhost:8000 --user root --pass root --ns test --db test downloads/surreal_deal_v1.surql
```

### Command help
To see the help information and usage instructions, in a terminal run the `surreal import --help` command without any further arguments. This command gives general information on the arguments, inputs, and additional options for the `import` command.

```bash
surreal import --help
```

The output of the above command :
<CommandHelp />
24 changes: 23 additions & 1 deletion docs/CLI tool/isready_command.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,26 @@
sidebar_position: 7
---

# Isready command
import TableImportComponent from '../../src/components/TableData/TableImportComponent';
import { data } from '../../src/components/TableData/CLI/Isready/TableData';

# Isready command

## Isready command

The isready command attempts to connect to a remote SurrealDB server to detect if it has successfully started.

:::note
<em>BEFORE YOU START</em> Make sure you’ve installed SurrealDB — it should only take a second!
:::

## Command options

<TableImportComponent data={data} />

## Example usage
To display the current command-line tool version, along with the platform and architecture, in a terminal run the surreal version command without any further arguments

```bash
surreal isready --conn http://localhost:8000
```
2 changes: 2 additions & 0 deletions docs/CLI tool/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ sidebar_position: 1
---

# Overview
## Overview

The SurrealDB command-line tool can be used to export a dataset as SurrealQL from a local or remote SurrealDB database, import SurrealQL data into a local or remote database, and start a single SurrealDB instance or distributed cluster.
43 changes: 42 additions & 1 deletion docs/CLI tool/sql_command.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
---
sidebar_position: 9
---
import TableImportComponent from '../../src/components/TableData/TableImportComponent';
import { data } from '../../src/components/TableData/CLI/SQL/TableData';
import CommandHelp from '../../src/components/TableData/CLI/SQL/commandHelp';

# SQL command
# SQL command

## SQL command

The SQL command starts a REPL for running or piping SurrealQL queries to a local or remote SurrealDB database server.

:::note
<em>BEFORE YOU START</em> Make sure you’ve installed SurrealDB — it should only take a second!
:::

## Command options

<TableImportComponent data={data} />

### Example usage

To start a terminal-based REPL and run or pipe queries to a local or remote SurrealDB database, in a terminal run the `surreal sql` command with the required arguments.

Once you see the `>` character you can type your SurrealQL query, followed by the `enter` key. The command has support for `` and `` arrows for selecting previous SQL statements, and stores the statement history in a `history.txt` file. To exit the REPL use the `ctrl + c` or `ctrl + d` key combinations.

```bash
surreal sql --endpoint http://localhost:8000 --username root --password root --namespace test --database test
```

It is also possible to pipe a set of statements to a remote database. This functionality is only designed for submitting a small number of queries to the database server. For a large number of queries, use the [import command](/docs/CLI%20tool/import_command).

```bash
cat myfile.surql | surreal sql --endpoint http://localhost:8000 --username root --password root --namespace test --database test
```


## Command help
To see the help information and usage instructions, in a terminal run the `surreal sql --help` command without any further arguments. This command gives general information on the arguments, inputs, and additional options for the `sql` command.

```bash
surreal sql --help
```

<CommandHelp />
48 changes: 47 additions & 1 deletion docs/CLI tool/start_command.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,50 @@
sidebar_position: 2
---

# Start command
import TableImportComponent from '../../src/components/TableData/TableImportComponent';
import { data } from '../../src/components/TableData/CLI/Start/TableData';
import { PositionalData } from '../../src/components/TableData/CLI/Start/PositionalData';
import CommandHelp from '../../src/components/TableData/CLI/Start/commandHelp';

# Start command

## Start command

The start command starts a SurrealDB server in memory, on disk, or in a distributed setup.

:::note
<em>BEFORE YOU START</em> Make sure you’ve installed SurrealDB — it should only take a second!
:::

## Command options

<TableImportComponent data={data} />

## Positional argument

<TableImportComponent data={PositionalData} />


### Example usage
To display the current command-line tool version, along with the platform and architecture, in a terminal run the surreal version.

```bash
surreal version
```

## Strict mode

SurrealDB supports the ability to startup in strict mode. When running in strict mode, all `NAMESPACE`, `DATABASE`, and `TABLE` definitions will not be created automatically when data is inserted. Instead, if the selected namespace, database, or table has not been specifically defined, then the query will return an error.

```bash
surreal start --strict --log debug memory
```
### Command help

To see the help information and usage instructions, in a terminal run the `surreal start --help` command without any further arguments. This command gives general information on the arguments, inputs, and additional options for the `start` command.

```bash
surreal start --help
```
The output of the above command :
<CommandHelp />
55 changes: 54 additions & 1 deletion docs/CLI tool/upgrade_command.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,57 @@
sidebar_position: 10
---

# Upgrade command
import TableImportComponent from '../../src/components/TableData/TableImportComponent';
import { data } from '../../src/components/TableData/CLI/Upgrade/TableData';
import CommandHelp from '../../src/components/TableData/CLI/Upgrade/commandHelp';

# Upgrade command

## Upgrade command

This command upgrades SurrealDB to the latest version, nightly or a specified version

:::note
<em>BEFORE YOU START</em> Make sure you’ve installed SurrealDB — it should only take a second!
:::

## Command options

<TableImportComponent data={data} />

### Example usage
This example shows how you can use the upgrade command to upgrade to the latest version of SurrealDB

```bash
surreal upgrade
```

## Global install
If SurrealDB is installed globally on your system, you might need to run the upgrade command with elevated permissions.

```bash
sudo surreal upgrade
```

## Install nightly
Use the --nightly flag to upgrade to the latest nightly version of SurrealDB.

```bash
surreal upgrade --nightly
```

## Install specific version
Use the `--version` flag to upgrade to the a specific version of SurrealDB.

```bash
surreal upgrade --version v1.0.0-beta.10
```

## Command help
To see the help information and usage instructions, in a terminal run the `surreal upgrade --help` command without any further arguments. This command gives general information on the arguments, inputs, and additional options for the `upgrade` command.

```bash
surreal upgrade --help
```

<CommandHelp />
Loading

0 comments on commit 3c27227

Please sign in to comment.