-
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.
feat, refactor: Query Collections,
read_query
, electric slide (#13)
- Loading branch information
Showing
56 changed files
with
1,768 additions
and
1,328 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# configuration file for git-cliff (0.1.0) | ||
|
||
[changelog] | ||
header = "# Changelog\n\n" | ||
body = """ | ||
{% if version %}\ | ||
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} | ||
{% else %}\ | ||
## [unreleased] | ||
{% endif %}\ | ||
{% for group, commits in commits | group_by(attribute="group") %} | ||
### {{ group | upper_first }} | ||
{% for commit in commits %} | ||
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message }}\ | ||
{% endfor %} | ||
{% endfor %}\n | ||
""" | ||
# remove the leading and trailing whitespace from the template | ||
trim = true | ||
|
||
[git] | ||
conventional_commits = true | ||
filter_unconventional = true | ||
commit_preprocessors = [ | ||
# replace issues with issue links | ||
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/trufflehq/scyllax/issues/${2}))" }, | ||
] | ||
commit_parsers = [ | ||
{ message = "^build", group = "Build" }, | ||
{ message = "^docs", group = "Documentation" }, | ||
{ message = "^feat", group = "Features" }, | ||
{ message = "^fix", group = "Bug Fixes" }, | ||
{ message = "^perf", group = "Performance" }, | ||
{ message = "^refactor", group = "Refactor" }, | ||
{ message = "^test", group = "Testing" }, | ||
{ message = "^ci", skip = true }, | ||
] | ||
filter_commits = false | ||
date_order = true | ||
sort_commits = "oldest" |
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.