[squeak-dev] CouchDB was: MySQL question?

Igor Stasenko siguctua at gmail.com
Mon Jan 11 23:52:06 UTC 2010


2010/1/12 Igor Stasenko <siguctua at gmail.com>:
> 2010/1/12 Mike Hales <mike.hales at kscape.com>:
>>>
>>>
>>> Or use better DB - CouchDB ;)
>>>
>> Igor, I noticed your CouchDB library on SqueakSource, but browsing from the
>> web interface it looked like a fork of the JSON libraries and I couldn't
>> quite tell what was going on. What is the status of this? Is it done and is
>> there a tutorial?
>
> I forked the JSON library to not interfere with existing one.
> My main point of displeasure with original, is that JsonObject using a
> collection
> of key/value pairs , held in OrderedCollection,
> while in my implementation a JsonObject is a subclass of Dictionary,
> which makes accessing properties much faster.
>
> Also, an original CouchDB package (http://www.squeaksource.com/CouchDB)
> using a curl plugin for speaking with database.
> While my implementation using a sockets, provided by squeak, which allows me
> to read the data in streaming mode, so i could start parsing a json
> document, even
> if its not fully retrieved yet i.e.:
>
> stream := (db streaming documentAt: '12345') readStream.
> json := Json readFrom: stream.
>
oops, sorry.. given example is wrong.

it is just:

json := db streaming  documentAt: '12345'.

or:

json := db documentAt: '12345'.

the difference between these two, that first will start parsing data
once it available,
while second will wait till all document data will be retrieved.

Currently, there are some subtle bugs in JSON parsing code, like using
#peek: which prevents it from working
with SocketStream. Either SocketStream needs fixing, or JSON parser,
to avoid using it.

>> Mike
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>



-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list