> Sorry I misunderstood your requirement, Kevin. I was focusing on the
>singular "a table" and "the table" in your original post, versus the plural
> "many types of structs". I thought you were looking for serialization
> approach.
> Regards
> Tim Romano
Ah, now I see from where the misunderst
gt; To: General Discussion of SQLite Database
> Sent: Tue, March 30, 2010 7:28:16 AM
> Subject: Re: [sqlite] Preserving column size
>
> On Tue, Mar 30, 2010 at 4:30 AM, Jean-Denis Muys >wrote:
>
> >
> >
> > See http://www.boost.org and more specifically:
> &
mains generic to any given struct, but still assigns
values that are the correct size & type to the chunk of memory.
From: Tim Romano
To: General Discussion of SQLite Database
Sent: Tue, March 30, 2010 7:28:16 AM
Subject: Re: [sqlite] Preserving column size
On
On Tue, Mar 30, 2010 at 4:30 AM, Jean-Denis Muys wrote:
>
>
> See http://www.boost.org and more specifically:
> http://www.boost.org/doc/libs/1_42_0/libs/serialization/doc/index.html
>
>
The OP's question is another form of this question: What's the best way to
violate 1NF in SQLite, so that in
On 3/29/10 23:10 , "Tim Romano" wrote:
> On 3/29/2010 4:19 PM, Kevin M. wrote:
>> I have a C/C++ application in which I want to store data from a struct into a
>> table (using SQLite 3.6.23) and later retrieve data from the table and store
>> it back in the struct. But, I need a general interfac
On 3/29/2010 4:19 PM, Kevin M. wrote:
> I have a C/C++ application in which I want to store data from a struct into a
> table (using SQLite 3.6.23) and later retrieve data from the table and store
> it back in the struct. But, I need a general interface for this as there are
> many types of str
Kevin M. wrote:
> I have a C/C++ application in which I want to store data from a struct into a
> table (using SQLite 3.6.23) and later retrieve data from the table and store
> it back in the struct. But, I need a general interface for this as there are
> many types of structs used. So, what I
On Mon, Mar 29, 2010 at 02:01:42PM -0700, Kevin M. scratched on the wall:
> > Can't you just store the struct as a blob and be done with it?
>
> No, I can't use a blob because there are other queries where I want
> individual columns. Storing to and from a struct is only one part
> of the applica
> I'm confused. Do you, or don't you, want to use type names like INT1 or INT2
> to indicate the width in bytes of an integer field? If you do, you can act on
> them yourself using sqlite3_column_decltype. If you don't, the question
> remains: how do you plan to indicate the width of the field?
On Mon, Mar 29, 2010 at 4:14 PM, Tim Romano wrote:
> On Mon, Mar 29, 2010 at 4:19 PM, Kevin M. wrote:
>
>> I have a C/C++ application in which I want to store data from a struct into
>> a table (using SQLite 3.6.23) and later retrieve data from the table and
>> store it back in the struct. But,
On Mon, Mar 29, 2010 at 4:19 PM, Kevin M. wrote:
> I have a C/C++ application in which I want to store data from a struct into
> a table (using SQLite 3.6.23) and later retrieve data from the table and
> store it back in the struct. But, I need a general interface for this as
> there are many ty
Kevin M. wrote:
>> Why is 99 a 16-bit integer value and not, say, an 8-bit or a 32-bit
>> one? How is SQLite supposed to know?
>
> How would SQLite know if "99" is 16-bit, 8-bit, 32-bit, etc... using
> the CREATE TABLE specified data types as a hint.
INT1, INT2 and so on don't have any special
On Mar 29, 2010, at 4:19 PM, Kevin M. wrote:
>
> However, this method breaks down if a store a 16-bit integer value
> like "99" and SQLite stores it internally as an 8-bit value (to save
> space) and subsequently retrieves it and gives me a value of 1 for
> sqlite3_column_bytes().
I think y
> Can't you just store the struct as a blob and be done with it?
No, I can't use a blob because there are other queries where I want individual
columns. Storing to and from a struct is only one part of the application.
Sorry, perhaps I should have specified that too.
> Why is 99 a 16-bit inte
> So, is there a way I can tell SQLite to preserve the data size in a
> particular column?
As long as you use blobs to store your structs, yes you can tell
SQLite to preserve data size. You cannot do that for any other type,
but it sounds like you don't need any other type because all you need
is
Kevin M. wrote:
> I have a C/C++ application in which I want to store data from a
> struct into a table (using SQLite 3.6.23) and later retrieve data
> from the table and store it back in the struct. But, I need a
> general interface for this as there are many types of structs used.
> So, what I
I have a C/C++ application in which I want to store data from a struct into a
table (using SQLite 3.6.23) and later retrieve data from the table and store it
back in the struct. But, I need a general interface for this as there are many
types of structs used. So, what I have is a function that
17 matches
Mail list logo