doc.rs 481 B

1234567891011121314151617181920
  1. use flowy_document::protobuf::Doc;
  2. pub(crate) const DOC_TABLE: &'static str = "doc_table";
  3. #[derive(Debug, Clone, sqlx::FromRow)]
  4. pub struct DocTable {
  5. pub(crate) id: uuid::Uuid,
  6. pub(crate) data: String,
  7. pub(crate) rev_id: i64,
  8. }
  9. impl std::convert::Into<Doc> for DocTable {
  10. fn into(self) -> Doc {
  11. let mut doc = Doc::new();
  12. doc.set_id(self.id.to_string());
  13. doc.set_data(self.data);
  14. doc.set_rev_id(self.rev_id);
  15. doc
  16. }
  17. }