From 61f3d0cb52f67e8e69e05ce1b6b3f43dab028b88 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Sat, 22 Feb 2020 19:00:48 +0800 Subject: [PATCH] item: better documentation on our "id" --- src/item.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/item.rs b/src/item.rs index 48b1522..d812ce7 100644 --- a/src/item.rs +++ b/src/item.rs @@ -25,6 +25,14 @@ impl Into for &str { #[derive(Queryable)] pub struct Item { + // This "id", though primary key, is not how the client actually + // identifies an item, and it is not sent to the client. + // Instead, this "id" is more like a "timestamp", in the sense + // that each time an item is modified, it increments. + // (this incrementing is achieved by deleting and re-inserting + // the item and relying on AUTOINCREMENT) + // This is used in place of the role of timestamp in the Ruby + // and Go implementation. pub id: i64, pub owner: i32, pub uuid: String,