Buggzie, this has been discussed many times in many other threads.
Some thread years old even has Lua code once used to pull from this forums SMF database for Ulysses donators.
Please search for "SQL" globally from the main forum page, or under the suggestion, developers corner and or releases section.
The typical answer is "a module could be written".
No one ever returns to do it though. I believe ACProdigy had the latest discussion regarding SQL code functions, but never returned or released what had been done.