http://www.sqlite.org/compile.html


SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION

    When the SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION compile-time option is 
activated, SQLite will suppress "unknown function" errors when running an 
EXPLAIN or EXPLAIN QUERY PLAN. Instead of throwing an error, SQLite will insert 
a substitute no-op function named "unknown()". The substitution of "unknown()" 
in place of unrecognized functions only occurs on EXPLAIN and EXPLAIN QUERY 
PLAN, not on ordinary statements.

    When used in the command-line shell, the SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION 
feature allows SQL text that contains application-defined functions to be 
pasted into the shell for analysis and debugging without having to create and 
load an extension that implements the application-defined functions. 


-----Original Message-----
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
Behalf Of Hick Gunter
Sent: Wednesday, November 29, 2017 5:38 AM
To: 'SQLite mailing list'
Subject: Re: [sqlite] [EXTERNAL] Ignore missing UDFs for command-line EXPLAIN?

You need to duplicate whatever method you use to load your UDFs in your 
application - which in the end boils down to calling sqlite3_create_function() 
with appropriate arguments that cause "glue code" to be executed- into the CLI.

Then make that code available as an extension or a new ".perlfunc" command in 
your copy of the shell code.

We have shell scripts and lua packages that implement virtual tables here.

-----Urspr√ľngliche Nachricht-----
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
Auftrag von no...@null.net
Gesendet: Mittwoch, 29. November 2017 11:10
An: SQLite mailing list <sqlite-users@mailinglists.sqlite.org>
Betreff: Re: [sqlite] [EXTERNAL] Ignore missing UDFs for command-line EXPLAIN?

On Wed Nov 29, 2017 at 09:21:47AM +0000, Hick Gunter wrote:
> What about loading your UDF in the CLI?

Do you mean with a .so/.dll? Most of my UDFs are written in Perl, as is much of 
the rest of my code, and are not standalone compiled objects.

It would be sufficent if there was a way to write stub UDFs that didn't 
actually do anything. For example:

    sqlite> select create_udf_stub('my_udf', 1)
    sqlite> explain select my_udf('arg');   # OK
    sqlite> select my_udf('arg');           # Errors out..

--
Mark Lawrence
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick | Software Engineer | Scientific Games International GmbH | 
Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 
1 80100 - 0

May be privileged. May be confidential. Please delete if not the addressee.
_______________________________________________
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