Skip to content

Improve type check of sort key #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 10, 2020
Merged

Improve type check of sort key #46

merged 9 commits into from
Jul 10, 2020

Conversation

kuy
Copy link
Collaborator

@kuy kuy commented Jul 9, 2020

What does this change?

This changes give a heads up about a missing sort key in compile time, not runtime.

let res = client.get("id1").run().await; // error 🔥 

let res = client.get("id1", 2003).run().await; // awesome 🚀 

Affected operations

  • get
  • delete
  • update

Breaking changes ⚠️

get op

Before

let res = client.get("id1").sort_key(2003).run().await;

After

let res = client.get("id1", 2003).run().await;

delete op

Before

let res = client.delete("id0").sort_key(2003).run().await;

After

let res = client.delete("id0", 2003).run().await;

update op

Before

let res = client
    .update("id0")
    .sort_key(36)
    .set(set_expression)
    ....

After

let res = client
    .update("id0", 36)
    .set(set_expression)
    ....

NOTE: No change in tables only partition key

References

#26

Screenshots

Screen Shot 2020-07-09 at 22 42 59

What can I check for bug fixes?

See test code

Not focus

More strict type checking: #47

@kuy kuy mentioned this pull request Jul 9, 2020
@kuy kuy marked this pull request as ready for review July 9, 2020 17:23
Copy link
Member

@bokuweb bokuweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great 👍

@@ -111,6 +111,18 @@ make dynamo
make test
```

NOTE: Don't recommend to use `cargo test` because our test suite doesn't support running tests in parallel. Use `cargo test -- --test-threads=1` instead of it.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@bokuweb bokuweb merged commit 7e9cb10 into master Jul 10, 2020
@kuy kuy deleted the strict-keys branch July 10, 2020 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants