-
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
1 parent
7abb5af
commit d5ed75e
Showing
6 changed files
with
38 additions
and
1 deletion.
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
use flake "./engine" | ||
dotenv engine/.env |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
{"schemas":"DEFINE TABLE script_migration SCHEMAFULL\n PERMISSIONS\n FOR select FULL\n FOR create, update, delete NONE;\n\nDEFINE FIELD script_name ON script_migration TYPE string;\nDEFINE FIELD executed_at ON script_migration TYPE datetime DEFAULT time::now();\nDEFINE TABLE user SCHEMALESS\n PERMISSIONS\n FOR select FULL\n FOR update WHERE id = $auth.id\n FOR create, delete NONE;\n\nDEFINE FIELD name ON user TYPE string;\nDEFINE FIELD email ON user TYPE string;\nDEFINE FIELD password ON user TYPE string;\n\nDEFINE INDEX unique_email ON user COLUMNS email UNIQUE;\n\nDEFINE SCOPE user_scope\n SESSION 30d\n SIGNUP (\n CREATE user\n SET\n name = $name,\n email = $email,\n password = crypto::argon2::generate($password)\n )\n SIGNIN (\n SELECT *\n FROM user\n WHERE email = $email AND crypto::argon2::compare(password, $password)\n );\n","events":""} |
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,7 @@ | ||
DEFINE TABLE script_migration SCHEMAFULL | ||
PERMISSIONS | ||
FOR select FULL | ||
FOR create, update, delete NONE; | ||
|
||
DEFINE FIELD script_name ON script_migration TYPE string; | ||
DEFINE FIELD executed_at ON script_migration TYPE datetime DEFAULT time::now(); |
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,26 @@ | ||
DEFINE TABLE user SCHEMALESS | ||
PERMISSIONS | ||
FOR select FULL | ||
FOR update WHERE id = $auth.id | ||
FOR create, delete NONE; | ||
|
||
DEFINE FIELD name ON user TYPE string; | ||
DEFINE FIELD email ON user TYPE string; | ||
DEFINE FIELD password ON user TYPE string; | ||
|
||
DEFINE INDEX unique_email ON user COLUMNS email UNIQUE; | ||
|
||
DEFINE SCOPE user_scope | ||
SESSION 30d | ||
SIGNUP ( | ||
CREATE user | ||
SET | ||
name = $name, | ||
email = $email, | ||
password = crypto::argon2::generate($password) | ||
) | ||
SIGNIN ( | ||
SELECT * | ||
FROM user | ||
WHERE email = $email AND crypto::argon2::compare(password, $password) | ||
); |
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