Skip to content

Commit

Permalink
Rephrase some parts of the API docs (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhghomon authored Oct 8, 2024
1 parent 6189738 commit 7b89e54
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 39 deletions.
2 changes: 1 addition & 1 deletion src/screens/database/docs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function buildDocumentation(schema: ConnectionSchema): DocsTopic[] {
},
{
id: newId(),
title: "Initialises",
title: "Initialising",
component: DocsGlobalInit,
excludeLanguages: ["cli"],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export function DocsAuthAccessUserData({ language, topic }: TopicProps) {
<div>
<p>
You can access information about a user that is currently
authenticated with a scope. This information includes the
user's name, email, and other details.
authenticated with an access method. This information may
include the user's name, email, and other details.
</p>
</div>
<Box>
Expand Down
6 changes: 3 additions & 3 deletions src/screens/database/docs/topics/authentication/sign-in.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function DocsAuthSignIn({ language }: TopicProps) {
const esc_database = JSON.stringify(authentication.database);

const descriptions = {
cli: `With the SurrealDB CLI, you can only signin via system(Root, Namespace and Database) users. This example shows a command on how to signin with the username and password left blank.`,
cli: `With the CLI's surreal sql command, you can sign in as a system (Root, Namespace and Database) users. This example shows a command on how to sign in as a root user with the username and password left blank.`,
_: `With SurrealDB's SDKs, you can signin both system (Root, Namespace and Database) users and scope users. The example shows how to sigin a new user based on the credentials required for access.`,
};

Expand Down Expand Up @@ -83,11 +83,11 @@ export function DocsAuthSignIn({ language }: TopicProps) {
},
}).await?;
// Sign in a Scope user
// Sign in a Record user
db.signin(Scope {
namespace: "test",
database: "test",
scope: "user",
access: "user",
params: Credentials {
email: "[email protected]",
pass: "123456",
Expand Down
6 changes: 3 additions & 3 deletions src/screens/database/docs/topics/authentication/sign-up.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ export function DocsAuthSignUp({ language }: TopicProps) {
`,
rust: `
use serde::Serialize;
use surrealdb::opt::auth::Scope;
use surrealdb::opt::auth::Record;
#[derive(Serialize)]
struct Credentials<'a> {
email: &'a str,
pass: &'a str,
}
let jwt = db.signup(Scope {
let jwt = db.signup(Record {
namespace: ${esc_namespace},
database: ${esc_database},
scope: "user",
access: "user",
params: Credentials {
email: "[email protected]",
pass: "123456",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function DocsConceptsFullTextSearch({ language }: TopicProps) {
Full Text Search enables search capabilities within your
database connection. This enables text matching, proximity
matching, proximity search, and more. In SurrealDB Full-Text
Search is ACID-COMPLIANT and you can access this using{" "}
Search is ACID-compliant and can be accessed using{" "}
<Link href="https://surrealdb.com/docs/surrealdb/surrealql/functions/search#searchhighlight">
{" "}
Search functions
Expand All @@ -90,7 +90,7 @@ export function DocsConceptsFullTextSearch({ language }: TopicProps) {
{" "}
Indexes
</Link>
. To learn more checkout this{" "}
. To learn more, check out this{" "}
<Link href="https://surrealdb.com/docs/surrealdb/reference-guide/full-text-search">
{" "}
Reference guide
Expand Down
2 changes: 1 addition & 1 deletion src/screens/database/docs/topics/concepts/surrealml.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function DocsConceptsSurrealML({ language, topic }: TopicProps) {
out there, instead works with them to ease the storage,
loading, and execution of models. Someone using SurrealML
will be able to train their model in a chosen framework in
Python, save their model, and load and execute the model in
Python, save the model, and load and execute it in
either Python or Rust. You can use SurrealML within your
database connection to store and execute trained ML models
using{" "}
Expand Down
2 changes: 1 addition & 1 deletion src/screens/database/docs/topics/global/databases.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function DocsGlobalDatabases({ language }: TopicProps) {
<p>
The database is the primary storage in a namespace. It
contains the tables, views, and indexes that are used to
store and retrieve data.You can specify which database to
store and retrieve data. You can specify which database to
use and also switch between multiple databases.
</p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/screens/database/docs/topics/global/initialize.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ export function DocsGlobalInit({ language }: TopicProps) {
);

return (
<Article title="Initialises">
<Article title="Initialising">
<div>
<p>
To initialise a connection to SurrealDB, you need to create
a new instance of the Surreal class and connect.This will
a new instance of a SurrealDB client and connect. This will
allow you to interact with the database and run queries to
the database. Do this by importing the Surreal class and
create a new instance of the class. Then, use the connect
Expand Down
9 changes: 4 additions & 5 deletions src/screens/database/docs/topics/global/introduction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,10 @@ export function DocsGlobalIntroduction() {
Using the CLI
</Title>
<p>
When working outside of a programming environment, the
SurrealDB CLI provides a convenient way to interact with
your database. It provides a simple command-line interface
for executing queries, which is especially useful for
limited environments.
The SurrealDB CLI provides a convenient way to interact with
your database on the command line. It provides a simple
interface for executing queries, which is especially useful
for limited environments.
</p>
{active && (
<>
Expand Down
5 changes: 2 additions & 3 deletions src/screens/database/docs/topics/global/namespaces.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ export function DocsGlobalNamespaces({ language }: TopicProps) {
<p>
After connecting to a SurrealDB instance, you can specify
the namespace to use. Namespaces are used to group related
data together this contains information regarding the users,
roles, tokens, and databases that are available to the
namespace.
data together, contains information regarding the users,
roles, tokens, and databases it contains.
</p>
</div>
<Box>
Expand Down
4 changes: 2 additions & 2 deletions src/screens/database/docs/topics/schema/analyzers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ export function DocsSchemaAnalyzers({ language }: TopicProps) {
<div>
<p>
Analyzers are used to enable full-text search on a table
within your database. If you have any analzers defined for a
within your database. If you have any analyzers defined for a
table, you can use the full-text search capabilities of
SurrealDB. Checkout the section on{" "}
SurrealDB. Check out the section on{" "}
<Link href="https://surrealdb.com/docs/surrealdb/reference-guide/full-text-search">
{" "}
Full Text Search for more information.
Expand Down
2 changes: 1 addition & 1 deletion src/screens/database/docs/topics/schema/functions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function DocsSchemaFunctions({ language }: TopicProps) {
<p>
Functions are a way to encapsulate logic in a database. To
define functions you have to be a system user
(namespace,database,root) They can be used to perform
(namespace, database, or root). They can be used to perform
calculations, manipulate data, or perform other operations.
In SurrealDB functions can be written just as you would in
your programming language of choice.
Expand Down
12 changes: 6 additions & 6 deletions src/screens/database/docs/topics/schema/params.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ export function DocsSchemaParams({ language }: TopicProps) {
const snippets = useMemo<Snippets>(
() => ({
cli: `
// Assign the variable on the connection
// Assign a variable on the connection
DEFINE PARAM $endpointBase VALUE "https://dummyjson.com";
// Remove a parameter from the connection
REMOVE PARAM $endpointBase;
`,
js: `
// Assign the variable on the connection
// Assign a variable on the connection
await db.let('name', {
first: 'Tobie',
last: 'Morgan Hitchcock',
Expand All @@ -32,7 +32,7 @@ export function DocsSchemaParams({ language }: TopicProps) {
`,
rust: `
// Assign the variable on the connection
// Assign a variable on the connection
db.set("name", Name {
first: "Tobie",
last: "Morgan Hitchcock",
Expand All @@ -47,7 +47,7 @@ export function DocsSchemaParams({ language }: TopicProps) {
db.query("SELECT * FROM person WHERE name.first = $name.first").await?;
`,
py: `
# Assign the variable on the connection
# Assign a variable on the connection
await db.let("name", {
"first": "Tobie",
"last": "Morgan Hitchcock",
Expand All @@ -60,7 +60,7 @@ export function DocsSchemaParams({ language }: TopicProps) {
await db.query('SELECT * FROM person WHERE name.first = $name.first')
`,
go: `
// Assign the variable on the connection
// Assign a variable on the connection
db.Let("name", map[string]string{
"first": "ElecTwix",
Expand All @@ -74,7 +74,7 @@ export function DocsSchemaParams({ language }: TopicProps) {
db.Query("SELECT * FROM person WHERE name.first = $name.first", nil);
`,
csharp: `
// Assign the variable on the connection
// Assign a variable on the connection
await db.Set("name", new { FirstName = "Tobie", LastName = "Morgan Hitchcock" });
// Use the variable in a subsequent query
Expand Down
6 changes: 3 additions & 3 deletions src/screens/database/docs/topics/schema/scopes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ export function DocsSchemaScopes({ language }: TopicProps) {
<Article title="Scopes">
<div>
<p>
Within SurrealDB, scopes are a way to manage access to data.
Within SurrealDB, accesses are a way to manage access to data.
They are defined within the schema and can be used to
restrict access to certain parts of the data. To access data
within a scope, you must first sign in with the appropriate
credentials. In SDKs you can run qu
within an access, you must first sign in with the appropriate
credentials.
</p>
</div>
<Box>
Expand Down
6 changes: 2 additions & 4 deletions src/screens/database/docs/topics/schema/users.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,8 @@ export function DocsSchemaUsers({ language }: TopicProps) {
<Article title="Users">
<div>
<p>
Managing permissions for Users within SurrealDB can be done
using Scopes. Scopes are a way to group permissions together
and assign them to Users with scopes you can manage
authentication and access control for your table and fields.
Managing permissions for system Users within SurrealDB can be done
using the roles OWNER, EDITOR, and VIEWER.
</p>
</div>
<Box>
Expand Down

0 comments on commit 7b89e54

Please sign in to comment.