AntonTerekhov / OrientDB-PHP

Binary protocol for OrientDB for PHP applications (Beta)
http://code.google.com/p/orient/wiki/NetworkBinaryProtocol
BSD 3-Clause "New" or "Revised" License
108 stars 23 forks source link

Decoding nested things #26

Open fsicre opened 11 years ago

fsicre commented 11 years ago

Hi Anton,

I can propose you this very first version

https://gist.github.com/fsicre/5011655

It handles these kind of documents :

INSERT INTO cluster:default SET a=[1,2,3], b=[{"a":1,"b":2,"c":3},{"d":4,"e":5,"f":6}], c=[[1,2,3],[4,5,6]]

INSERT INTO cluster:default SET a=[1,2,3], b=[{"a":1,"b":2,"c":3},{"d":4,"e":5,"f":6}], c=[[1,2,3],[4,5,6]], d=["a","b","c"]

INSERT INTO cluster:default SET a={"a":1,"b":[2,3,4],"c":{"d":5}}

INSERT INTO cluster:default SET a={"a":1,"b":2,"c":3}, b={"a":[1,2,3],"b":[4,5,6],"c":[7,8,9]}, c={"a":[{"a1":11,"a2":12},{"b1":21,"b2":22}]}

INSERT INTO cluster:default SET a={"a":1,"b":2,"c":3}, b={"a":[1,2,3],"b":[4,5,6],"c":[7,8,9]}, c={"a":[{"a1":11,"a2":12},{"b1":21,"b2":22}],"b":[{"c1":31,"c2":32},{"d1":41,"d2":42}]}

Tell me if this helps.

AntonTerekhov commented 11 years ago

Sure, thanks for update.

But now I'm quite busy, need a few days to get hands on this driver.