-
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
46 changed files
with
1,610 additions
and
1,239 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,4 @@ | ||
# Example | ||
Are you looking for a real-life example of scyllax? You're in luck! The `exmaple` directory in our GitHub repository contains a full example of scyllax in action -- it's actually used to run tests! | ||
|
||
[https://github.com/trufflehq/scyllax/tree/main/example](https://github.com/trufflehq/scyllax/tree/main/example) |
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,33 @@ | ||
# Query Collections | ||
Once you've made all your queries, you'll have to make a Query Collection. This is a struct that contains all your prepared queries. Scyllax provides the `create_query_collection` macro to make this easy. | ||
|
||
```rust | ||
use scyllax::prelude::*; | ||
use super::model::UpsertPerson; | ||
|
||
create_query_collection!( | ||
PersonQueries, | ||
[ | ||
GetPersonById, | ||
GetPeopleByIds, | ||
GetPersonByEmail, | ||
DeletePersonById, | ||
UpsertPerson, | ||
] | ||
); | ||
``` | ||
Then, you use the Query Collection when you instantiate your Executor. | ||
|
||
```rust | ||
let executor = Executor::<PersonQueries>::new(session).await?; | ||
``` | ||
|
||
Finally, you can run your queries. | ||
|
||
```rust | ||
let person = executor | ||
.execute_read(&GetPersonById { | ||
id: Uuid::new_v4(), | ||
}) | ||
.await?; | ||
``` |
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.