I think this is a good option. Looks like I can save from registering UDFs everytime a connection is created. Thanks!!
---- On Thu, 14 Feb 2019 18:59:09 +0530 Keith Medcalf <kmedc...@dessus.com> wrote ---- > > See also SQLITE_EXTRA_INIT > > > --- > 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- > >boun...@mailinglists.sqlite.org] On Behalf Of Arun - Siara Logics > >(cc) > >Sent: Thursday, 14 February, 2019 06:14 > >To: SQLite mailing list > >Subject: Re: [sqlite] Global UDF using sqlite3_create_function()? > >Importance: High > > > >Thank you!! It works like a charm. Before your reply I added > >FUNCTION macros before sqlite3InsertBuiltinFuncs(). That worked too. > >But I guess using sqlite3_auto_extension() is elegant and I will go > >that way. > > > > > > ---- On Thu, 14 Feb 2019 17:16:01 +0530 Richard Hipp > ><d...@sqlite.org> wrote ---- > > > On 2/14/19, Arun - Siara Logics (cc) <a...@siara.cc> wrote: > > > > > > > > The sqlite3_create_functions require the 'db' parameter to > >define a user > > > > defined function according to the doc: > > > > "The first parameter is the database connection to which the SQL > >function is > > > > to be added. If an application uses more than one database > >connection then > > > > application-defined SQL functions must be added to each database > >connection > > > > separately." > > > > > > > > Is it possible to define a global scalar function so that it > >does not need > > > > to be registered for every function? That way, I can define > >such a function > > > > and ship it with the binary and it can be used with any database > >using the > > > > binary. > > > > > > Use the sqlite3_auto_extension() interface > > > (https://www.sqlite.org/c3ref/auto_extension.html) to cause your > >UDFs > > > to be registered automatically with all new database connections. > > > > > > -- > > > 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 > > > > _______________________________________________ > 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