Giter VIP home page Giter VIP logo

columnar's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

columnar's Issues

Generics trait bound & lifetime bound

#[columnar(ver, ser,de)]
struct Data<T, P>{
     t: T,
    #[columnar(skip)]
     p: P
}

we need add trait bound for T

#[columnar(ser, de)]
struct B<'a> {
    a: &'a str
}

Implement macro in nested case

#[columnar(vec)]
struct Data{
    id: u64
}

#[columnar(vec)]
struct Store{
    #[columnar(type="vec", warp)]
    data: Vec<Data>,
    #[columnar(strategy="DeltaRle")]
    id: u64
}

#[columnar]
struct NestedStrore{
    #[columnar(type="vec")]
    stores: Vec<Store>
}

I think maybe we could still impl nested case without wrap attribute, by always wrapping vec or map.

[LORO-371] The behavior of richtext's `applyDelta()` is not entirely correct

const doc = new Loro();
const text = doc.getText("text");
const doc2 = new Loro();
const text2 = doc2.getText("text");
text.subscribe(doc, (event)=>{
  const e = event.diff as TextDiff;
  text2.applyDelta(e.diff);
});
text.insert(0, "foo");
text.mark({start: 0, end: 3, expand: "none"}, "link", true);
// doc.commit();   // multi delta
text.insert(3, "baz");
doc.commit();
await new Promise((r) => setTimeout(r, 1));
expect(text2.toDelta()).toStrictEqual([ { insert: 'foo', attributes: { link: true } }, { insert: 'baz' } ]);

If uncomment first doc.commit(), the result will be wrong

From SyncLinear.com | LORO-371

Use izip! macro to zip more than two iterator

There is a bug

// when there are more than two iterator
let (a, b,c ) = iter_a.into_iter().zip(iter_b.into_iter()).zip(iter_c.into_iter()).collect();
// it will get  `((a, b), c)`   not  `(a, b, c )` 

let (a, b, c) = izip!(iter_a.into_iter(), iter_b.into_iter(), iter_c.into_iter())

Split VecRow into SerVecRow DeVecRow (MapRow is the same)

Generally, when encoding, we build some intermediate struct that holds value‘s borrow. And we definitely do not decode into this intermediate struct, which means it is inflexible to require the implementation of serialize and deserialize at the same time.

Support enum type as container

#[columnar(ver, map, ser, de)]
struct Data{
    id: 64,
    name: String
}

#[columnar]
enum EnumStore{
     #[columnar(type="vec")]
     Data(Vec<Data>),
     #[columnar(type="map")]
     MapData(HashMap<u64, Data>)
}

Add `#[columnar(borrow)]` support

#[columnar(ser, de)]
struct Data<'a>{
    #[columnar(borrow)]
    a: Cow<'a, str>
}

The number of fields is variable because of supporting forward and backward compatibility, so we could not reuse the borrow attribute from serde directly.

From SyncLinear.com | LORO-287

add #[columnar(no_strategy)] to reduce unnecessary PartialEq

For example

#[columnar(vec, ser, de)]
#[derive(Clone, Serialize, Deserialize)]
struct Data{
    #[columnar(strategy="Rle")]
    id: u64
    #[columnar(no_strategy)]
    other_data:  T: !PartialEq,
}

#[columnar(ser, de)]
struct Store{
    #[columnar(type="vec")]
    data: Vec<Data>,

}

Forward and backward compatible support proposal

Considering cases like:

// old version
struct Data{
    id: u64,
    name: Option<String>
}


// new version
struct Data{
    id: u64,
    // delete name option field
    // add a new option field
    count: Option<u64>
}

cases:

  1. delete option field
  2. add a new option field

Both Table Struct and Row Struct

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.