Richard. As you are probably already aware, I forgot about the encoding
column.  An encoding (UTF8,UTF16,...) column would also needed for the
PRAGMA function_list report to be the key for functions differing only by
the encoding flag:

https://sqlite.org/c3ref/create_function.html

One final issue.  Using the key columns discussed so far, functions
overriding builtin ones would appear in the PRAGMA report but subsequent
builtin overrides and non-builtin overrides can only be reported as the
most recent one.  Perhaps it would be better to have a module name column
instead of the existing builtin boolean column where the reserved module
name, call it 'sqlite', designates builtin entries.

Is {name, module, argcount, aggegate, encoding} a sufficient key to the
function description when special case builtins have the suggested
simulated entry(s)?

Peter








On Sat, Jan 13, 2018 at 12:15 PM, petern <peter.nichvolo...@gmail.com>
wrote:

> Single builtin functions that otherwise would have required two or more
> separate create_function calls should have two or more corresponding
> simulated entries for plain and aggregate flavors distinguishable by column
> values.    max(A) aggregate and max(A,B,...) function could look something
> like this:
>
> name,builtin,aggregate,argcount
> max,1,1,1
> max,1,0,-1
>
> The arg_count column would simply be the nArg supplied (or as simulated)
> to sqlite3_create_function(..,int nArg,..). That is -1 for any number and 0
> to 127 for specific quantity. In case of coalesce(), argcount would have to
> be -1 but the description should say something about the minimum number of
> arguments - case in point about the need for descriptions.
>
> Are there other possibilities which wouldn't have a key?
>
> Peter
>
>
> On Fri, Jan 12, 2018 at 1:09 PM, Richard Hipp <d...@sqlite.org> wrote:
>
>> On 1/12/18, petern <peter.nichvolo...@gmail.com> wrote:
>> > Is adding arg_count and
>> > is_aggregate columns to PRAGMA function_list() on the roadmap?
>>
>> How would that work with functions like coalesce() and max() that take
>> an arbitrary number of arguments, or like max() that is an aggregate
>> with one argument and a scalar with two or more arguments?
>>
>> --
>> D. Richard Hipp
>> d...@sqlite.org
>> _______________________________________________
>> 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

Reply via email to