Blueprint SQL/ORACLE/MySQL/ODBC Database Communicator v4.25

Blueprint SQL/ORACLE/MySQL/ODBC Database Communicator

Download Unreal Engine Asset – Blueprint SQL/ORACLE/MySQL/ODBC Database Communicator: Plugin that can execute database queries for a dedicated game server

Works on Linux now! | REQUIRES FREE ODBC DRIVERS | Works on all common databases like SQL, MySql, Oracle etc... (You just have to chose the right ODBC driver)

This plugin can execute database queries within blueprints using ODBC. ODBC is a free, old school, stable, reliable, and cross-platform way to talk to a database. Most common database frameworks can use ODBC. SQL, MySql, Oracle, Azure, Amazon etc... can all be queried with this plugin. Blueprint usage is VERY similar to the widely used VaRest plugin. It utilizes UE4's FNonAbandonableTask to execute queries asynchronously without blocking the game thread.

NEVER put a database connection string in something you'll give to a stranger. I put mine in a config file only found on my Linux game servers. This plugin is for dedicated server side logic, or local database logic only.

Technical Details


Execute SQL statements within blueprints
Queries are ran asynchronously in UE4's async thread pool
Depending on query result size, hundreds of queries can execute at once without any noticeable lag on the game thread

Code Modules


How to create and execute a query in blueprints (See Blueprint Screenshot)

Construct a Query UObject
Promote the constructed Query UObject to a variable
Bind the OnQueryFinished event
Add a DatabaseRowModel struct variable. The DatabaseRowModel should contain the array of DatabaseColumnModels which contains the column name and variable type definitions. The StringBufferSize is only needed for string columns
Call ExecuteQueryAsync on the DatabaseQuery object
A DatabaseQueryResult should be returned populated with results
You can GetValueAsString on a result column or cast it to it's variable type column to avoid converting it to a string

Behind the scenes:

ExecuteQueryAsync is called
DatabaseQueryResult UObject is created on the game thread
FNonAbandonableTask is created and begins to run async
Inside of the async thread a connection is created to the SQL database
QueryResultRowStructs are created for each result row and populated by ODBC SQLFetch()
The FNonAbandonableTask returns the populated QueryResultStruct to the game thread and destroys
The game thread converts the QueryResultStruct to the UDatabaseQueryResult created in step 2
The blueprint friendly OnQueryFinished is broadcast with the populated UDatabaseQueryResult

Asset version: 4.25
Download links for «Blueprint SQL/ORACLE/MySQL/ODBC Database Communicator»:
  • Rating:  

  • Add comment
    Users of Guests are not allowed to comment this publication.