[Ann] xaLib - library to extract data from an array.
alex at tweedly.net
Wed Apr 18 12:10:38 EDT 2018
No, no SQL database involved.
The array is kept untouched - although you can use the xaCopy function
to make a copy of some subset of the data, in general it's going to be
more efficient (both space and time) to keep the array.
There is no relational anything - it's just intended for wen you are
using a LC array as a key <--> value data store.
You can do sorting by multiple columns, using xaOrderBy (each column is
sorted in (reverse) turn, depending on the fact that LC's sort is
stable). (note it does the key matching as one phase, then sorts those
keys as a second phase).
I expect the searches etc. would be faster with SQL / memory database -
but if you are using the array anyway, this way can be simpler, easier
and it avoids any sync issues if the array is being changed - as well as
allowing you to keep only a single copy in memory.
On 18/04/2018 16:07, Bob Sneidar via use-livecode wrote:
> Thanks Alex. Couple questions:
> Does this convert to an SQL database? If so, are there commands for ordering?
> The advantage to converting to a memory based sqLite database is that there are features unique to SQL, like relational queries and sorting by multiple columns that you cannot get by simply extracting matching keys. The downside *might* be the time it takes to convert, but it's one pass through the array (or arrays), which I assume you are having to do anyway.
> I use a memory database, but of course you wouldn't have to. Any SQL database would work but memory makes it so much faster, so long as the array size is not humongous.
> Bob S
>> On Apr 18, 2018, at 07:00 , Alex Tweedly via use-livecode <use-livecode at lists.runrev.com> wrote:
>> So, I was tempted too :-)
>> But I decide there was no need for the complexity of xquery, and it was better to keep it simple, along the lines of Andre's DBLib, or revIgniter's Database lIbrary.
>> Hence : xaLib - eXtract from an Array Library
>> which can be found (I hope) at github.com/alextweedly/xalib
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode