> 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
> From: Tim Romano <tim.romano...@gmail.com>
> To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
> 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 <jdm...@kleegroup.
28:16 AM
Subject: Re: [sqlite] Preserving column size
On Tue, Mar 30, 2010 at 4:30 AM, Jean-Denis Muys <jdm...@kleegroup.com>wrote:
>
>
> See http://www.boost.org and more specifically:
> http://www.boost.org/doc/libs/1_42_0/libs/serialization/doc/index.html
>
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
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
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
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
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
> 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
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
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
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
> 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
> 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
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
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
17 matches
Mail list logo