On Fri, Mar 24, 2017 at 4:03 PM, Richard Hipp <d...@sqlite.org> wrote:

> On 3/24/17, James K. Lowden <jklow...@schemamania.org> wrote:
> >
> > We know SQLite parses SQL to produce byte-code for its virtual
> > machine.  And we know that's an abstract syntax tree.  And we know
> > trees can be represented as tables.  Therefore we know the AST could be
> > returned as tables.  That was my suggestion.
> >
>
> The AST used by SQLite changes.  Frequently.  If we provide an
> interface that returns the AST as a (virtual) table, that would make
> the AST an interface, and prevent us from enhancing it in the future,
> for new features or performance improvements.
>

But short of the full AST, there are things which are "immutable",
like dependencies between "objects". Simply listing dependencies
on views, tables, virtual tables, and functions from a SQL expression
(and thus by extension a view or table SQL) would go a long way in
meeting many uses cases, include the one that started this thread.

Abusing the authorizer callback for that isn't ideal, doesn't report
function dependencies (I think), doesn't allow to temporarily replace
the authorizer and restore it afterwards, etc...

Oracle has the *_dependencies dictionary views for example.
And that's a very stable interface. My $0.02. --DD
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to