Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework

2012-04-24 Thread Marc L. Allen
On Behalf Of Black, Michael (IS) > Sent: Friday, April 20, 2012 6:43 AM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with > entityframework > > I should have said everybody (and I meant the languages and sili

Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework

2012-04-20 Thread Black, Michael (IS)
un...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Nico Williams [n...@cryptonector.com] Sent: Thursday, April 19, 2012 4:47 PM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework On Thu, Apr

Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework

2012-04-19 Thread Marc L. Allen
__ > From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on > behalf of Marc L. Allen [mlal...@outsitenetworks.com] > Sent: Thursday, April 19, 2012 2:56 PM > To: General Discussion of SQLite Database > Subject: EXT :Re: [sqlite] "DEFAULT

Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework

2012-04-19 Thread Nico Williams
On Thu, Apr 19, 2012 at 3:51 PM, Black, Michael (IS) wrote: > You are correct that non-zero will be treated as true. > > That's more an accident then anything else as everybody is checking "!= 0" > for true. No, C treats any non-zero value as true, as in "if (condition) ..." -- that condition wi

Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework

2012-04-19 Thread Black, Michael (IS)
un...@sqlite.org] on behalf of Marc L. Allen [mlal...@outsitenetworks.com] Sent: Thursday, April 19, 2012 2:56 PM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework I was under the impression that, in C, 0

Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework

2012-04-19 Thread Jay A. Kreibich
On Fri, Apr 20, 2012 at 04:41:46AM +1000, John scratched on the wall: > On 19/04/2012 5:14 AM, Jay A. Kreibich wrote: > > The type "BOOLEAN" will pick up a numeric affinity, but I can't see > > that being an issue. Most Boolean values are stored as integer 0 or > > 1 (in fact, SQLite has op

Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework

2012-04-19 Thread Marc L. Allen
ssion of SQLite Database > Subject: Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with > entityframework > > Problem with true=-1. > > > > !false=1 > > > > So !false == true fails which can bite you in the behind > unexpectedly >

Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework

2012-04-19 Thread Marc L. Allen
tabase > Subject: Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with > entityframework > > Problem with true=-1. > > > > !false=1 > > > > So !false == true fails which can bite you in the behind > unexpectedly > > > > true

Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework

2012-04-19 Thread Black, Michael (IS)
Problem with true=-1. !false=1 So !false == true fails which can bite you in the behind unexpectedly true= 1 !true=0 true=-1 !true=0 !false=1 (true= 1 == !false) = 1 (true=-1 == !false) = 0 #include main() { int true1=1; int true2=-1; int false=0;

Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework

2012-04-19 Thread John
On 19/04/2012 5:14 AM, Jay A. Kreibich wrote: On Wed, Apr 18, 2012 at 04:09:21PM +, Black, Michael (IS) scratched on the wall: Good to know... But why would his ADO be giving back NULL? Unless it has bastardized the sqlite interface? That would be my guess. And I guess that means t

Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework

2012-04-18 Thread Jay A. Kreibich
On Wed, Apr 18, 2012 at 04:09:21PM +, Black, Michael (IS) scratched on the wall: > Good to know... > > But why would his ADO be giving back NULL? > > Unless it has bastardized the sqlite interface? That would be my guess. > And I guess that means that if you add a row with a default valu

Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework

2012-04-18 Thread Black, Michael (IS)
reibich [j...@kreibi.ch] Sent: Wednesday, April 18, 2012 10:32 AM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework On Wed, Apr 18, 2012 at 01:20:59PM +, Black, Michael (IS) scratched on the wall: > default v

Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework

2012-04-18 Thread Jay A. Kreibich
On Wed, Apr 18, 2012 at 01:20:59PM +, Black, Michael (IS) scratched on the wall: > default values are during INSERT...not SELECT. > Unless the table has had a column added with ALTER TABLE. In that case, the column doesn't exist in the on-disk record of the row. The SELECT knows it d

Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework

2012-04-18 Thread Black, Michael (IS)
;DEFAULT BOOLEAN NOT NULL" not working with entityframework > > Have you checked your table afterwords to ensure you don't have any nulls in > IsReplaced? > > select count(IsReplaced) from mytable where IsReplaced is null; > > I tested and the alter table does fil

Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework

2012-04-18 Thread Steffen Mangold
> > Have you checked your table afterwords to ensure you don't have any nulls in > IsReplaced? > > select count(IsReplaced) from mytable where IsReplaced is null; > > I tested and the alter table does fill with default values for me. At least > from the sqlite shell. > > Does this work for you?

Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework

2012-04-18 Thread Black, Michael (IS)
.de] Sent: Wednesday, April 18, 2012 7:46 AM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework > > Hi guys, > > i have a little problem with BOOLEAN data column. > > I have an existing table fi