unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Luis Felipe <luis.felipe.la@protonmail.com>
To: Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>
Cc: help-guix@gnu.org
Subject: Re: guile-dbi from guix not working
Date: Sat, 07 May 2022 18:44:09 +0000	[thread overview]
Message-ID: <_AP5NFXjo6pCe531Abuzx_BS3f6_SZnaA9BXyJUR5QmUlNUUY2LhaTMaZWVY_ogANHnBxaTSlArTDNXppnaGKbSRmT0ueGa-uoozlHOa2V4=@protonmail.com> (raw)
In-Reply-To: <e2901347-4839-c9ad-4bfa-443d369ea16e@posteo.de>


[-- Attachment #1.1: Type: text/plain, Size: 1391 bytes --]

Hi Zelphir,

On Saturday, May 7th, 2022 at 11:26 AM, Zelphir Kaltstahl <zelphirkaltstahl@posteo.de> wrote:

> Is it really broken, or am I doing something wrong?

For what it's worth, it fails in the same way for me too. Trying to open a connection results in a handle with "file not found" status.

If you just need to work with SQLite databases, I tried guile-sqlite3 and it worked (connecting, inserting records, etc). It is not documented, but the tests help discover how to use some things (https://notabug.org/guile-sqlite3/guile-sqlite3.git).

For example, I don't know what I'm doing, but this works:

~~~
(import (sqlite3))

;; Log into the database.
(define db (sqlite-open "database.sqlite3"))

;; Create a table.
(sqlite-exec db "create table hellotable(id int, name varchar(15))")

;; Populate the table with values.
(sqlite-exec db "insert into hellotable ('id', 'name') values('33', 'ola')")
(sqlite-exec db "insert into hellotable ('id', 'name') values('34', 'dzien dobre')")
(sqlite-exec db "insert into hellotable ('id', 'name') values('44', 'annyong haseyo')")

;; Display each of the rows of the table, in turn.
(let* [(stmt (sqlite-prepare db "select * from hellotable"))
       (result (sqlite-map identity stmt))]

  (for-each
   (lambda (row) (begin (display row) (newline)))
   result))

;; Close connection.
(sqlite-close db)
~~~

[-- Attachment #1.2: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc --]
[-- Type: application/pgp-keys, Size: 1815 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 509 bytes --]

  reply	other threads:[~2022-05-07 18:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-07 11:26 guile-dbi from guix not working Zelphir Kaltstahl
2022-05-07 18:44 ` Luis Felipe [this message]
2022-05-08 12:33   ` Zelphir Kaltstahl
2022-05-25 19:18 ` Arun Isaac
2022-05-28 16:37   ` Zelphir Kaltstahl
2022-05-29  7:57     ` Arun Isaac
2022-05-29  8:58       ` non-input dependencies Was: " raingloom
2022-05-29 14:42         ` Zelphir Kaltstahl
2022-05-29 15:23           ` raingloom
2022-05-30  6:31             ` Arun Isaac

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://guix.gnu.org/

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

  git send-email \
    --in-reply-to='_AP5NFXjo6pCe531Abuzx_BS3f6_SZnaA9BXyJUR5QmUlNUUY2LhaTMaZWVY_ogANHnBxaTSlArTDNXppnaGKbSRmT0ueGa-uoozlHOa2V4=@protonmail.com' \
    --to=luis.felipe.la@protonmail.com \
    --cc=help-guix@gnu.org \
    --cc=zelphirkaltstahl@posteo.de \
    /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.
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).