Posted by: Anonymous Coward
on November 12, 2006 08:38 AM
We just need a standard, modular way to add hooks into SQL-Ledger to kick off our push scripts.
Ok, there are two ways to do this, both of which take advantage of PostgreSQL triggers.
The first is that you can add PostgreSQL triggers that don't do anything themselves but just let applications that are listening know that they may need to do something. The example I mentioned earlier uses this mechanism to list a script know that it needs to run a parts-short report and mail it to someone, but really the script could do anything. This is a good way to do things because the processing is asynchronous to the database transactions, so your commit doesn't have to wait for the database transaction in PostgreSQL isn't waiting for the MySQL database transaction to complete.
The second way is using David Fetter's DBI-Link package. This is a set of PL/Perl routines that allow a PostgreSQL database to interact with other datasources as if they were local. WIth this package, you can define your Sugar tables as targets, and then add PostgreSQL triggers to manipulate that database as you need to.
PostgreSQL is an awesome db from the perspective of integration. Right now, its capabilities are the best ones to use for this sort of thing.
Longer-term, I don't know where SQL-Ledger is going. LedgerSMB is likely to be gradually implementing web services (based on RESTful principles) between now and 2.0.
Best Wishes, Chris Travers LedgerSMB core developer Former maintainer of the SQL-Ledger Wiki
More details on integration
Posted by: Anonymous Coward on November 12, 2006 08:38 AMOk, there are two ways to do this, both of which take advantage of PostgreSQL triggers.
The first is that you can add PostgreSQL triggers that don't do anything themselves but just let applications that are listening know that they may need to do something. The example I mentioned earlier uses this mechanism to list a script know that it needs to run a parts-short report and mail it to someone, but really the script could do anything. This is a good way to do things because the processing is asynchronous to the database transactions, so your commit doesn't have to wait for the database transaction in PostgreSQL isn't waiting for the MySQL database transaction to complete.
The second way is using David Fetter's DBI-Link package. This is a set of PL/Perl routines that allow a PostgreSQL database to interact with other datasources as if they were local. WIth this package, you can define your Sugar tables as targets, and then add PostgreSQL triggers to manipulate that database as you need to.
PostgreSQL is an awesome db from the perspective of integration. Right now, its capabilities are the best ones to use for this sort of thing.
Longer-term, I don't know where SQL-Ledger is going. LedgerSMB is likely to be gradually implementing web services (based on RESTful principles) between now and 2.0.
Best Wishes,
Chris Travers
LedgerSMB core developer
Former maintainer of the SQL-Ledger Wiki
#