DEV Community

taku25
taku25

Posted on

UnrealDev.nvim Update: Switching to SQLite for Blazing Fast Performance

Just in time for the end of the year, I've released a major update for UnrealDev.nvim!

Previously, UnrealDev.nvim (and its core, UEP.nvim) used JSON files to cache project information. However, for large Unreal Engine projects, the file I/O overhead for reading and writing massive JSON files became a noticeable bottleneck.

To solve this, I have completely migrated the caching backend to SQLite.
This change significantly improves performance, making file navigation and project analysis faster than ever.

πŸ”§ Key Changes & Installation

1. New Dependency: sqlite.lua

With this update, the following plugin is now required:

⚠️ Important Note for Windows Users:
sqlite.lua requires sqlite3.dll to function.
If you install SQLite via package managers like winget, it might only provide the .exe without the necessary .dll.

Solution:

  1. Download the Windows binaries (containing the DLL) directly from the SQLite Download Page.
  2. Configure the path in your init.lua:
-- Example: Set path to sqlite3.dll
vim.g.sqlite_clib_path = "C:\\Users\\username\\path\\to\\sqlite3.dll"
Enter fullscreen mode Exit fullscreen mode

2. Updated :checkhealth

I've updated the health check to verify the SQLite status. If everything is set up correctly, you should see something like this:

UnrealDev:                                                                  βœ…

UnrealDev Dependencies ~
- βœ… OK Executable 'fd': Found (File finder)
- βœ… OK Executable 'rg': Found (Ripgrep text searcher)
- βœ… OK UNL.nvim: Installed (Core Library & Utilities)
- βœ… OK Plugin 'kkharji/sqlite.lua' found.
- βœ… OK Path configured: C:\Users\taku3\AppData\Local\Programs\sqlite\sqlite3.dll
- βœ… OK SQLite is working correctly! (In-memory DB test passed)
...
Enter fullscreen mode Exit fullscreen mode

πŸš€ Command Unification

To streamline the workflow, several specific commands have been deprecated and merged into the main commands.

  • Deprecated: :UEP config_files, :UEP program_files, :UEP config_grep, :UEP program_grep
  • Merged into: :UEP files, :UEP grep

The command arguments have been updated to support a new mode parameter:

:UEP files [scope] [mode] [deps_flag]
:UEP grep  [scope] [mode] [deps_flag]
Enter fullscreen mode Exit fullscreen mode

You can now specify the file type using the mode argument (default is source).

Examples:

" Find Config (.ini) files in Runtime modules
:UEP files runtime config

" Find source files for Programs (Tools) within the Game project
:UEP files game programs

" Find Shader (.usf/.ush) files in the Engine
:UEP files engine shader
Enter fullscreen mode Exit fullscreen mode

This allows for flexible filtering by combining scope and mode.

Note: Commands like :UEP module_files remain separate to keep the argument logic simple for module-specific actions.

Top comments (0)