[plt-scheme] plt-scheme data representation/storage in sqlite3?
On Fri, 17 Apr 2009, Jay McCarthy might have said:
> 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
I'm concerned (mildly) about having the numbers converted from exact
to inexact. Inexact is what I have now with PERL. I'm interested in the
exact numbers and the final results of the programs. So, converting to
doubles probably won't happen. I'll look at doing my own put and get to
text columns.
Thanks for then answer Jay, and yes, I'm using your sqlite package.
Mike