Re: [sqlite] sqlite separator command on one insert column

2016-09-26 Thread jungle Boogie
On 26 September 2016 at 13:17, R Smith wrote: > sqlite3.exe dropped.db "INSERT INTO DropDB_log(date, ip_address, status) > VALUES (%DATE%, %%A, '%STATUS%');" YES! During my lunch break, I don't know why it didn't click to make this a loop until I got back and saw your

Re: [sqlite] SQLite 3.15.0 scheduled for 2016-10-14

2016-09-26 Thread Simon Slavin
On 26 Sep 2016, at 10:14pm, Richard Hipp wrote: > The first test failure cause the process to exit with a non-zero return code. Good. Simon. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] SQLite 3.15.0 scheduled for 2016-10-14

2016-09-26 Thread Richard Hipp
On 9/26/16, Simon Slavin wrote: > > On 26 Sep 2016, at 9:42pm, Richard Hipp wrote: > >> Generates output: "testcase-100 ok". Or, it generates an error >> message if the expected result does not appear. > > Does it also change the exit code of the

Re: [sqlite] SQLite 3.15.0 scheduled for 2016-10-14

2016-09-26 Thread Simon Slavin
On 26 Sep 2016, at 9:42pm, Richard Hipp wrote: > Generates output: "testcase-100 ok". Or, it generates an error > message if the expected result does not appear. Does it also change the exit code of the application ? If it does then you can test the output in shell scripts

[sqlite] SQLite3 database slowdown at 1GB

2016-09-26 Thread Domingo Alvarez Duarte
Hello Richard ! I'm trying to create a sqlite3 database with some pubic data (the sqlite3 dump gziped is 9184MB) that took a very long time to build (2 days tested on linux and os x). I was trying to vacuum it to see if I could get better performance but it take too long so I did a ".dump" (2

Re: [sqlite] SQLite 3.15.0 scheduled for 2016-10-14

2016-09-26 Thread Richard Hipp
On 9/26/16, David Raymond wrote: > So the .help on .testcase says: > .testcase NAME Begin redirecting output to 'testcase-out.txt' > > And .check says: > .check GLOBFail if output since .testcase does not match These dot-commands help in writing

Re: [sqlite] sqlite separator command on one insert column

2016-09-26 Thread R Smith
Correction: FOR /F "tokens=1" %%A IN (machinelist.txt) DO ( sqlite3.exe dropped.db "INSERT INTO DropDB_log(date, ip_address, status) VALUES (%DATE%, %%A, '%STATUS%');" ) The file SET must be in parentheses. On 2016/09/26 10:09 PM, R Smith wrote: I can't test this since I don't have your

Re: [sqlite] SQLite 3.15.0 scheduled for 2016-10-14

2016-09-26 Thread David Raymond
So the .help on .testcase says: .testcase NAME Begin redirecting output to 'testcase-out.txt' And .check says: .check GLOBFail if output since .testcase does not match So it's a way to check actual TEXT output vs expected TEXT output, right? Since I'm not sure of the normal

Re: [sqlite] sqlite separator command on one insert column

2016-09-26 Thread R Smith
I can't test this since I don't have your file or DB, but it should put you on the right track. This example assumes only 1 IP address on each line and will ignore any other tokens. FOR /F "tokens=1" %%A IN "machinelist.txt" DO ( sqlite3.exe dropped.db "INSERT INTO DropDB_log(date,

Re: [sqlite] sqlite separator command on one insert column

2016-09-26 Thread Simon Slavin
On 26 Sep 2016, at 8:34pm, jungle Boogie wrote: > I'm attempting to make a windows batch file that reads a text file and > inserts a new record for each entry: Why not replace the INSERT command with a '.import' command to import data from a CSV (or some other

[sqlite] sqlite separator command on one insert column

2016-09-26 Thread jungle Boogie
Hi All, I'm attempting to make a windows batch file that reads a text file and inserts a new record for each entry: sqlite3.exe dropped.db "INSERT INTO `DropDB_log`(`date`,`ip_address`,`status`) VALUES (%DATE%,readfile('machinelist.txt'),'%STATUS%');" Right now, it does this:

Re: [sqlite] SQLite 3.15.0 scheduled for 2016-10-14

2016-09-26 Thread Simon Slavin
> On 26 Sep 2016, at 7:48pm, Warren Young wrote: > >> ​What can I do to beta test? The other part of the question is "How do I download the beta-test version in order to beta-test it ?". For technical reasons, the download page in the /draft/ version of the web site

Re: [sqlite] SQLite 3.15.0 scheduled for 2016-10-14

2016-09-26 Thread Warren Young
On Sep 25, 2016, at 4:50 AM, Cecil Westerhof wrote: > > 2016-09-22 21:04 GMT+02:00 Richard Hipp : > >> Our current schedule for the next SQLite release (3.15.0) is for >> 2016-10-14. >> >> Your beta-tests are appreciated. > > ​What can I do to beta

Re: [sqlite] Ideas for optional json fields?

2016-09-26 Thread Eric Grange
Nice solution and works like a charm, thanks Clemens! On Mon, Sep 26, 2016 at 4:22 PM, Clemens Ladisch wrote: > Eric Grange wrote: > > I am generating a json with json_object() function, and I would like to > > omit the null or default fields from the output json > > SELECT

Re: [sqlite] Ideas for optional json fields?

2016-09-26 Thread Clemens Ladisch
Eric Grange wrote: > I am generating a json with json_object() function, and I would like to > omit the null or default fields from the output json SELECT (SELECT json_group_object(key, value) FROM json_each(json_object('field1', field1, 'field2', field2)) WHERE value IS NOT NULL)

Re: [sqlite] Ideas for optional json fields?

2016-09-26 Thread Eric Grange
Using coalesce on the value produces the field with the JSON, with an empty string (or whatever it was coalesced again). What I really would like to get is {"field1":"value"} rather than {"field1":"value","field2":null} or {"field1":"value","field2":""} I also tried setting the field name to

Re: [sqlite] Ideas for optional json fields?

2016-09-26 Thread R Smith
On 2016/09/26 11:15 AM, Eric Grange wrote: Hi, I am generating a json with json_object() function, and I would like to omit the null or default fields from the output json (for compacity reasons) When there is only one such field, I have used a "case when" like in select case when

[sqlite] Ideas for optional json fields?

2016-09-26 Thread Eric Grange
Hi, I am generating a json with json_object() function, and I would like to omit the null or default fields from the output json (for compacity reasons) When there is only one such field, I have used a "case when" like in select case when field2 is null then json_object('field1',

Re: [sqlite] SQLite IN operator on a Tcl list

2016-09-26 Thread Dominique Devienne
On Sun, Sep 25, 2016 at 8:54 PM, Gerry Snyder wrote: > [...] the compiled statement has to know how many values are being looked > at by IN. > > At least up til now. Perhaps having row values will change this. We > should know soon. Only if you can bind them :) And