unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: David Pirotte <david@altosw.be>
To: Sunjoong Lee <sunjoong@gmail.com>
Cc: guile-user@gnu.org
Subject: Re: crash in guile-sqlite3
Date: Fri, 27 Apr 2012 20:59:53 -0300	[thread overview]
Message-ID: <20120427205953.3d000ac1@rascar> (raw)
In-Reply-To: <CAK93xhq3rFidVtVS23eMsPQZ5rz1cY+t=WSKVobcKtfAoNZCoA@mail.gmail.com>

hello,

> ...
>        (stmt (sqlite-prepare db "INSERT INTO foos(name) VALUES(?);")))

i'd rather bind the statment in scheme _anyway_ if i was you.

david

;; --

(use-modules (sqlite3))

(define db (sqlite-open "ex0.db"))

(define (sqlite/command db command)
  (let ((stmt (sqlite-prepare db command)))
    (sqlite-step stmt)
    (sqlite-finalize stmt)
    (if #f #f)))

(define (my-insert new-name)
  (sqlite/command db (format #f "INSERT INTO foos(name) VALUES('~A')" new-name)))

(sqlite/command db "DROP TABLE IF EXISTS foos;")
(sqlite/command db "CREATE TABLE foos(dbid INTEGER PRIMARY KEY, name TEXT);")

(for-each (lambda (name)
	    (my-insert name))
    '("foo-1" "foo-2" "foo-3"))




  parent reply	other threads:[~2012-04-27 23:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-27  5:40 crash in guile-sqlite3 Sunjoong Lee
2012-04-27 19:00 ` David Pirotte
2012-04-27 20:08   ` Sunjoong Lee
2012-04-27 22:58     ` David Pirotte
2012-04-27 23:59     ` David Pirotte [this message]
2012-04-29  1:58 ` Sunjoong Lee
2012-04-30  9:00   ` Andy Wingo
2012-04-30 10:32     ` Sunjoong Lee
2012-04-30 10:46       ` Andy Wingo
2012-04-30 12:44         ` Sunjoong Lee
2012-05-01 11:45   ` Joonas Sarajärvi
2012-05-01 15:01     ` Joonas Sarajärvi
2012-05-01 15:05       ` Daniel Krueger
2012-05-01 15:10         ` Daniel Krueger
  -- strict thread matches above, loose matches on Subject: below --
2012-05-01 19:37 Sunjoong Lee
2012-05-02  4:41 ` Joonas Sarajärvi
2012-04-26 18:51 Joonas Sarajärvi
2012-04-26 20:24 ` rixed
2012-04-26 21:04   ` Noah Lavine
2012-04-27  6:31     ` rixed

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://www.gnu.org/software/guile/

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

  git send-email \
    --in-reply-to=20120427205953.3d000ac1@rascar \
    --to=david@altosw.be \
    --cc=guile-user@gnu.org \
    --cc=sunjoong@gmail.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).