[plt-scheme] plt-scheme data representation/storage in sqlite3?

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Fri Apr 17 12:21:45 EDT 2009

I assume you mean with my sqlite planet package.

Here's how I bind parameters:

                 (cond
                   [(integer? param)
                    (sqlite3_bind_int64 handle i param)]
                   [(number? param)
                    (sqlite3_bind_double handle i param)]
                   [(string? param)
                    (sqlite3_bind_text handle i param)]
                   [(bytes? param)
                    (sqlite3_bind_blob handle i param)]
                   [else
                    (sqlite3_bind_null handle i)])

As you see, Scheme's arbitrary precision numbers are transformed into
sqlite3's doubles. If you need a different encoding, you'll have to
implement it manually.

Jay

On Fri, Apr 17, 2009 at 10:17 AM, Mike Eggleston <mikeegg1 at me.com> wrote:
> Morning,
>
> In my playing I'm getting close to storing data in sqlite3. I am working
> with some exact numbers with very large numerators and denominators. When
> the data is stored in sqlite3, what is the representation? Is the data
> stored as a fraction in a text column or as something else?
>
> (Yes, I realize I could just try that. I just can't at the moment and
> am curious for the answer.)
>
> Mike
> _________________________________________________
>  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.