From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tim Cross Newsgroups: gmane.emacs.devel Subject: Re: Adding emacsql to NonGNU ELPA? Date: Mon, 03 Jan 2022 23:54:24 +1100 Message-ID: <877dbhrmst.fsf@gmail.com> References: <87ilv13v3y.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35569"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.7.5; emacs 28.0.90 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 03 14:07:58 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n4N4A-00092N-3q for ged-emacs-devel@m.gmane-mx.org; Mon, 03 Jan 2022 14:07:58 +0100 Original-Received: from localhost ([::1]:43198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n4N48-0000R3-UY for ged-emacs-devel@m.gmane-mx.org; Mon, 03 Jan 2022 08:07:56 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46392) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4N2p-00083M-I9 for emacs-devel@gnu.org; Mon, 03 Jan 2022 08:06:35 -0500 Original-Received: from [2607:f8b0:4864:20::629] (port=45909 helo=mail-pl1-x629.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n4N2l-0001II-Nt for emacs-devel@gnu.org; Mon, 03 Jan 2022 08:06:35 -0500 Original-Received: by mail-pl1-x629.google.com with SMTP id w24so24815415ply.12 for ; Mon, 03 Jan 2022 05:06:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=C5boZlHajmAnTS/BG0ZNm1GWtiNz+LUdP5vRQzmi7e8=; b=Y9rrq2Snl5dj84gx/SdO1DfwegFXHZYeVncXm4Vl3SJZKuEbcCfEqjIIl49vcHHO2E JpvBBTfYLEvxRXnu3IEjIkQ8AdR4XRigiecybKBAeUbJTku0UjpjtJpzpsk2TAIopuPm kds/3NXB1dC0ZRayRuIsOeoUy3z4u21h8NOiOWZeDmHj2xGLjfn6DUQcd3GzgKYWsXkf v5rEYCzbG0Qn2m+CHMFy993hRq1ReZ9DFSXSdkkRUAj4gb+RJgrdd/cv1zDWgEKkH0/y S6jWig19cy5jc0sHUpvqLalWaXXnQh339kpyR6PWRPj1OsfPX90fJgspmD6YaYAngcIS D1NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=C5boZlHajmAnTS/BG0ZNm1GWtiNz+LUdP5vRQzmi7e8=; b=lb05s4MUYYxyZOhSsdpLybgsMBUla3q7ZASTSVa6oYgQM5MiJ1w7HWQ6GFpFsf59Wx gWJCVKP1wbjQ0gc8IEtkIngwLmQniALgYoGCSNHjuM9ZVGqlkXVdN14QrXH8UUvzn2jH y1KjWs1qPbiYFrTilnIXztgOHIicvIkvf5Ml+WjCr4BnTkVgurXkD4tEWigY2v1Hhkhc Ytw/gPMw0OJLvTxdhF+Iy+DgjcTVnZZQEXfsCQMJ1I7iMcbP7FfXt+69t5IIGBFP7fLw W1yV9L/mkeXjJkhj1eavxnPW8HauLdM9UVfqL8/gCpxuyl4LvYeEYO9vEhlNH2z982Bd Sgvw== X-Gm-Message-State: AOAM533TfynExNK3pzK1CBBIFlRIJ5RKWs/yf/dbQR7KQ3jjX3rVuEWz K+gETXZ9RlJj90hA20A3i32r+R27xEQ= X-Google-Smtp-Source: ABdhPJxOnzd3ymwLkfsjh7vI0j25bIsvIp5L8Z6lAdK+6lM/YPUnKd47ldKdEEqERe6iSxi93NB+ew== X-Received: by 2002:a17:90a:590a:: with SMTP id k10mr55432990pji.16.1641215189660; Mon, 03 Jan 2022 05:06:29 -0800 (PST) Original-Received: from dingbat ([124.149.107.194]) by smtp.gmail.com with ESMTPSA id u15sm40632342pfk.186.2022.01.03.05.06.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jan 2022 05:06:29 -0800 (PST) In-reply-to: <87ilv13v3y.fsf@gnus.org> X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::629 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=theophilusx@gmail.com; helo=mail-pl1-x629.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:284042 Archived-At: Lars Ingebrigtsen writes: > Stefan Kangas 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).