[sqlite] PRIMARY KEY not enforcing NOT NULL, WITHOUT ROWID default - suggestions

2018-11-23 Thread Digital Dog
Hi! Welcome to the list. I'm reading documentation on the topic: "In an elegant system, all tables would behave as WITHOUT ROWID tables even without the WITHOUT ROWID keyword". then "However, NOT NULL was not enforced on PRIMARY KEY columns by early versions of SQLite due to a bug. By the time th

Re: [sqlite] PRIMARY KEY not enforcing NOT NULL, WITHOUT ROWID default - suggestions

2018-11-24 Thread E.Pasma
Digital Dog wrote: > > PRAGMA default_without_rowid = on > To make all tables created while the directive is in use the WITHOUT ROWID > tables. .. > > PRAGMA enforce_not_null_on_primary_key = on > For WITHOUT ROWID tables it would be a no-op, but for rowid tables it would > restore correct behav

Re: [sqlite] PRIMARY KEY not enforcing NOT NULL, WITHOUT ROWID default - suggestions

2018-11-25 Thread Digital Dog
> From: E.Pasma > Digital Dog wrote: > > > > PRAGMA default_without_rowid = on > > To make all tables created while the directive is in use the WITHOUT ROWID > > tables. > .. > > > > PRAGMA enforce_not_null_on_primary_key = on > > For WITHOUT ROWID tables it would be a no-op, but for rowid table

Re: [sqlite] PRIMARY KEY not enforcing NOT NULL, WITHOUT ROWID default - suggestions

2018-11-25 Thread E.Pasma
> 25 nov. 2018, 20:14 Digital Dog wrote: > > I may have phrased the subject in a wrong way which misguided you. Sorry, I was misguided by my limited experience with PRIMARY KEY's. I use to combine these with WITHOUT ROWID. As you referred to and quoted from the documentation, it is only in th

Re: [sqlite] PRIMARY KEY not enforcing NOT NULL, WITHOUT ROWID default - suggestions

2018-11-26 Thread Richard Hipp
On 11/23/18, Digital Dog wrote: > I think these changes would not add a lot of code to sqlite and will make > life easier for users. SQLite remembers the database schema by storing the original CREATE TABLE text in the sqlite_master table. That means the CREATE TABLE is reparsed whenever a new d

Re: [sqlite] PRIMARY KEY not enforcing NOT NULL, WITHOUT ROWID default - suggestions

2018-11-26 Thread Digital Dog
On Mon, Nov 26, 2018 at 1:19 PM Richard Hipp wrote: > On 11/23/18, Digital Dog wrote: > > I think these changes would not add a lot of code to sqlite and will make > > life easier for users. > > SQLite remembers the database schema by storing the original CREATE > TABLE text in the sqlite_master