-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into emmanuel/surreal-search
- Loading branch information
Showing
39 changed files
with
1,221 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.