SQL DB support for Lua
#1
I'm still considering ways to add real SQL DB connectivity to MCServer without affecting the compilation setup burden. In the mini-research I have done, probably the best possible course of action would be to make MCServer depend on ODBC, then use the LuaSQL.ODBC library for the Lua bindings.

Could we pull this one off? There's a few points to consider:
- How easy is it to set up the development environment to have access to ODBC?
- How easy is it to set up LuaSQL.ODBC library to compile into MCS?
- Is ODBC supported on all platforms that MCS can compile on? (I'm looking at you, Android)
- Is ODBC enough to handle all the DB needs that the plugins may have?
- ...?

From what I've seen on my Windows boxes, ODBC support libraries / headers come installed directly with MSVC / Windows SDKs; there's no extra cost here. On *nix there's UnixODBC which should be available on most platforms using a simple pkg-mgr call. I've seen several online versions of FindODBC.cmake file that search for the ODBC libs / headers, so this should be possible pretty easily. Thoughts?
Reply
Thanks given by:
#2
I would say this should be optional/plugin only since our aim is a high performance system and most DBMS's are pretty heavy weight.
Reply
Thanks given by:
#3
Oh yes, it's only for the plugins, but on the other hand, most serious plugins need some form of DB connectivity, so we should provide it out of the box, rather than requiring the installation of third-party garbage like LuaRocks.
Reply
Thanks given by:
#4
Yes they need permanent storage but a full blown DBMS? What plug-ins need more than sqllite provides?
Reply
Thanks given by:
#5
It's not so much about the storage as about the connectivity. If you take a regular MC server, they have a website where they put stuff, they have a shop where you can buy VIP status or in-game items etc. These need to have the same DB backend as the plugins so that they can communicate together.
Reply
Thanks given by:
#6
That makes sense. So ideally we'd want a binding that transparently redirects to sqlite or a DBMS depending on config. However that would be a lot of work so we would just expose the DBMS bindings to the plugins.
Reply
Thanks given by:
#7
Why share a DB why you could REST API?
Reply
Thanks given by:
#8
Once MCS has Lua sockets, REST API is the next natural step forwards. But still a real DB is needed anyway.

This thread has wandered off-topic. What about my original questions? Is there anything I'm missing in the mini-analysis? Anyone have practical experience with multi-platform ODBC development?
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)