vault backup: 2024-01-04 18:38:41

This commit is contained in:
2024-01-04 18:38:41 -05:00
parent 17dd498d4b
commit 62023237bd

View File

@@ -10,6 +10,7 @@
- `COMMIT`: Used for making a group of SurrealQL statements a singular transaction. Transaction block must start with a `BEGIN`
- [RELATE](https://docs.surrealdb.com/docs/surrealql/statements/use/): Used to traverse records efficiently without the need for SQL JOINs
## Examples
### Basic `SELECT` examples
@@ -120,10 +121,10 @@ UPDATE ONLY person:tobie SET name = 'Tobie', company = 'SurrealDB', skills = ['R
### Logins
Create a login table
`DEFINE TABLE user SCHEMAFULL PERMISSIONS FOR select, update, delete WHERE id = $auth.id;`
```DEFINE TABLE user SCHEMAFULL PERMISSIONS FOR select, update, delete WHERE id = $auth.id;```
Define some fields
`DEFINE FIELD name ON user TYPE string ASSERT string::len($value) >= 2;`
```DEFINE FIELD name ON user TYPE string ASSERT string::len($value) >= 2;`
`DEFINE FIELD username ON user TYPE string VALUE string::lowercase($value);`
`DEFINE FIELD password ON user TYPE string PERMISSIONS FOR select NONE;`