unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>
To: Luis Felipe <luis.felipe.la@protonmail.com>
Cc: help-guix@gnu.org
Subject: Re: guile-dbi from guix not working
Date: Sun,  8 May 2022 12:33:01 +0000	[thread overview]
Message-ID: <1ce2ab7b-621a-4370-d7ec-a109e3f60b92@posteo.de> (raw)
In-Reply-To: <_AP5NFXjo6pCe531Abuzx_BS3f6_SZnaA9BXyJUR5QmUlNUUY2LhaTMaZWVY_ogANHnBxaTSlArTDNXppnaGKbSRmT0ueGa-uoozlHOa2V4=@protonmail.com>

Hello Luis!

On 5/7/22 20:44, Luis Felipe wrote:
> 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)
> ~~~

This is exactly what I have done : )

I looked at the tests and changed the code a little: 
https://notabug.org/ZelphirKaltstahl/guile-examples/commit/a9e635b990f5384ccfb3613003489f47759ca690. 
However, I saw, that there are segfaults reported at 
https://notabug.org/guile-sqlite3/guile-sqlite3/issues/17 and also I realized, 
that on GNU Guix version 0.1.2 is available, while in the repo there is 0.1.3, 
which has trace functions (which I am not sure I will ever need). So I am a bit 
unsure, how solid of an option it really is.

Thanks for the idea nevertheless!

Best regards,
Zelphir

-- 
repositories: https://notabug.org/ZelphirKaltstahl



  reply	other threads:[~2022-05-08 12:33 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
2022-05-08 12:33   ` Zelphir Kaltstahl [this message]
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=1ce2ab7b-621a-4370-d7ec-a109e3f60b92@posteo.de \
    --to=zelphirkaltstahl@posteo.de \
    --cc=help-guix@gnu.org \
    --cc=luis.felipe.la@protonmail.com \
    /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).