Re: [sqlite] extension to run bash

2017-01-13 Thread James K. Lowden
On Thu, 12 Jan 2017 01:54:28 + Roman Fleysher wrote: > From bash script, make list of rows, run commands, load results to > sqlite. Or > > From sqlite, use extension to run commands for each row. > > Both have issues. You will find your shell script faster.

Re: [sqlite] extension to run bash

2017-01-11 Thread Warren Young
On Jan 11, 2017, at 4:01 PM, Jim Callahan wrote: > >> How much doing all that is worth is a different question, since the calls > made through this >> proposed system() SQLite function would also likely be non-portable. In > this very example, >> there is no wc

Re: [sqlite] extension to run bash

2017-01-11 Thread Roman Fleysher
Re: [sqlite] extension to run bash On 1/11/17, Bob Friesenhahn <bfrie...@simple.dallas.tx.us> wrote: > > For anyone thinking that it is a good idea to embed shell > functionality in the SQL interpreter, it makes the SQL interpreter > much less secure for untrusted inputs. Nobody

Re: [sqlite] extension to run bash

2017-01-11 Thread Richard Hipp
On 1/11/17, Bob Friesenhahn wrote: > > For anyone thinking that it is a good idea to embed shell > functionality in the SQL interpreter, it makes the SQL interpreter > much less secure for untrusted inputs. Nobody is suggesting that this become a standard feature of

Re: [sqlite] extension to run bash

2017-01-11 Thread Bob Friesenhahn
On Wed, 11 Jan 2017, Jim Callahan wrote: How much doing all that is worth is a different question, since the calls made through this proposed system() SQLite function would also likely be non-portable. In this very example, there is no wc on Windows. I would suggest renaming the proposed

Re: [sqlite] extension to run bash

2017-01-11 Thread Jim Callahan
> How much doing all that is worth is a different question, since the calls made through this > proposed system() SQLite function would also likely be non-portable. In this very example, > there is no wc on Windows. I would suggest renaming the proposed system() function bash() since now and in

Re: [sqlite] extension to run bash

2017-01-11 Thread Warren Young
On Jan 11, 2017, at 3:11 PM, Richard Hipp wrote: > > On 1/11/17, Scott Hess wrote: >> UPDATE result SET nRows = system('wc', '-l', fileNames); >> >> ... >> [Though, yes, this means you'll have to use fork() and execlp() and >> waitpid() to implement, rather

Re: [sqlite] extension to run bash

2017-01-11 Thread Richard Hipp
linglists.sqlite.org] on >> behalf of Richard Hipp [d...@sqlite.org] >> Sent: Wednesday, January 11, 2017 4:34 PM >> To: SQLite mailing list >> Subject: Re: [sqlite] extension to run bash >> >> On 1/11/17, Roman Fleysher <roman.fleys...@einstein.yu.edu> wr

Re: [sqlite] extension to run bash

2017-01-11 Thread Scott Hess
___ > From: sqlite-users [sqlite-users-boun...@mailinglists.sqlite.org] on behalf > of Richard Hipp [d...@sqlite.org] > Sent: Wednesday, January 11, 2017 4:34 PM > To: SQLite mailing list > Subject: Re: [sqlite] extension to run bash > > On 1/11/17, Roman Fleysher <roma

Re: [sqlite] extension to run bash

2017-01-11 Thread Roman Fleysher
for analysis. Thank you, Roman From: sqlite-users [sqlite-users-boun...@mailinglists.sqlite.org] on behalf of Richard Hipp [d...@sqlite.org] Sent: Wednesday, January 11, 2017 4:44 PM To: SQLite mailing list Subject: Re: [sqlite] extension to run bash

Re: [sqlite] extension to run bash

2017-01-11 Thread Richard Hipp
On 1/11/17, Roman Fleysher wrote: > Yes, Richard, this is exactly what I mean. > Then maybe use the https://www.sqlite.org/src/file/ext/misc/rot13.c extension as a prototype from which to develop yours. -- D. Richard Hipp d...@sqlite.org

Re: [sqlite] extension to run bash

2017-01-11 Thread Roman Fleysher
] extension to run bash On 1/11/17, Roman Fleysher <roman.fleys...@einstein.yu.edu> wrote: > Dear SQLites, > > I am using exclusively sqlite3 shell for all the processing and may need > ability to run bash commands and assign result to a column. For example: > > UPDATE result SET

Re: [sqlite] extension to run bash

2017-01-11 Thread Jim Callahan
> may need ability to run bash commands and assign result to a column. For example: ​> ​ UPDATE result SET nRows =` wc -l fileNames` ; ​Might be easier to run Bash commands in Bash; write the results to a file​ and then redirect the file into SQLite. See for example, this Nabble thread.

Re: [sqlite] extension to run bash

2017-01-11 Thread Richard Hipp
On 1/11/17, Roman Fleysher wrote: > Dear SQLites, > > I am using exclusively sqlite3 shell for all the processing and may need > ability to run bash commands and assign result to a column. For example: > > UPDATE result SET nRows =` wc -l fileNames` ; > > Here I