Reputation: 107
Can I call SQL/MYSQL queries from my transaction function in Hyperledger Composer?
If so, How can I?
If not, should I go with a Rest Api and Consume it from my transaction function? If there is a better way please suggest.
Upvotes: 0
Views: 89
Reputation: 6740
you can use a call-out to the REST endpoint for your SQL query - examples of that are shown here -> https://hyperledger.github.io/composer/latest/integrating/call-out. Also observe the comments on achieving deterministic results below.
the example shows you can return results to your Transaction Processor function. As for your query - if you don't already have REST APIs set up for those, there's plenty of resources out there to help
Upvotes: 1