Re: [sqlite] Check if the new table has been created

2018-06-19 Thread Abroży Nieprzełoży
But that trigger would be executed in a context of a process modifying the database. 2018-06-20 8:24 GMT+02:00, Peter Johnson : > 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 ap

Re: [sqlite] Check if the new table has been created

2018-06-19 Thread Peter Johnson
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 wrote: > On 6/19/18, Igor Korot wrote: > >

Re: [sqlite] Check if the new table has been created

2018-06-19 Thread Igor Korot
Hi, guys, On Tue, Jun 19, 2018 at 4:37 PM, Igor Korot wrote: > Hi, Ryan, > > On Tue, Jun 19, 2018 at 3:22 PM, R Smith wrote: >> >> On 2018/06/19 8:26 PM, Igor Korot wrote: >>> >>> Hi, >>> Is there a C API which checks if the new table has been created? >> >> >> We could break this down into a

Re: [sqlite] Strange Corruption Issue

2018-06-19 Thread poncho524
Simon Slavin-3 wrote > I think you have a hardware problem of some kind. Whether it's main > storage, motherboard, memory or something else I don't know but flipping > one random bit in an octet looks like a hardware problem, not a software > problem. > > Can you try the same software out on anot

Re: [sqlite] Check if the new table has been created

2018-06-19 Thread Igor Korot
Hi, Ryan, On Tue, Jun 19, 2018 at 3:22 PM, R Smith wrote: > > On 2018/06/19 8:26 PM, Igor Korot wrote: >> >> Hi, >> Is there a C API which checks if the new table has been created? > > > We could break this down into a few separate questions: > > 1 - Is there a C API that can return SQL query a

Re: [sqlite] Check if the new table has been created

2018-06-19 Thread R Smith
On 2018/06/19 8:26 PM, Igor Korot wrote: Hi, Is there a C API which checks if the new table has been created? We could break this down into a few separate questions: 1 - Is there a C API that can return SQL query answers? YES there is. 2 - Can I ask this API in SQL if the Schema changed, s

Re: [sqlite] (no subject)

2018-06-19 Thread R Smith
On 2018/06/19 9:55 PM, Stephen Chrzanowski wrote: *sigh* I wish I had this kind of homework back in the day.. Well, I say you could just do the homework of those who do post homework questions here That way it technically IS your homework, and as such, your wish would have come true.

Re: [sqlite] (no subject)

2018-06-19 Thread Stephen Chrzanowski
*sigh* I wish I had this kind of homework back in the day.. On Tue, Jun 19, 2018 at 3:22 PM, Simon Slavin wrote: > On 19 Jun 2018, at 8:15pm, Vicente minguez gabarda > wrote: > > > hello I need a simple example of relationship between table, > > I would like to be able to visualize the rela

Re: [sqlite] (no subject)

2018-06-19 Thread Simon Slavin
On 19 Jun 2018, at 8:15pm, Vicente minguez gabarda wrote: > hello I need a simple example of relationship between table, > I would like to be able to visualize the relationship code between tables > and then reuse it. One day, just for a laugh, we should ac

Re: [sqlite] Check if the new table has been created

2018-06-19 Thread Simon Slavin
On 19 Jun 2018, at 7:56pm, Richard Hipp wrote: > Poll the PRAGMA schema_version value and watch for changes. This is the best way. (I'm hardly likely to argue with DRH, am I ?) However, it's a terrible way to communicate using a database system. If you want two connections to communicate h

[sqlite] I need a simple example of relationship between tables

2018-06-19 Thread Vicente minguez gabarda
hello I need a simple example of relationship between table, I would like to be able to visualize the relationship code between tables and then reuse it. thank you very much ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailing

[sqlite] (no subject)

2018-06-19 Thread Vicente minguez gabarda
hello I need a simple example of relationship between table, I would like to be able to visualize the relationship code between tables and then reuse it. thank you very much ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailing

Re: [sqlite] Check if the new table has been created

2018-06-19 Thread Abroży Nieprzełoży
afaik there is no such api. You need to periodically check if something changed. Run pragma schema_version; to get current schema version. If it changes then run select name from sqlite_master where type='table' and name not like 'sqlite_%'; to get the list of table names and compare this

Re: [sqlite] Check if the new table has been created

2018-06-19 Thread Richard Hipp
On 6/19/18, Igor Korot wrote: > Hi, Wout, > > On Tue, Jun 19, 2018 at 1:31 PM, Wout Mertens > 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 > operation

Re: [sqlite] Check if the new table has been created

2018-06-19 Thread Igor Korot
Hi, Wout, On Tue, Jun 19, 2018 at 1:31 PM, Wout Mertens 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,

Re: [sqlite] Check if the new table has been created

2018-06-19 Thread Wout Mertens
you can query the table with https://www.sqlite.org/pragma.html#pragma_table_info On Tue, Jun 19, 2018, 8:26 PM Igor Korot wrote: > Hi, > Is there a C API which checks if the new table has been created? > > Thank you. > ___ > sqlite-users mailing list

[sqlite] Check if the new table has been created

2018-06-19 Thread Igor Korot
Hi, Is there a C API which checks if the new table has been created? Thank you. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Strange Corruption Issue

2018-06-19 Thread Simon Slavin
On 19 Jun 2018, at 5:44am, Scott Robison wrote: > My first guess would be failing RAM chips. My guess is that, but more vague. I think you have a hardware problem of some kind. Whether it's main storage, motherboard, memory or something else I don't know but flipping one random bit in an o