From: Tim Cross <theophilusx@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: Adding emacsql to NonGNU ELPA?
Date: Mon, 03 Jan 2022 23:54:24 +1100 [thread overview]
Message-ID: <877dbhrmst.fsf@gmail.com> (raw)
In-Reply-To: <87ilv13v3y.fsf@gnus.org>
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Stefan Kangas <stefan@marxist.se> writes:
>
>> Any objections to adding emacsql to NonGNU ELPA?
>>
>> https://github.com/skeeto/emacsql
>
> Sure, seems like a good idea to me.
>
> ---
> (emacsql db [:select [name id]
> :from people
> :where (> salary 62000)])
> ---
>
> We should probably add something like this to Emacs core, though. I
> mean the DSL for writing SQL without strings. I'm not sure this is
> exactly the language we should go for, though, but it generally looks
> sound.
My only concern is the treatment of 1:1 mapping between elisp nil and
sql null. I'm not sure this is a good idea. In database terms, null is
different from nil (or false). In database terms, null essentially means
'unknown' - it isn't false, it isn't true, it is unknown. Most databases
also have a boolean value - perhaps for elisp, false would be a better
mapping for nil than null?
Regardless, I do agree a good DSL for writing SQL which is not simply a
concatenation of strings would be good.
Another approach which I think works well is the HugSQL model where SQL
is parsed into functions. I quite like this approach as it allows you to
write native SQL and then use the HugSQL library to create functions you
can then just call from your Clojure code. Something similar would
probably work well for elisp as well. One reason I like it is that all
other 'high level' mapping of language to SQL or ORM tool has always
imposed too many limits. Many of them work well with very simple basic
data models, but don't scale well once things become more complex. When
using HugSQL, I did not run into this limitation (or at least, ran into
it much later and less frequently :-). At some point, SQL remains the
best way to write database queries in a RDMS).
next prev parent reply other threads:[~2022-01-03 12:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-02 16:16 Adding emacsql to NonGNU ELPA? Stefan Kangas
2022-01-02 17:09 ` Teemu Likonen
2022-01-03 11:40 ` Lars Ingebrigtsen
2022-01-03 12:54 ` Tim Cross [this message]
2022-01-03 16:00 ` [External] : " Drew Adams
2022-01-27 4:19 ` Tim Landscheidt
2022-01-27 6:03 ` Stefan Monnier
2022-01-27 14:54 ` Tim Landscheidt
2022-01-27 15:52 ` Stefan Monnier
2022-01-27 22:56 ` Tomas Hlavaty
[not found] ` <87bkzwyek6.fsf@logand.com>
[not found] ` <87h79obnuy.fsf@vagabond.tim-landscheidt.de>
2022-01-28 19:12 ` Tomas Hlavaty
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877dbhrmst.fsf@gmail.com \
--to=theophilusx@gmail.com \
--cc=emacs-devel@gnu.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.savannah.gnu.org/cgit/emacs.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).