Re: [sqlite] Please help me fix the SQLite Git mirror

2019-04-23 Thread Richard Hipp
On 4/23/19, Rowan Worth wrote: > > How can you justify the claim that history was unchanged on trunk between > time (1) and time (2)? Short answer: I look at the entire DAG, not individual branches. Long answer: From prior discussion and feedback on this thread, I've come to realize that

Re: [sqlite] Row values with IN

2019-04-23 Thread Charles Leifer
Thanks, makes sense. I think what confused me is that in the doc for row values, it states: Two row values of the same size can be compared using operators <, <=, >, >=, =, <>, IS, IS NOT, IN, NOT IN, BETWEEN, or CASE. The row value doc example shows how to use BETWEEN, for instance: SELECT *

Re: [sqlite] Row values with IN

2019-04-23 Thread Charles Leifer
Thanks Simon -- this is just a minimal example. The WHERE clause is needed because, unless I would provide a CASE WHEN for every single (key, value), then the UPDATE would set the "extra" value of any unmatched key, value to NULL. Please remember this is just an example. I'd like to generalize

Re: [sqlite] Row values with IN

2019-04-23 Thread Charles Leifer
This is a question about SQL language support and the handling of row-values, and I thought my question was quite clear. I appreciate your offers to help, but they do not have anything to do with the question I am asking. As I wrote: My question, though, is why is the VALUES bit needed for the

Re: [sqlite] Row values with IN

2019-04-23 Thread Simon Slavin
On 23 Apr 2019, at 3:42pm, Charles Leifer wrote: > Thanks Simon -- this is just a minimal example. The WHERE clause is needed > because, unless I would provide a CASE WHEN for every single (key, value), > then the UPDATE would set the "extra" value of any unmatched key, value to > NULL. You

[sqlite] Row values with IN

2019-04-23 Thread Charles Leifer
Let's say I have a simple table with a composite primary key (key, value) and an extra field: CREATE TABLE IF NOT EXISTS "bu" ( "key" TEXT NOT NULL, "value" INTEGER NOT NULL, "extra" INTEGER NOT NULL, PRIMARY KEY ("key", "value")); I'll put 3 rows in the table: INSERT INTO "bu" ("key",

Re: [sqlite] Row values with IN

2019-04-23 Thread Simon Slavin
On 23 Apr 2019, at 3:52pm, Charles Leifer wrote: > My question, though, is why is the VALUES bit needed for the WHERE clause in > this case? " If the right operand of an IN or NOT IN operator is a list of values, each of those values must be scalars

Re: [sqlite] Row values with IN

2019-04-23 Thread Simon Slavin
On 23 Apr 2019, at 3:11pm, Charles Leifer wrote: > UPDATE "bu" SET "extra" = CASE ("key", "value") > WHEN ('k1', 1) THEN 100 > WHEN ('k2', 2) THEN -200 > WHEN ('k3', 3) THEN 30 > END > WHERE ("key", "value") IN (('k1', 1), ('k2', 2), ('k3', 3)); Your WHERE clause it not needed, and SQLite is

Re: [sqlite] Row values with IN

2019-04-23 Thread Simon Slavin
On 23 Apr 2019, at 4:14pm, Charles Leifer wrote: > SELECT * FROM info WHERE (year,month,day) IN ((2019, 1, 1), (2019, 2, 1)); > > Perhaps the row-value doc could clarify the behavior of IN with row values? This > ((2019, 1, 1), (2019, 2, 1)) is not a list of scalers, it's a list of lists of

Re: [sqlite] Please help me fix the SQLite Git mirror

2019-04-23 Thread Wout Mertens
On Tue, Apr 23, 2019 at 1:22 PM Richard Hipp wrote: > The inability to see the entire DAG on a single screen in GitHub is a > persistent source of annoyance > to users like me who are accustomed to Fossil. > Note that many git clients (https://git-scm.com/downloads/guis/) do allow you to see

Re: [sqlite] Please help me fix the SQLite Git mirror

2019-04-23 Thread Jens Alfke
> On Apr 23, 2019, at 9:17 AM, Wout Mertens wrote: > > Note that many git clients (https://git-scm.com/downloads/guis/ > ) do allow > you to see the entire DAG, just not GitHub. If you use a Mac, a > particularly great one is https://gitup.co

Re: [sqlite] SQLITE_MAX_MMAP_SIZE 2GB default

2019-04-23 Thread Carl Edquist
Thanks Jens! On Mon, 22 Apr 2019, Jens Alfke wrote: But yeah, I agree with you that it seems odd to have a compiled-in restriction on the maximum memory-map size. I looked a bit into the history, and it appears the just-under-2GB limit was specifically put there (by drh) so that the value

Re: [sqlite] Best way to ALTER COLUMN ADD multiple tables if the columns don't already exist

2019-04-23 Thread Jens Alfke
> On Apr 22, 2019, at 6:37 PM, Tommy Lane wrote: > > How would I go about updating an existing table to also have a > parent integer and child integer column. Use `pragma user_version` to get/set a schema version number in your database. It defaults to zero. Associate each schema

Re: [sqlite] Row values with IN

2019-04-23 Thread Luuk
On 23-4-2019 18:08, Simon Slavin wrote: On 23 Apr 2019, at 4:14pm, Charles Leifer wrote: SELECT * FROM info WHERE (year,month,day) IN ((2019, 1, 1), (2019, 2, 1)); Perhaps the row-value doc could clarify the behavior of IN with row values? This ((2019, 1, 1), (2019, 2, 1)) This works: