Blueprint SQL Database Communicator

Average Rating:  
X Rating Failed

Plugin that can execute SQL queries for a dedicated server

  • Supported Target Platforms
  • Supported Engine Versions



This is a plugin to execute SQL statements within blueprints. It utilizes UE4's FNonAbandonableTask to execute queries asynchronously without blocking the game thread.

Tutorial Video

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

  1. Construct a Query UObject
  2. Promote the constructed Query UObject to a variable
  3. Bind the OnQueryFinished event
  4. 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
  5. Call ExecuteQueryAsync on the DatabaseQuery object
  6. A DatabaseQueryResult should be returned populated with results
  7. You can GetValueAsString on a result column or cast it to it's variable type column to avoid converting it to a string

About Me

I was the lead network engineer for a game studio using UE4 for 2 years. I've been a fullstack developer for 7 years. I specialize in SQL, .Net, and making computers talk. I've built websites, email/fax/voice servers, matchmaking servers, torrent systems, and other network heavy logic. This plugin is a step in a racing game that I'm developing and will improve overtime as I need it for my project. I may create a C++ only version for better performance in the future. C++ only would allow avoiding the QueryResultStruct to UDatabaseQueryResult conversion.

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

  •  Core
  •  CoreUObject
  •  Engine

Behind the scenes:

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



Previous Next
  • Edit
  • Preview
  • Help
Login to comment
X Report this Comment
X Attention

X Edit this Comment
  • Edit
  • Preview
  • Help
X Remove this Comment

Are you sure you want to remove this comment?

X Attention