Skip to content

fix(db): drop blocking SQLite fallback connect in Connect_DB() - #32

Merged
Rushaway merged 3 commits into
masterfrom
fix/async-db-connection
Aug 27, 2026
Merged

fix(db): drop blocking SQLite fallback connect in Connect_DB()#32
Rushaway merged 3 commits into
masterfrom
fix/async-db-connection

Conversation

@Rushaway

Copy link
Copy Markdown
Member

Summary

  • Connect_DB() fell back to a synchronous SQLite_UseDatabase()/SQL_ConnectCustom() connect whenever no "vip_test" entry existed in databases.cfg, blocking the game thread on every (re)connect in that configuration.
  • SQL_TConnect() already falls back to an implicit local SQLite database for an unrecognized config name, so a single async call now covers both the MySQL and SQLite cases.
  • Bumped plugin version to 1.0.9.

Test plan

  • Compile with the SourceMod 1.11+ compiler.
  • Fresh install with no "vip_test" databases.cfg entry: confirm it falls back to local SQLite without a main-thread stall and CreateTables() still runs.
  • With a "vip_test" MySQL entry: confirm connect + SET NAMES/SET CHARSET still run as before.

🤖 Generated with Claude Code

Connect_DB() fell back to a synchronous SQLite_UseDatabase()
(SQL_ConnectCustom()) connect whenever no "vip_test" entry existed in
databases.cfg, blocking the game thread on every (re)connect in that
configuration. SQL_TConnect() already falls back to an implicit local
SQLite database for an unrecognized config name, so a single async
call now covers both the MySQL and SQLite cases.

Bumped plugin version to 1.0.9.
Copilot AI lite review requested due to automatic review settings August 27, 2026 06:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

SQL_TConnect() is non-blocking, but it's the legacy Handle-based connect
API. Standardize on the newer Database.Connect() methodmap so the connect
path isn't mixing the old SQLTCallback style with the modern Database/
SQLConnectCallback style. Also drops the now-dead data==1/2 branch in
DB_OnConnect() that only existed to distinguish the removed sync fallback
from the async connect.
@Rushaway

Copy link
Copy Markdown
Member Author

Added a follow-up commit: switched Connect_DB()/DB_OnConnect() from the legacy SQL_TConnect() to Database.Connect() to match the modern OO connect API used elsewhere in this batch of fixes.

@Rushaway
Rushaway merged commit 7ff77c2 into master Aug 27, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants