Skip to content

UE5 database connectors and virtual file map plugin. (ODBC, OLEDB, LevelDB, LMDB, SQLite, PostgreSQL, Mongo, Redis)

License

Notifications You must be signed in to change notification settings

Frozen-Projects/FF_DB_Connectors

Repository files navigation

FF DB Connectors (Frozen Forest)

A Database Connector plugin for Unreal Engine 5 Windows Platform, providing support for MongoDB, ODBC, OLEDB (SQL Server), PostgreSQL, and Virtual File Mapping at runtime.

Features

MongoDB

A wrapper around the mongocxx driver allowing for standard CRUD operations.

  • Create Connection: Establishes a connection to the MongoDB server.
  • Create Connection String: Helper to format the connection URL.
  • Get All Collections: Retrieves a list of all collections in the database.
  • Get All Data: Retrieves all documents from a specific collection.
  • Get Data (Filtered): Retrieves specific documents based on filter criteria.
  • Create Collection: Creates a new collection with options.
  • Insert Data: Inserts JSON data into a collection.
  • Update Data: Updates existing documents based on filters.
  • Replace Data: Replaces an entire document based on filters.

ODBC (Open Database Connectivity)

Standard SQL connectivity for generic database drivers.

  • Create Connection: Connects to a database using an ODBC driver.
  • Create Connection String: Helper to build the ODBC connection string.
  • Disconnect: Closes the current connection.
  • Execute Query: Runs a SQL query against the database.
  • Learn Columns: Retrieves column metadata (names/types) even if the table is empty.
  • Result Handling:
    • Get Column Info (Names, Types).
    • Get Column Data by Index.
    • Get Column Data by Name.
    • Get Row Data by Index.

OLEDB (SQL Server)

Supports high-performance connectivity, specifically optimized for MS SQL Server, with multi-threading support.

  • Create Connection: Establishes a connection via OLEDB provider.
  • Create Connection String: Helper to build the connection string (supports MSOLEDBSQL).
  • Disconnect: Closes the connection.
  • Execute Query: Runs a query asynchronously with AsyncTask (It is good for occasionally execution)
  • Threaded Operations:
    • Start Thread: Initializes a background worker thread specifically for OLEDB.
    • Add Query To Pool: Queues a query to be executed asynchronously on assigned thread. (It is good for high frequency / continues executions)
  • Result Handling: Includes utilities to fetch Columns and Rows similar to the ODBC module.

PostgreSQL

A dedicated connector for PostgreSQL using libpqxx with built-in threading support.

  • Create Connection: Establishes a threaded connection to a PostgreSQL server.
  • Create Connection String: Helper to format the Postgres connection string (supports SSL modes).
  • Add Query To Pool: Queues a SQL query for asynchronous execution.
  • Result Handling:
    • Get Column Info.
    • Get Column Data by Index or Name.
    • Get Row Data by Index.

Virtual File Map (VFM)

A subsystem for handling memory-mapped files, allowing data sharing via system memory.

  • Add File: Maps a file/buffer into memory with custom headers.
  • Remove File: Unmaps and removes the file from memory.
  • Find Other Files: Searches for existing memory-mapped files.
  • Get Files: Retrieves a map of currently managed virtual files.

Generic Tools

Helper functions available globally.

  • SQL To DateTime: Converts SQL standard datetime strings into Unreal FDateTime structs.

Virtual File System (Windows Only)

You have a file or buffer and you want to share them with other processes/apps on same computer with memory address pointing (CreateFileMappingW) and without actual file I/O. But other processes should have correct reading functions.

RoadMap

Connectors that we are certain to integrate.

  • LMDB
  • LevelDB
  • SQLite
  • Redis

Connectors that we are investigate.

  • DuckDB