SQLite Forum

Programmatically getting information about the 'where' clause
Login

Programmatically getting information about the 'where' clause

(1) By anonymous on 2021-07-19 16:59:24 [source]

Is there any API for obtaining information about the constraints in a query?

For example, given

select x from table1 where x > 1 and x < 8

I'd like to know that x is constrained between 1 and 8. I use the authorizer interface to detect that x is being accessed, but I was hoping for some supported way to understand better how it's used.

(2) By Richard Hipp (drh) on 2021-07-19 17:05:33 in reply to 1 [link] [source]

Is there any API for obtaining information about the constraints in a query?

No there is not. Nor do we plan to add one as such an API would put constraints on the implementation and limit future design flexibility. If you want to know the constraints, you'll have to parse the SQL for yourself.

(3) By anonymous on 2021-07-19 17:19:30 in reply to 2 [link] [source]

fair enough, thanks for the quick response and the great tool that sqlite is!