[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: lmdb as a Lua database
- To: Леонид Юрьев <leo@yuriev.ru>, openldap-technical@openldap.org
- Subject: Re: lmdb as a Lua database
- From: Russell Haley <russ.haley@gmail.com>
- Date: Wed, 4 Oct 2017 13:13:33 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-transfer-encoding; bh=4FVxIYFqeOJ4MOBTsNqzNX/hq+q1CdYdrLqbbzLAB+M=; b=YywRranSipLPXmAvpLiCT+B+uMPZ8f4YJay1oAMGbOpSnkaNjd+whpuYxBgxN6bcGD fRcX3Z3ToNbwSrND6lCNQwoXa4OlMf88F/eqgLCuKJ5m8bAHDqTMarEeY7c6KbJk0O7n daXlcimeqxWM9R249pUbABvyOsRjHUO4ZBE4Ar9o/sYFfDMkZhxbSzuG+I/0zbT6m0of uAovgcOaLK82V0yaK3UnvaYq5c5X9vdURCDA8PJa6BuI1HeMs2V5Nj4Bmc/tTVNXPjq4 Pd4QqOwj7FNME6/ZOTBVKkIBDsthLt6cDXkaEjaBWlaAtTzVFGpws1B1FDcRgqOEgV4P Fohg==
- In-reply-to: <CAO2+NUDxoDG8GmVXmp+5Zr0Pnv1JkEWKTornzxmzS93Cuz9NDA@mail.gmail.com>
- References: <CABx9NuSz+ZL92O-oHX_hxueA00V+GhN8OOCfa-2pRqOQdkLS0Q@mail.gmail.com> <CABx9NuTwBv0PbCsW_THjitoLNrVyKkGn3T2nVqFmM-tqC7d4uA@mail.gmail.com> <CAO2+NUDxoDG8GmVXmp+5Zr0Pnv1JkEWKTornzxmzS93Cuz9NDA@mail.gmail.com>
Brilliant. May I ping you for more information? I'm tightly coupled to
my current toolchain but will use this for reference.
Russ
On Wed, Oct 4, 2017 at 9:21 AM, Леонид Юрьев <leo@yuriev.ru> wrote:
> take a look at https://github.com/PositiveTechnologies/libfpta
>
> regads.
>
>
> 2017-10-04 9:20 GMT+03:00 Russell Haley <russ.haley@gmail.com>:
>> On Tue, Oct 3, 2017 at 11:19 PM, Russell Haley <russ.haley@gmail.com> wrote:
>>> Hi,
>>>
>>> So I'm using LMDB to create a simple 'database' system for lua that
>>> will allow me to directly serialize and store lua table data. So far I
>>> have used the wonderful lmdb wrapper lightningmdb and created a simple
>>> API to hide some of the mechanisms.
>>>
>>> Honestly, your API is so well thought out, I'm doing a disservice by
>>> removing a lot of the powerful features. However, I press ahead and
>>> beg forgiveness. :)
>>>
>>> I have two questions:
>>>
>>> 1) There is a simplified vs cursor API. I am starting to suspect that
>>> the simplified functions are just basic wrappers around the cursor
>>> API? I ask because if this is the case, I could just remove my support
>>> for the simplified API and only have to support one set of functions.
>>>
>>> 2) The key lookup is blazing fast (so awesome, this thing is going to
>>> smoke!). I wanted to create a way of indexing the data elements within
>>> the database by allowing users to create lua functions that parse the
>>> lua table values.
>>> --a basic table that would be serialized into a lmdb database called t1
>>> t1 = {
>>> 1={col_a="test",col_b="item1"},
>>> 2={col_a="not-a-test",col_b="item2"},
>>> 3={col_a="test",col_b="item3"}
>>> }
>>>
>>> --The function that would be called per-row to create an index.
>>> local function(k,v)
>>>
>>> return v.col_a, k
>>> end
>>>
>>> The idea would be to use the dupsort feature to create an 'index'
>>> database with data structured as:
>>>
>>> not-a-test, 2
>>> test, 1
>>> test, 3
>>
>> Sorry, hit send in gmail by accident. Anyway, the idea is to use the
>> dupsort feature to create indexes. Is this feasible? Any input or
>> direction would be fantastic.
>>
>> Thanks!
>> Russ
>>