On 7 Feb 2014, at 09:59, Vairamuthu <muthu.moor...@gmail.com> wrote:

> Thanks for your response, it will be great help if you can get me some
> sample code or algorithms, on that.


I'm assuming you're using SQLite embedded within another application on 
something unix like.

Off the top of my head, here's how I would do it  - there may be an extension 
like this lying around somewhere already?

Create an SQLite3 extension that implements the following functions

sqlnotify_open(<name>, <unix_socket>, <template>)
sqlnotify_close(<name>)
sqlnotify_send(<name>, <arg1>, <arg2>, …)

The open function will connect to the specified socket, the close function will 
obviously close the connection.

When sqlnotify_send is called from your trigger, it will insert its arguments 
into the associated template and then send the resultant string to the socket.

Implement a daemon in your favourite language with a mail() function to send 
the mails. I wouldn't recommend that you send a mail for each notify, maybe 
save them up and send every 5 minutes or so.

PERL/Python are probably good choices for the daemon. As for writing the 
extension, it depends how you're using SQLite, but you're probably going to end 
up in C. I recommend chapter 9 of the book "Using Sqlite"

Thanks,
Kevin


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

Reply via email to