Nathan.fooo 32bd0ffca2
feat: migrate flowy-database (#2373)
* feat: add flowy-database2

* chore: config type option data

* chore: impl type option

* feat: config group

* fix: group compile

* feat: add sort

* chore: setting

* chore: insert with specific type

* chore: custom group

* chore: rename any map

* chore: use group setting

* chore: update

* chore: open database event

* chore: update database editor

* chore: update

* chore: update view editor

* chore: update

* chore: update view editor

* chore: sort feat

* chore: update handler

* chore: update

* chore: config handler event

* feat: impl handlers

* feat: impl handlers

* chore: layout setting

* feat: impl handlers

* chore: remove flowy-folder ref

* chore: integrate flowy-database2

* feat: get cell

* chore: create database with data

* chore: create view

* chore: fix dart compile

* fix: some bugs

* chore: update

* chore: merge develop

* chore: fix warning

* chore: integrate rocksdb

* fix: rocksdb compile errros

* fix: update cell

* chore: update the bundle identifier

* fix: create row

* fix: switch to field

* fix: duplicate grid

* test: migrate tests

* test: migrate tests

* test: update test

* test: migrate tests

* chore: add patch
2023-04-28 14:08:53 +08:00

70 lines
1.3 KiB
Rust

use flowy_derive::ProtoBuf;
use crate::entities::{InsertedRowPB, UpdatedRowPB};
#[derive(Debug, Default, Clone, ProtoBuf)]
pub struct RowsVisibilityChangesetPB {
#[pb(index = 1)]
pub view_id: String,
#[pb(index = 5)]
pub visible_rows: Vec<InsertedRowPB>,
#[pb(index = 6)]
pub invisible_rows: Vec<i64>,
}
#[derive(Debug, Default, Clone, ProtoBuf)]
pub struct RowsChangesetPB {
#[pb(index = 1)]
pub view_id: String,
#[pb(index = 2)]
pub inserted_rows: Vec<InsertedRowPB>,
#[pb(index = 3)]
pub deleted_rows: Vec<i64>,
#[pb(index = 4)]
pub updated_rows: Vec<UpdatedRowPB>,
}
impl RowsChangesetPB {
pub fn from_insert(view_id: String, inserted_rows: Vec<InsertedRowPB>) -> Self {
Self {
view_id,
inserted_rows,
..Default::default()
}
}
pub fn from_delete(view_id: String, deleted_rows: Vec<i64>) -> Self {
Self {
view_id,
deleted_rows,
..Default::default()
}
}
pub fn from_update(view_id: String, updated_rows: Vec<UpdatedRowPB>) -> Self {
Self {
view_id,
updated_rows,
..Default::default()
}
}
pub fn from_move(
view_id: String,
deleted_rows: Vec<i64>,
inserted_rows: Vec<InsertedRowPB>,
) -> Self {
Self {
view_id,
inserted_rows,
deleted_rows,
..Default::default()
}
}
}