[PR #9268] fix(Sqlite): Removed deprecated exec method and moved Session import to migrateFromGlobal function #13046

Closed
opened 2026-02-16 18:17:55 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/9268

State: closed
Merged: No


What does this PR do?

  1. Removed remaining deprecated sqlite.exec -> sqlite.run

  2. Moved Sessions import to be dynamic when used by the migrateFromGlobal fixes the ReferenceError: Cannot access 'Instance' before initialization. that comes when trying to start the TUI.

  3. Update generate-migrations.ts script to make the import statement to get migrations from the right path "migrations" not "drizzle".

How did you verify your code works?

I was able to properly run the TUI on the branch and the migration ran and local DB created.

The autogenerated migrations file pointed to the right migration sql and the DB was properly migrated.

Screenshot 2026-01-18 at 17 13 39
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/9268 **State:** closed **Merged:** No --- ### What does this PR do? 1. Removed remaining deprecated `sqlite.exec` -> `sqlite.run` 2. Moved `Sessions` import to be dynamic when used by the `migrateFromGlobal` fixes the `ReferenceError: Cannot access 'Instance' before initialization.` that comes when trying to start the TUI. 3. Update `generate-migrations.ts` script to make the import statement to get migrations from the right path "migrations" not "drizzle". ### How did you verify your code works? I was able to properly run the TUI on the branch and the migration ran and local DB created. The autogenerated migrations file pointed to the right migration sql and the DB was properly migrated. <img width="577" height="89" alt="Screenshot 2026-01-18 at 17 13 39" src="https://github.com/user-attachments/assets/14f3b23a-2bd8-4a39-aeba-16bf20537cf8" />
yindo added the pull-request label 2026-02-16 18:17:55 -05:00
yindo closed this issue 2026-02-16 18:17:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13046