MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / put_get_sequence

Function put_get_sequence

nodedb/src/control/security/catalog/sequences.rs:194–220  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

192
193 #[test]
194 fn put_get_sequence() {
195 let cat = make_catalog();
196 let seq = StoredSequence {
197 tenant_id: 1,
198 name: "order_seq".into(),
199 owner: "admin".into(),
200 start_value: 1,
201 increment: 1,
202 min_value: 1,
203 max_value: i64::MAX,
204 cycle: false,
205 cache_size: 1,
206 epoch: 1,
207 created_at: 1000,
208 format_template: None,
209 reset_scope: crate::control::sequence::ResetScope::Never,
210 gap_free: false,
211 descriptor_version: 0,
212 modification_hlc: nodedb_types::Hlc::ZERO,
213 };
214 cat.put_sequence(&seq).unwrap();
215
216 let loaded = cat.get_sequence(1, "order_seq").unwrap().unwrap();
217 assert_eq!(loaded.name, "order_seq");
218 assert_eq!(loaded.increment, 1);
219 assert_eq!(loaded.start_value, 1);
220 }
221
222 #[test]
223 fn delete_sequence() {

Callers

nothing calls this directly

Calls 3

put_sequenceMethod · 0.80
get_sequenceMethod · 0.80
make_catalogFunction · 0.70

Tested by

no test coverage detected