help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

guile-dbi from guix not working


From: Zelphir Kaltstahl
Subject: guile-dbi from guix not working
Date: Sat, 7 May 2022 11:26:38 +0000

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]