[plt-scheme] sqlite:finalize statement throws unexpectedly

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Mon Oct 12 17:07:43 EDT 2009

The contract for finalize specifies #2.

Re: #3 --- SQLite's sqlite3_finalize returns a status. I uniformly
turn these status values into exns. My attitude is that the C API
allows you to forget to handle errors but the Scheme API should never
fail without warning.

Jay

On Mon, Oct 12, 2009 at 2:52 PM, David Storrs <david.storrs at gmail.com> wrote:
> (require (prefix-in sqlite: (planet jaymccarthy/sqlite:4:5/sqlite)))
>
> sqlite:finalize function will raise an exception when:
>
> 1) You pass it something that is not a SQLite statement
>
> 2) The statement you pass it is not a sqlite:open-statement?
>
> 3) The statement you pass it IS an open-statement? but it produced a
> constraint violation when you ran it.
>
> #2 and #3 surprised me.  I would have thought that finalize would
> either succeed or be a no-op--since, presumably, you dealt with
> whatever errors came up back where you were running the statement.
>
> Does anyone else find this surprising?
>
> --Dks
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay

"The glory of God is Intelligence" - D&C 93


Posted on the users mailing list.