unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Problems with guile-sqlite3
@ 2011-03-30 22:52 Detlev Zundel
  2011-03-31 10:25 ` Andy Wingo
  0 siblings, 1 reply; 20+ messages in thread
From: Detlev Zundel @ 2011-03-30 22:52 UTC (permalink / raw)
  To: guile-devel

Hi,

having a all new shiny, I wanted to do some random tests with it and
turned to Andys sqlite3 bindings[1].  Compiling and installing worked
like a breeze but I'm having some beginners trouble.

Looking into sqlite3.scm I gather that the following session should
open up a connection to my "mydb" database:

,----
| scheme@(guile-user)> ,use (sqlite3)
| scheme@(guile-user)> (sqlite-open "mydb" SQLITE_OPEN_READONLY)
| ;;; <stdin>:2:0: warning: possibly unbound variable `SQLITE_OPEN_READONLY'
| <unnamed port>:1:0: In procedure #<procedure 9335250 at <current input>:2:0 ()>:
| <unnamed port>:1:0: In procedure module-lookup: Unbound variable: SQLITE_OPEN_READONLY
`----

Hm ok, so the constants seem not to be exported, right?

,----
| scheme@(guile-user)> (define db (sqlite-open "mydb" 1))
| <unnamed port>:0:0: In procedure #<procedure 9bf9690 at <current input>:1:0 ()>:
| <unnamed port>:0:0: Throw to key `sqlite-error' with args `(sqlite-open 14 "Unable to open the database file")'.
`----

But that is strange, I'm sure I have this file.  So lets do an "strace
-e open guile" and see what guile accesses:

,----
| ....
| open("/usr/local/lib/guile/2.0/ccache/language/bytecode/spec.go", O_RDONLY) = 91
| open("/opt/src/git/guile-sqlite3/tests/mydb\315\201", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
| <unnamed port>:0:0: In procedure #<procedure 8ce37d0 at <current input>:1:0 ()>:
| <unnamed port>:0:0: Throw to key `sqlite-error' with args `(sqlite-open 14 "Unable to open the database file")'.
`----

Huh, what are those characters after "mydb"?  Funnily enough, if I use
filenames longer than 4 characters it works.  Can someone hit me with a
clue-stick please?

Thanks
  Detlev

[1] git://gitorious.org/guile-sqlite3/guile-sqlite3.git

-- 
I think that level of generalization is too abstract for useful thinking.
             -- Richard Stallman in <E19N344-0006Q9-Bt@fencepost.gnu.org>




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

end of thread, other threads:[~2011-04-21 21:58 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-30 22:52 Problems with guile-sqlite3 Detlev Zundel
2011-03-31 10:25 ` Andy Wingo
2011-03-31 14:03   ` Detlev Zundel
2011-03-31 16:18     ` Detlev Zundel
2011-04-01  5:33       ` David Pirotte
2011-04-01  9:12         ` Detlev Zundel
2011-04-01 23:05           ` David Pirotte
2011-04-04 16:22             ` Detlev Zundel
2011-04-04 20:50               ` Andy Wingo
2011-04-04 21:28                 ` Detlev Zundel
2011-04-11 15:05                   ` Detlev Zundel
2011-04-20 15:22               ` David Pirotte
2011-04-20 15:51                 ` Detlev Zundel
2011-04-21 12:17                   ` Andy Wingo
2011-04-21 21:58                     ` David Pirotte
2011-04-01 11:34       ` Andy Wingo
2011-04-01 14:33         ` Detlev Zundel
2011-04-01 14:49           ` Andy Wingo
2011-03-31 14:28   ` Ludovic Courtès
2011-03-31 14:54     ` Andy Wingo

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