Skip to content

Commit e8c079e

Browse files
author
Bennett Hardwick
committed
Docs
1 parent 61a71b6 commit e8c079e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/lib.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,27 @@
135135
//!
136136
//! Sort keys will contain that value and will be prefixed by the sort key prefix.
137137
//!
138+
//! #### Explicit `pk` and `sk` fields
139+
//!
140+
//! It's common in DynamoDB to use fields on your records called `pk` and `sk` for your partition
141+
//! and sort keys. To support this behaviour these are treated as special keywords in Cryptanomo.
142+
//! If your field contains a `pk` or an `sk` field they must be annotated with the `#[partition_key]` and `#[sort_key]` attributes respectively.
143+
//!
144+
//! ```rust
145+
//! use cryptonamo::Encryptable;
146+
//!
147+
//! #[derive(Debug, Encryptable)]
148+
//! struct User {
149+
//! #[partition_key]
150+
//! pk: String,
151+
//! #[sort_key]
152+
//! sk: String,
153+
//!
154+
//! #[cryptonamo(skip)]
155+
//! not_required: String,
156+
//! }
157+
//! ```
158+
//!
138159
//! ## Indexing
139160
//!
140161
//! Cryptanomo supports indexing of encrypted fields for searching.

0 commit comments

Comments
 (0)