-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
61,455 additions
and
58,573 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
-- Create a new record | ||
CREATE person; | ||
|
||
-- To specify a specific ID for a table instead, use : followed by a value. | ||
CREATE person:one; | ||
|
||
-- Use the type::thing() function to provide a record's table and id separately | ||
CREATE type::thing("person", "one"); | ||
|
||
-- Create a new record with a text id | ||
CREATE person:tobie SET | ||
name = 'Tobie', | ||
company = 'SurrealDB', | ||
skills = ['Rust', 'Go', 'JavaScript']; | ||
|
||
-- Multiple records or even multiple record types can be created by separating table names by commas. | ||
CREATE townsperson, cat, dog SET | ||
created_at = time::now(), | ||
name = "Just a " + meta::tb(id); | ||
|
||
-- Returns just a single record | ||
CREATE ONLY person:tobie SET | ||
name = 'Tobie', | ||
company = 'SurrealDB', | ||
skills = ['Rust', 'Go', 'JavaScript']; | ||
|
||
-- Return Diff | ||
CREATE person SET age = 46, username = "john-smith" RETURN DIFF; | ||
|
||
-- Specify a timeout | ||
CREATE person:john SET age = 46, username = "john-smith" TIMEOUT 500ms; | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.