Excellent!

That format is because the program that gets them is written in Python and the 
"list" format is the native "tuple" output format of Python (for the returned 
row objects).  For example, if in the command line shell you issue this command:

SQLite version 3.21.0 2017-08-21 02:20:57
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> select name as function_name, builtin from pragma_function_list() group 
by name collate nocase, builtin order by name collate nocase asc, builtin desc;
aavg|0
abs|1
acos|0
aggmd2|0
aggmd4|0
aggmd5|0
aggsha1|0
aggsha256|0
aggsha2_256|0

which is the table-valued function version of this:

sqlite> pragma function_list;
group_concat|1
group_concat|1
julianday|1
julianday|1
nullif|1
nullif|1
sqlite_compileoption_get|1
sqlite_compileoption_get|1
current_timestamp|1
current_timestamp|1
sqlite_compileoption_used|1
sqlite_compileoption_used|1



But in Python (with the standard dbapi module) if I execute something like (cn 
is the database connection object):

    for row in cn.cursor().execute('select name as function_name, builtin from 
pragma_function_list() group by name collate nocase, builtin order by name 
collate nocase asc, builtin desc;'):
        print('pragma_function_list() row=', row)

the printed output looks like this:

pragma_function_list() row= (u'aavg', 0)
pragma_function_list() row= (u'abs', 1)
pragma_function_list() row= (u'acos', 0)
pragma_function_list() row= (u'aggmd2', 0)
pragma_function_list() row= (u'aggmd4', 0)
pragma_function_list() row= (u'aggmd5', 0)
pragma_function_list() row= (u'aggsha1', 0)
pragma_function_list() row= (u'aggsha256', 0)
pragma_function_list() row= (u'aggsha2_256', 0)
pragma_function_list() row= (u'aggsha2_384', 0)
pragma_function_list() row= (u'aggsha2_512', 0)
pragma_function_list() row= (u'aggsha384', 0)
pragma_function_list() row= (u'aggsha3_224', 0)


The pragma's are documented on the SQLite3 documentation pages.
https://sqlite.org/pragma.html

pragma function_list;
pragma module_list;
pragma pragma_list;

are new in SQLite3 3.20.0 if you compile the amalgamation with 
SQLITE_INTROSPECTION_PRAGMAS defined.


---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.

>-----Original Message-----
>From: sqlite-users [mailto:sqlite-users-
>[email protected]] On Behalf Of curmudgeon
>Sent: Wednesday, 23 August, 2017 02:55
>To: [email protected]
>Subject: Re: [sqlite] Compiling spellfix for sqlite3
>
>Keith, I finally managed to use carray this morning. The C++ builder
>IDE had
>a facility for entering conditional defines in Project|Options. I had
>noticed this before asking the question on the c++ builder forum but
>hadn't
>realised the -D part of -DSQLITE_EXTRA_INIT=cor_init wasn't required.
>
>Thanks for all your help but would you mind if I haunted you just a
>little
>bit longer to clear something up?
>
>You sent me an email with SampleExts.zip and wrote
>
>When I build my sqlite3.dll (on windows with gcc) I get the following
>functions for every connection:
>
>collation_list row = (0, u'ROT13')
>collation_list row = (1, u'NUMERICS')
>...
>
>pragma_function_list() row= (u'aavg', 0)
>pragma_function_list() row= (u'abs', 1)
>pragma_function_list() row= (u'acos', 0)
>....
>
>I don't recognise the above 'list' notation and could find nothing on
>it
>when googled. Could you point me to any documentation as I would like
>to add
>some functions/collations that would be automatically attached to
>every
>database connection.
>
>
>
>
>Keith Medcalf wrote
>> On Tuesday, 22 August, 2017 09:30, curmudgeon <
>
>> tam118118@
>
>> > wrote:
>>
>>>Your cast did the trick Keith and it compiled fine once I removed
>the
>>>'-DSQLITE_EXTRA_INIT=core_init' line but I have no idea how to get
>>>that directive into the c++ builder application. I've put up a
>question
>>>on the c++ builder forum but unanswered as yet.
>>
>> Yeah, it must be in there somewhere.  Can't help though as I have a
>deadly
>> allergy to IDE's.
>>
>> In a non-GUI you would specify it as a command line option to the
>compiler
>> (actually, to the pre-processor), as in:
>>
>> gcc -DSQLITE_EXTRA_INIT=core_init sqlite3.c
>>
>> ---
>> The fact that there's a Highway to Hell but only a Stairway to
>Heaven says
>> a lot about anticipated traffic volume.
>>
>>
>>
>>
>> _______________________________________________
>> sqlite-users mailing list
>
>> [email protected]
>
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-
>users
>
>
>
>
>
>--
>View this message in context:
>http://sqlite.1065341.n5.nabble.com/Compiling-spellfix-for-sqlite3-
>tp70656p97036.html
>Sent from the SQLite mailing list archive at Nabble.com.
>_______________________________________________
>sqlite-users mailing list
>[email protected]
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to