[TEASER] A noSQL library is coming...

Andre Garzia andre at andregarzia.com
Sat Aug 25 23:39:19 EDT 2012


Andrew,

If it fits in an array, then we can store it.

This library was created for multi-dimensional arrays. You can do:

put "andre" into tA["whatever"]["another level"]["contacts"]["first_name"]

and it would work.

The storage medium is a SQLite database. One SQLite file per storage. You
can have multiple storage open. You can store as many multi-level arrays
you want in one open storage. Each stored array will have a corresponding
key. If you provide a top level key element in your array, then that one is
used. If you don't provide a key element, then one is generated
automatically. Keys are unique. If you try to save an array with a key that
already exists in the database, then that record is replaced.

Its my own very minimalist attempt at document storage. The preliminary API
reference is at http://andregarzia.com/aux/datastorageapi


On Sun, Aug 26, 2012 at 12:25 AM, Andrew Kluthe <andrew at ctech.me> wrote:

> How does this fair against multi-dimensional arrays?
>
> Can I store  "andre" into tA["name"]["first"] and "garzia" into
> tA["name"]["last"] like with embedded documents in MongoDB?
> (http://goo.gl/RMRL8)
>
> How is the data being saved? XML, JSON, some kind of binary format?
>
> Thanks!
>
> Andrew
>
>
> On Sat, Aug 25, 2012 at 9:17 PM, Jerry Jensen <jhj at jhj.com> wrote:
> > I LIKE IT!
> >
> > My needs are modest, and so is my tolerance for having to learn "real"
> SQL syntax when I only want a tiny bit of it. I'll stay tuned!
> >
> > .Jerry
> >
> > On Aug 25, 2012, at 6:59 PM, Andre Garzia wrote:
> >
> >> Hey Folks,
> >>
> >> I am putting the final touches into a NoSQL data storage library for
> local
> >> LiveCode development. It is an add-on for my DB Lib and uses SQLite for
> the
> >> storage medium.
> >>
> >> It can store any kind of information as long as it is inside an array
> >> variable. It doesn't require a schema or a defined set of fields. You
> can
> >> mix and match any kind of array in the same storage file. Let me give
> you
> >> some examples, opening a new storage:
> >>
> >>    dsOpen "myStorage", "com.andregarzia.example"
> >>
> >> Saving an item:
> >>
> >>    put "32" into tA["age"]
> >>    put "andre" into tA["first_name"]
> >>    put "garzia" into tA["last_name"]
> >>    dsSave "myStorage", tA
> >>    if "dsErr" is not in the result then
> >>        put the result into tKeyForLastSavedItem
> >>    end if
> >>
> >> Retrieving an item back:
> >>
> >>    put dsGet("myStorage", tKeyForLastSavedItem) into tA
> >>
> >> This all works without the need to touch a SQL database. This library
> will
> >> enter beta on monday for current owners of DB Lib. You can learn more by
> >> browsing the current API reference for the Data Storage Lib at:
> >>
> >>    http://andregarzia.com/aux/datastorageapi/
> >>
> >> This is a true NoSQL solution for LiveCode and writes your data to safe
> >> folders in any system. You can save an item, save a bunch of items,
> >> retrieve keys, items, and do normal crud operations.
> >>
> >> The Data Storage Lib will be bundled with DB Lib, so all current owners
> of
> >> DB Lib will have it.
> >>
> >> Hope to hear feedback and opinions!
> >>
> >> Cheers
> >> andre
> >>
> >> --
> >> http://www.andregarzia.com -- All We Do Is Code.
> >> http://fon.nu -- minimalist url shortening service.
> >> _______________________________________________
> >> use-livecode mailing list
> >> use-livecode at lists.runrev.com
> >> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> >
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
>
> --
> Regards,
>
> Andrew Kluthe
> andrew at ctech.me
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



-- 
http://www.andregarzia.com -- All We Do Is Code.
http://fon.nu -- minimalist url shortening service.



More information about the use-livecode mailing list