File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 135
135
//!
136
136
//! Sort keys will contain that value and will be prefixed by the sort key prefix.
137
137
//!
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
+ //!
138
159
//! ## Indexing
139
160
//!
140
161
//! Cryptanomo supports indexing of encrypted fields for searching.
You can’t perform that action at this time.
0 commit comments