> > Running the sqlite3 command-line shell via cgi works way better than you > may expect. >
Yay verily, and that is really not doing a great tool justice. I've done a lot of similar things to what Lindsay outlines above both with web and application targets, Often these procedures are set up as proof of concept and in a sort of testing mode. I have found that the so-called test setup actually functioned more reliably and consistently than the application based code we eventually hacked up. Simple, reliable and very, very flexible. Sqlite just does it's thing with a minimum amount of fuss and minimal impact on system resources, can't rave enough. :-) On 3 February 2017 at 18:29, Lindsay Lawrence <thinknl...@gmail.com> wrote: > Running the sqlite3 command-line shell via cgi works way better than you > may expect. > The command-line shell has a small footprint and works well with stdio in > batch mode. > > You can run a shell script that runs an instance of the cli shell and reads > and runs a .sql file. The sql file and bash can be as complex as it needs > to be. You can pass in params on the command-line by inserting env values > into a temp table and then using that table as necessary in subsequent sql. > > For example: > Configure your httpd for cgi then have a cgi script, say "*report.cgi*": > > #!/bin/bash > /path/to/sqlite3 -bail -batch "/path/to/my.s3db" ".read > /path/to/report.sql" > > and in *"/path/to/report.sql*" > > .mode html > .headers on > .print Content-Type: text/html > .print > .print <table> > select * from from report_view; > .print </table> > > For large datasets, or something you just want to import conveniently into > a spreadsheet, or another db, for further munging you could set csv mode > and/or force a download. As a note, unless you are sorting a very large > dataset the resource usage of all of this is quite low as sqlite just pipes > the dataset out over the http response as it is generated. > > /Lindsay > > > On Wed, Feb 1, 2017 at 8:10 AM, Jay Kreibich <j...@kreibi.ch> wrote: > > > I'm looking for an *extremely* simple web tool that will allow me to > > configure a dozen or so stored queries, which people can then select and > > run on an internal server. If the system supports a query variable or > two, > > that would be fantastic, but I don't even need that. Any thoughts? Or > do > > I dust off the PHP tutorials and spend an afternoon throwing something > > together? > > > > -j > > > > > > -- > > Jay A. Kreibich < J A Y @ K R E I B I.C H > > > > > "Intelligence is like underwear: it is important that you have it, but > > showing it to the wrong people has the tendency to make them feel > > uncomfortable." -- Angela Johnson > > _______________________________________________ > > sqlite-users mailing list > > sqlite-users@mailinglists.sqlite.org > > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > > > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > -- Regards, Michael.j.Falconer. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users