Re: SQLITE_DETERMINISTIC sticky in sqlite3_create_function?
> On Sep 12, 2017, at 12:23 PM, Nelson, Erik - 2 <[hidden email]> wrote:
>> select user()
> .54 <-- should this result be the same as the previous call to user()? Or would it get evaluated once after each sqlite3_create_function() call?
It gets evaluated whenever the SELECT runs. The value isn't cached anywhere.
The only difference between a deterministic and a regular function currently (AFAIK) is that the former can be used in a CREATE INDEX statement. This allows a query that makes an equivalent call to use the index. TL;DR: it's how you can do efficient queries on derived values like JSON properties.