153 points · by xiaoyao · 9y ago · 45 comments
Simply, it is an adapter that lets you use SQL syntax to introspect Ethereum blockchain data (blocks, and transactions.) Typically people do this using a JS API built into the node software [1], and it may/may not be ones' cup of tea.
As I've pointed out before, smart contracts need atomic transactions. Either everything commits, or nothing commits. This is a basic property needed for accounting systems.
There's one well-known exception, which is that if your contract sends ETH to another contract, invoking its fallback function, then a throw in the callee just means the call returns false. So in that particular case you have to check the return value and rethrow to make it atomic; this sounds crazy but in some circumstances you don't actually want to throw. The compiler gives you a warning if you don't check.
(insert "should i use a blockchain" infographic, which is amusingly impossible to google image search for, because this question evidently does not often occur to people...)
"get used to blockchain when all you know is SQL" - cool.
"guarantee all us non-trusted nodes have the same SQL database" - ...sure, but for any project such that i want this, i'm pretty sure i don't need a blockchain. (but of course, your project doubtless has uses i haven't thought of)
"i want a trustless SQL database so i'm going to use EVM and solidity and put it on The Blockchain because i'm awesome" - very bad.
"i'm starting a new project, so naturally i need to use a blockchain" - extremely bad.
Presto itself has a JDBC driver, so you could run it + this plugin in a Java app/codebase
Edit: Sorry for the negativity. I created a PR for it. https://github.com/xiaoyao1991/presto-ethereum/pull/8
Nope, still not putting money/time here, sorry.