Is it possible to create a trigger on sqlite_master which calls a user-defined function AFTER INSERT?
That would avoid having to poll, but it'd still allow the application to be notified when the schema changed. On 19 June 2018 at 20:56, Richard Hipp <[email protected]> wrote: > On 6/19/18, Igor Korot <[email protected]> wrote: > > Hi, Wout, > > > > On Tue, Jun 19, 2018 at 1:31 PM, Wout Mertens <[email protected]> > > wrote: > >> you can query the table with > >> https://www.sqlite.org/pragma.html#pragma_table_info > > > > Let me give you a scenario: > > > > 1. My application connects to the database and performs some > > operations (using C API). > > 2. During the application run, someone started sqlite3, connects to > > the database and creates a > > brand new table. > > 3. My application will need to pick up the newly created table and > continue. > > > > Is it easily possible? > > > > There is a sqlite3_*_hook() family of functions, but it looks like > > they won't help with sqlite_master. > > > > Is there a different way? > > Poll the PRAGMA schema_version value and watch for changes. > -- > D. Richard Hipp > [email protected] > _______________________________________________ > 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

