SQLite is more for database files in my experience, rather than connections to an actual database… although, that wouldn’t be so bad to have either.
I wouldnt allow specifying user/password/dbname in blueprints itself; This should be done in a more general config in the plugin then. Also, you wont get a new connection each time you need one, but from a connection pool, so the first node would be something like “GetDBConnection” with no params.
Also, the mockup is nice but for tables with 10+ columns it simply wont work; I would see more an array of a custom struct with “Column Name” / “Column Value” properties as input.
I really have to think about it more
Cheers,
SQLite is actually a database, though it just uses something like direct-write-to-file, which restricts SQLite for being used in Multithreaded Environments (each write operation on the sqlite db locks the whole db as opposed to row/table locking in other dbs, as its a filesystem lock).
Didnt know about that module, gotta have a look at that too
That is exactly what I was thinking, is this something you’re currently making, SaviorNT ?
I think you’re trying to reinvent Model concept which is present in a lot of web frameworks (part of MVC pattern).
Na, that was just a mock-up of some functions I put together
Ah, and the DB Connector I actually had plugged into a Begin Play event, so it’s actually not being called every time. I’m thinking, for security purposes, that the mockup would be a good “front-end” for c++ to php, which then executed the sql queries. Dunno, I have neither the programming experience nor the time to learn c++ to do this
Uhh… I had to google that
I guess this comment was more directed at me?
If so, i dont try to reinvent any model concept (and theres really no MVC with a database ), but i try to recreate the ORM concept.
If it was not directed at me, just ignore this comment
Cheers,
Doesn’t *MySQL *require source code release for free of your software if you use the community version? Or have that changed.
If that’s the case, pretty sure that’s the reason nobody has built a plugin, releasing a game source code while the game is still in market is a no go for almost every game devs and they would have to buy a commercial sql license to avoid trouble. Maybe that’s why Epic is using SQLite instead…
Without knowing what it takes to implement a new type of blueprints, my intuition is they lend themselves well to a** monadic **query API where you build up a query through multiple steps:
Table->Join(Table)->Where(…)->GroupBy(…)->Select(…)->ToArray()
If you understand the concept of monads, and how to properly implement them in an API, you know how to create an API that allows for intuitive chaining and usually a reduction in complexity.
The first time I saw a UE4 tutorial, the first thing I thought was: wow, a graphical interface for a fluent API.
All of the are for database files, but they just database managment systems (DBMS) which uses diffrent interfaces to control. SQLite takes commands direcly from APIs and MySQL (as well as many others) functions as a server and takes commands from network, and there those which don’t use SQL queries at all (people call them NoSQL). There also interfaces that makes multiple interface to work under one interface (most common example is ODBC)
Thats is if you use GPL licenced client libraries that comes with MySQL (you need comertial licence in order to redestribute client library in commertial product… that is if you use that client library at all), things is MySQL is controlled by network protocol and there nothing that prevents you to communicate with MySQL server with any software, you got GPL HTTP servers yet it does not make your browser magicly go open source isn’t? ;] Ofcorse making your own client is harder then using ready made MySQL client
The licensing model behind database drivers is often misunderstood Once people see GPL they freak out lol. If you use it like described, you’ll be completely fine. Besides, if you’re gonna use mysql for your games db backend, you REALLY should look at MariaDB. You won’t even look back at MySql ever again lol.
As for the plugin idea, yes please x 2! I HATE wrapping connectors from native code, its a royal pain in the *** and would love a plugin that has it all done nicely for me. Would definitely pay for that sweet goodness.
In response to CriErr: Those claims are just plain ridiculous. Just consider Blueprints as another form of managed code in a sense. I can assure you db access in managed code such as c# is blazing fast. Blueprints will surely tack on a bit more over-head but not enough to be of concern. The real tricky part would be a nice blueprint api, but even just parameterized query support for the blueprint-supported integrals, string types and blobs would be fine for a solid start.
You build it, I’ll buy it! lol
People freak out because they want to use the Connector for C++ (cause they know, UE4 is C++ so they think they have to use it) and then run around like chicken. Thank god the MariaDB C++ Connector is LGPL and compatible with MySQL
Regarding the plugin, i started to develop this as a fun project and am thinking about extending it and put it on the marketplace. Though, a possible downside could be that i developed it as an ODBC interface (this way it doesnt matter which database you plug in at the backend and i dont have to care about Connection Pooling, etc).
If people are still interested into it despite the fact that its ODBC, some of the features that are already working:
- Plain SQL Query Execution (Select/Update/Insert)
- Queries return the result as an Array of Array of custom structs (Array of Rows -> Array of Columns -> Custom Struct that contains the value and column name)
- Query that automatically fills an UObject that is given to the Blueprint Function; It checks if the name of a property matches the name of a result column and fills it then (works also with Vector, Vector2D, Rotator)
Planned Features:
- Persist a given UObject into a table (matching property names with column names), automatically deciding if insert or update is neccessary
- Prepared Statements through Blueprints
- MAYBE some kind of building sql statements through blueprint nodes (if you know i.e. hibernate query language you know what i mean)
Would you guys be interested in that?
Cheers,
Since I am only now studying DB programming, I have no idea what your explanation means.
However, if your plugin makes connecting a multiplayer game to a database to maintain and update things like player names, inventories, high scores, etc, in a painless way, then by all means proceed!
I see, i guess the main issue with such a plugin would be to have the expectations low enough
I think instead of stuff like prepared statements i would then rather do stuff like:
- Automatically create database tables from a given UObject
- load a UObject from the database
- persist a UObject into the database
This may get a bit tricky with child objects, i am not really sure if that would be feasible. Also, automatically altering the table structure if the object is changed (i.e. if you add a new property) would not be implemented. If you want to seriously use a database backend you should usually create the database tables by hand and set primary keys, indices etc. so it will perform well even with much data in it.
I think i will finish the “persist UObject” thing and then make a WIP thread in the marketplace section to get what people are actually thinking about this
Cheers,
Hi guys,
I really Support the idea of the thread starter because it’s almost impossible to imagine any kind of game nowadays, that does not rely on some online stat functionality in whatever way.
Please dont get me wrong; I’m really happy that there are Plugin developers out there who are willing to solve this problem by coding custom solutions. But I’m always feeling very uncertain when i’m using plugins for my projects because there’s a simple problem related to plugins: The developers often stop updating their plugins after a certain amount of time and you won’t be able to use it in future UE4 releases.
So for that reason I really hope that Epic will Include a nativedb functionality in Blueprint themselves someday.
Best regards,
Daniel
Yes and yes for 10 characters
I know gamers are very focused on their agenda, but think about this: a basic database connector aligns this stellar engine with the databases of any industry. Most advanced (i.e. senior) engineers know the constraints of “slow” when it comes to moving data in/out of a platform… I, for example, do industrial engineering, and would like to see Unreal → Microsoft SQL Server, so I can use it for things such as HMI (Human Machine Interface), but NOT necessarily for process control (such as moving a laboratory instrument). That said, I think there is a place for slow-moving data interfaces in this engine, and I would like to use photorealism, and my “moderately functional” multimedia skills in making my industrial interfaces a bit more interesting. I hope someone will finally realize that such a connector (Low Entry, hint hint) would make a great opportunity. Let’s do this, people!
Why would you want to manage the DB structure from within UE?
Because you may need or want your application/game to have things such as an online API, may want to secure your application data (store the data in an online DB rather than on the client’s computer), allow multiple installs across platforms that are able to communicate between each other, or even use LocalDB to store information. Basically, an in-engine DB interface to “real” database solutions is much cleaner and much, much easier to deal with than existing data tables.
In that case I would have an API for my DB server. It would scale better and be easier to maintain, than having to update each UE client.