Skip to content

Thread a database handle through Init - #181

Merged
Calm0 merged 3 commits into
mainfrom
nabil/feat/thread-db-through-init
Sep 29, 2026
Merged

Calm0 merged 3 commits into
mainfrom
nabil/feat/thread-db-through-init

Conversation

@Calm0

@Calm0 Calm0 commented Sep 21, 2026

Copy link
Copy Markdown
Member

Init now takes a *sql.DB and passes it to the plugin entrypoint, so gameplay systems can reach the database directly instead of only through the runtime module. The plugin type assertion is updated to match.

@Calm0
Calm0 requested review from a team and zyro and a lite review from Copilot September 21, 2026 11:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Update the README usage examples for the new required Init argument.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

Updates Init to accept and forward a database handle to the plugin entrypoint.

Changes:

  • Adds *sql.DB to the Init signature.
  • Updates the plugin type assertion and invocation.
  • Documents the API change in the changelog.
File Summary
CHANGELOG.md Documents the updated Init API.
base.go Threads the database handle through Init.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread base.go
Copilot AI review requested due to automatic review settings September 21, 2026 12:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Existing binaries may fail at runtime, and the documented initialization example remains incompatible.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 1 Low severity

Open (2)

Comment thread base.go
@tolgatolgay
tolgatolgay self-requested a review September 28, 2026 13:14
Copilot AI review requested due to automatic review settings September 28, 2026 15:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The documented initialization examples must be updated to match the new API.

Review effort: Lite
Findings: 1 Low severity

Open (1)
Resolved since last review (2)

Comment thread README.md

func InitModule(ctx context.Context, logger runtime.Logger, db *sql.DB, nk runtime.NakamaModule, initializer runtime.Initializer) error {
systems, err := hiro.Init(ctx, logger, nk, initializer, "hiro.bin", "LicenseKey",
systems, err := hiro.Init(ctx, logger, db, nk, initializer, "hiro.bin", "LicenseKey",
@Calm0
Calm0 merged commit f43cbc9 into main Sep 29, 2026
3 checks passed
@Calm0
Calm0 deleted the nabil/feat/thread-db-through-init branch September 29, 2026 09:58
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.

3 participants