Re: [sqlite] Booleans in SQLite

2009-09-07 Thread Rich Shepard
On Mon, 7 Sep 2009, Jim Showalter wrote: > Oracle doesn't have a native boolean type. You have to use INTEGER and > interpret it. > > MySQL doesn't have a boolean type (it's just a synonym for TINYINT). > > SQL Server doesn't have a boolean type. You have to use BIT and > interpret it.

Re: [sqlite] Booleans in SQLite

2009-09-07 Thread Jim Showalter
g" <m...@grubmah.com> To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org> Sent: Monday, September 07, 2009 10:27 AM Subject: Re: [sqlite] Booleans in SQLite > The real argument for adding boolean support is not about space but > about compatibility with

Re: [sqlite] Booleans in SQLite

2009-09-07 Thread Mark Hamburg
The real argument for adding boolean support is not about space but about compatibility with dynamic languages with a boolean type that are exploiting SQLite's dynamic typing of values. Without a boolean type in SQLite, a glue layer has to guess whether a 0 means zero or false or a "NO"

Re: [sqlite] Booleans in SQLite

2009-09-03 Thread Mark Spiegel
D. Richard Hipp wrote: > Most varints are "type varints" and type varints are almost always a > single byte (the only exceptions being for large blobs or strings). > Varints are also used to store the total number of bytes in a row > (also usually one byte). Most varints are a single byte.

Re: [sqlite] Booleans in SQLite

2009-09-03 Thread Mark Spiegel
D. Richard Hipp wrote: > Most varints are "type varints" and type varints are almost always a > single byte (the only exceptions being for large blobs or strings). > Varints are also used to store the total number of bytes in a row > (also usually one byte). Most varints are a single byte.

Re: [sqlite] Booleans in SQLite

2009-09-03 Thread D. Richard Hipp
On Sep 3, 2009, at 8:25 PM, Mark Spiegel wrote: > D. Richard Hipp wrote: >> You are both right and both wrong. There are two different integer >> representations used in SQLite. >> >> (1) "varint" or variable length integer is an encoding of 64-bit >> signed integers into between 1 and 9 bytes.

Re: [sqlite] Booleans in SQLite

2009-09-03 Thread Mark Spiegel
D. Richard Hipp wrote: > You are both right and both wrong. There are two different integer > representations used in SQLite. > > (1) "varint" or variable length integer is an encoding of 64-bit > signed integers into between 1 and 9 bytes. Negative values use the > full 9 bytes as do

Re: [sqlite] Booleans in SQLite

2009-09-03 Thread D. Richard Hipp
On Sep 3, 2009, at 7:25 PM, Mark Spiegel wrote: > Jay A. Kreibich wrote: >> Integer values between -128 and 127 use only a single byte of >> storage above and beyond the header size that all values have. >> > Not quite. Values between 0 & 127 use 1 byte of storage. Negative > values use

Re: [sqlite] Booleans in SQLite

2009-09-03 Thread Mark Spiegel
Jay A. Kreibich wrote: > Integer values between -128 and 127 use only a single byte of storage above > and beyond the header size that all values have. > Not quite. Values between 0 & 127 use 1 byte of storage. Negative values use the full 9 bytes in my experience. (I'm setting aside

Re: [sqlite] Booleans in SQLite

2009-09-03 Thread Jay A. Kreibich
On Thu, Sep 03, 2009 at 03:47:50PM -0400, Wilson, Ronald scratched on the wall: > > You can convert a V1 database into a V4 database by opening it, > > setting the legacy PRAGMA to false, and the VACUUMing the database. > If this is true, the documentation doesn't even hint at the feature: >

Re: [sqlite] Booleans in SQLite

2009-09-03 Thread Wilson, Ronald
> Heh. But, actually, why doesn't SQLite3 produce an error when unknown > pragmas are used? Wouldn't that be the right thing to do? I would > thinks so. I think the docs say unknown pragmas are treated like no-ops. (yeah, I read the docs.) RW Ron Wilson, Engineering Project Lead (o)

Re: [sqlite] Booleans in SQLite

2009-09-03 Thread Nicolas Williams
On Thu, Sep 03, 2009 at 04:21:28PM -0400, Wilson, Ronald wrote: > > Wrong pragma. Try: > > Thanks. I'm going to stop talking for a few days now. Enough gaffs for > one day. Heh. But, actually, why doesn't SQLite3 produce an error when unknown pragmas are used? Wouldn't that be the right

Re: [sqlite] Booleans in SQLite

2009-09-03 Thread Wilson, Ronald
> Wrong pragma. Try: > > sqlite> pragma legacy_file_format; > 1 > sqlite> pragma legacy_file_format=0; > sqlite> pragma legacy_file_format; > 0 > sqlite> Thanks. I'm going to stop talking for a few days now. Enough gaffs for one day. Ron Wilson, Engineering Project Lead (o) 434.455.6453, (m)

Re: [sqlite] Booleans in SQLite

2009-09-03 Thread Nicolas Williams
On Thu, Sep 03, 2009 at 03:57:14PM -0400, Wilson, Ronald wrote: > Hmm. I can't get the pragma to return a value at all. > > SQLite version 3.6.10 > Enter ".help" for instructions > Enter SQL statements terminated with a ";" > sqlite> pragma default_file_format; Wrong pragma. Try: sqlite>

Re: [sqlite] Booleans in SQLite

2009-09-03 Thread Wilson, Ronald
> I would test it, but "When the pragma is issued with no argument, it > returns the setting of the flag. This pragma does not tell which file > format the current database is using. It tells what format will be used > by any newly created databases." Hmm. I can't get the pragma to return a

Re: [sqlite] Booleans in SQLite

2009-09-03 Thread Wilson, Ronald
> You can convert a V1 database into a V4 database by opening it, > setting the legacy PRAGMA to false, and the VACUUMing the database. > You can convert back in a similar way. In fact, be cautious of that. > If you have a build that defaults to V1, make sure you turn the > legacy

Re: [sqlite] Booleans in SQLite

2009-09-03 Thread Dan Bishop
Nicolas Williams wrote: > On Wed, Sep 02, 2009 at 05:44:38PM -0400, Shaun Seckman (Firaxis) wrote: > >> I'm just curious how difficult it would be to add >> support for booleans in SQLite. This would most likely involve adding a >> new type affinity

Re: [sqlite] Booleans in SQLite

2009-09-02 Thread sub sk79
> >                I'm just curious how difficult it would be to add > support for booleans in SQLite. > > as well as use those keywords instead of creating integer > fields using 0 and 1. > Check out StepSqlite PL/SQL compiler for SQLite which supports BOOLEAN data

Re: [sqlite] Booleans in SQLite

2009-09-02 Thread Jay A. Kreibich
On Wed, Sep 02, 2009 at 05:44:38PM -0400, Shaun Seckman (Firaxis) scratched on the wall: > I'm just curious how difficult it would be to add > support for booleans in SQLite. This would most likely involve adding a > new type affinity as well as adding "tr

[sqlite] Booleans in SQLite

2009-09-02 Thread Shaun Seckman (Firaxis)
Hello everyone, I'm just curious how difficult it would be to add support for booleans in SQLite. This would most likely involve adding a new type affinity as well as adding "true" and "false" keywords to the lexer. There's much more that could be done

Re: [sqlite] Booleans in SQLite

2009-09-02 Thread Nicolas Williams
On Wed, Sep 02, 2009 at 05:44:38PM -0400, Shaun Seckman (Firaxis) wrote: > I'm just curious how difficult it would be to add > support for booleans in SQLite. This would most likely involve adding a > new type affinity as well as adding "true" and "false&

Re: [sqlite] Booleans in SQLite

2009-09-02 Thread Pavel Ivanov
9 at 5:44 PM, Shaun Seckman (Firaxis)<shaun.seck...@firaxis.com> wrote: > Hello everyone, > >                I'm just curious how difficult it would be to add > support for booleans in SQLite.  This would most likely involve adding a > new type affinity as well as adding "true&q