unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* guile-dbi from guix not working
@ 2022-05-07 11:26 Zelphir Kaltstahl
  2022-05-07 18:44 ` Luis Felipe
  2022-05-25 19:18 ` Arun Isaac
  0 siblings, 2 replies; 10+ messages in thread
From: Zelphir Kaltstahl @ 2022-05-07 11:26 UTC (permalink / raw)
  To: help-guix

Hi!

I have repeatedly tried to use guile-dbi from Guix at different commits and 
failed. I have the following setup for using guile-dbi:

channels.scm:

~~~~
(list (channel
         (name 'guix)
         (url"https://git.savannah.gnu.org/git/guix.git")
         (branch "master")
         (commit
           "02182c623e0b19f23701d9feaae096e5a1bd5823")
         (introduction
           (make-channel-introduction
             "9edb3f66fd807b096b48283debdcddccfea34bad"
             (openpgp-fingerprint
               "BBB0 2DDF 2CEA F6A8 0D1D  E643 A2A0 6DF2 A33A 54FA")))))
~~~~

manifest.scm:

~~~~
(specifications->manifest
  '("guile@3.0.8"
    "guile-dbi"))
~~~~

guix shell:

~~~~
guix time-machine --channels="channels.scm" -- \
      shell --cores=8 --check --manifest="manifest.scm"
~~~~

guile code "example.scm" (mostly copied from the tutorial at 
https://htmlpreview.github.io/?https://github.com/opencog/guile-dbi/blob/master/website/guile-dbi.html):

~~~~
(import (dbi dbi))

;; Log into the database.
(define db-obj (dbi-open "sqlite3" "database"))
(display db-obj) (newline)

;; Create a table.
(dbi-query db-obj "create table hellotable(id int, name varchar(15))")

;; Look at the return status of the last SQL command
(display db-obj) (newline)

;; Populate the table with values.
(dbi-query db-obj "insert into hellotable ('id', 'name') values('33', 'ola')")
(dbi-query db-obj "insert into hellotable ('id', 'name') values('34', 'dzien dobre')")
(dbi-query db-obj "insert into hellotable ('id', 'name') values('44', 'annyong haseyo')")
(display db-obj) (newline)

;; Display each of the rows of the table, in turn.
(dbi-query db-obj "select * from hellotable")
(display db-obj) (newline)
(write (dbi-get_row db-obj)) (newline)
(write (dbi-get_row db-obj)) (newline)
(write (dbi-get_row db-obj)) (newline)
(write (dbi-get_row db-obj)) (newline)

;; Close the database.
(dbi-close db-obj)
(display db-obj) (newline)
~~~~

result:

~~~~
$ guile example.scm
#<guile-dbi close sqlite3 database (1 . file not found)>
#<guile-dbi close sqlite3 database (1 . invalid module handle)>
#<guile-dbi close sqlite3 database (1 . invalid module handle)>
#<guile-dbi close sqlite3 database (1 . invalid module handle)>
()
()
()
()
#<guile-dbi close sqlite3 database (1 . invalid module handle)>
~~~~

It does not seem to matter, whether I give it an absolute filename for the 
database. Still file not found.

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

Best regards,
Zelphir

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-05-30  6:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).