zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <psprint2@fastmail.com>
To: zsh-workers@zsh.org
Subject: Re: Gdbm module
Date: Wed, 22 Feb 2017 01:10:48 -0800	[thread overview]
Message-ID: <1487754648.2910142.888918792.4BD9197F@webmail.messagingengine.com> (raw)
In-Reply-To: <170221204132.ZM15938@torch.brasslantern.com>

On Tue, Feb 21, 2017, at 08:41 PM, Bart Schaefer wrote: 
> Depends entirely on the licensing Oracle specifies.

It's GNU Affero General Public License. Apparently it's like GPL, but
aimed at resolving issues with server software "distributed" (that's the
point) over network.

Just built it, configure runs fast, compilation is long (2:35) but code
is C.

>     ztie -d db/sqlite -Q "SELECT ..." ... queryresult
> 
> and define queryresult in a manner similar to the way Perl DBI does
> with fetchall_hashref.

Interesting, it assumes single row to be selected in Zsh conditions, as
far I understand. It is towards "tie", close or at conforming ztie.

> This theoretical -Q option could be extended to GDBM as a way to
> filter the set of keys fetched so the hash does not have to load the
> entire dbmfile.  However, at first we might prefer to restrict things
> to flatter single-table access.

If a way of specifying keys would have been developed (in above it's for
filtering keys) it could be also used to stick ~PM_UPTODATE to that
keys. This might somehow translate to SQL. Interesting. Not that I want
to patch my up-to-date solution, it allocates via zalloc() and hashtable
is always in good shape, previous code was doing hcallloc() and
returning internal GDBM string pointers.

> Also note I'm only trying to offer some guidelines here; I've seen no
> evidence that this is needed or more than academically interesting.

I've found use case. Turns out managing plugins via zshrc is rather a
pain. If I want to disable single plugin for a while, then `vim
~/.zshrc`, search, comment – it's much tiring. I will provide TUI
configurator for Zplugin. Each plugin will have .gdbm file. For TUI I
will use my 70% finished Zcurses UI library:

https://asciinema.org/a/aner2l63zm6bhmie3nxy3jkc7

It's based on (z) flag :) Having a text-box will mean "zcurses string
win ${(q)text}", i.e. quoting, but that's shellish.

Bottom line is – it might be possible to map some of Zshrc to gdbm file,
to be able to avoid whole `vim ~/.zshrc`, search, etc. cycle. Provided
that the cycle is really tiring.

So developing DBM modules would be boosted. I would go for writing new
module now, to hold ztie, zuntie, ... and route to db_gdbm, but I'm busy
with the ZUI lib. Maybe there's time before next release. Good that gdbm
is a gem, but Oracle dbm is also very interesting, then there's the
"non-existent" Berkley DB (it's probably installed on FreeBSD, a ghost
software if not available via tarball with configure, I couldn't find
it).

-- 
  Sebastian Gniazdowski
  psprint2@fastmail.com


  reply	other threads:[~2017-02-22  9:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAKc7PVAz=zfrFapifcJudnMqgscNudC5S4S6ym7AWfFFORoROQ@mail.gmail.com>
2017-02-21 17:25 ` Bart Schaefer
2017-02-21 19:52   ` Sebastian Gniazdowski
2017-02-22  4:41     ` Bart Schaefer
2017-02-22  9:10       ` Sebastian Gniazdowski [this message]
2017-02-22 15:44         ` Bart Schaefer
2017-02-23  8:19           ` Sebastian Gniazdowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1487754648.2910142.888918792.4BD9197F@webmail.messagingengine.com \
    --to=psprint2@fastmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).