Re: [sqlite] SQLite Recursive Common Table Expression suggestion

2017-03-09 Thread petern
Yes, but we can live and hope for the day a sqlite project roadmap is disclosed with eponymous vtab API which supports completely dynamic column outputs and a fully featured API for row valued language atoms. When that day comes pivot tables, matrix operations, and other row type introspection

Re: [sqlite] SQLite Recursive Common Table Expression suggestion

2017-03-08 Thread Dominique Devienne
On Wed, Mar 8, 2017 at 3:47 AM, petern wrote: > Things have changed somewhat since I wrote those comments. After the > introduction of row values in 3.15 https://www.sqlite.org/rowvalue.html , > at least, now the sqlite ecosystem can cope with efficient vector

Re: [sqlite] SQLite Recursive Common Table Expression suggestion

2017-03-07 Thread petern
Further to sqlite pivot function, matrix functions, or any other result set meta query language feature, I commented about this before with a concrete suggestion. The core problem is the awkward complexity of building a completely general virtual table (vtab) based eval("") or meta("") which

Re: [sqlite] SQLite Recursive Common Table Expression suggestion

2017-03-07 Thread James K. Lowden
On Tue, 7 Mar 2017 20:26:41 +0100 Clemens Ladisch wrote: > James K. Lowden wrote: > > Clemens Ladisch wrote: > >> Recursive CTEs make SQL Turing complete. > >> > >> But they cannot do everything. > > > > Isn't that a contradiction? > > Being able to

Re: [sqlite] SQLite Recursive Common Table Expression suggestion

2017-03-07 Thread Clemens Ladisch
James K. Lowden wrote: > Clemens Ladisch wrote: >> Recursive CTEs make SQL Turing complete. >> >> But they cannot do everything. > > Isn't that a contradiction? Being able to emulate a Turing machine (or a register machine) means that there exists _some_ representation of the

Re: [sqlite] SQLite Recursive Common Table Expression suggestion

2017-03-07 Thread James K. Lowden
On Tue, 7 Mar 2017 13:30:00 +0100 Clemens Ladisch wrote: > Recursive CTEs make SQL Turing complete. > > But they cannot do everything. Isn't that a contradiction? --jkl ___ sqlite-users mailing list

Re: [sqlite] SQLite Recursive Common Table Expression suggestion

2017-03-07 Thread Brian Curley
Maybe so. Even simpler recursion doesn't get executed, such as a quick poll of the sqlite_master table to trigger a system-wide count(*) of all tables isn't allowed, so it seems that it's held at the gate. Even if I mock up a transaction or a thorough UNION set through a view, I need to output it

Re: [sqlite] SQLite Recursive Common Table Expression suggestion

2017-03-07 Thread Brian Curley
Reached back into the tape storage in my head for this one, but to paraphrase a movie older than me: the future is in pipes. http://souptonuts.sourceforge.net/readme_sqlite_tutorial.html Note that DRH likes to mention that SQLite is meant to replace fopen() more than a full-bore RBDMS, but I

Re: [sqlite] SQLite Recursive Common Table Expression suggestion

2017-03-07 Thread Clemens Ladisch
Brian Curley wrote: > What I wonder though is if CTEs could actually serve as a stand-in for the > lack of Dynamic SQL Recursive CTEs make SQL Turing complete. But they cannot do everything. For example, when you want to do a pivot operation, the number of columns is determined by the data, and

Re: [sqlite] SQLite Recursive Common Table Expression suggestion

2017-03-07 Thread Michael Tiernan
On Mar 7, 2017 6:56 AM, "Brian Curley" wrote: > I have successfully coupled shell scripts and the CLI I'd love to see examples of this sort of use case and I suspect that there's others who would benefit from seeing how others approach solving some of the common problems.

Re: [sqlite] SQLite Recursive Common Table Expression suggestion

2017-03-07 Thread Brian Curley
...besides, one might argue that anyone who can programmatically predict the best route for Minesweeper should actually focus on a tool that predicted the lottery (or even elections... ;) What I wonder though is if CTEs could actually serve as a stand-in for the lack of Dynamic SQL, sort of how

Re: [sqlite] SQLite Recursive Common Table Expression suggestion

2017-03-07 Thread Clemens Ladisch
Simon Slavin wrote: > I’ve seen many amusing examples of using Common Table Expressions to > solve Sudoko puzzles. Has anyone tried using one to suggest the best > next move for Minesweeper ? https://en.wikipedia.org/wiki/Minesweeper_(video_game)#Computational_complexity > have SQLite suggest a

[sqlite] SQLite Recursive Common Table Expression suggestion

2017-03-05 Thread Simon Slavin
I’ve seen many amusing examples of using Common Table Expressions to solve Sudoko puzzles. Has anyone tried using one to suggest the best next move for Minesweeper ? The idea would be to supply a grid with the solution so far in it, and supply the total number of mines, and have SQLite