# refactor\(shared\): move the node:sqlite Effect SQL client into shared · PR \#7272 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/7272)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: merged

Source repository: pingdotgg/t3code

Source branch: shared-sqlite-client

Target branch: browser-profiles

Head commit: ae568f8bd04fb8734dc76529f42363c8f544c1bf

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/7272)

[Commits](https://git.cafe/pingdotgg/t3code/pull/7272/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/7272/diffs?format=markdown)

## Description

---

> Stacked on #7254 — review that first; this PR's base is `browser-profiles`.

The desktop app needs to read browser cookie databases and should reach for the same Effect SQL client the server already uses, rather than opening `node:sqlite` by hand. Nothing about the client is server-specific, so it moves to `packages/shared` and both apps import it from there.

Pure move plus import updates — the client itself is unchanged. Split out of #7255 so the cookie-import work reviews on its own.

Model: Claude Opus 5 (1M context), harness: Claude Code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Refactor-only with no client logic changes; risk is limited to missed imports still pointing at the removed server path.
> 
> **Overview**
> Relocates the Effect SQL client built on **`node:sqlite`** from server persistence into **`@t3tools/shared/nodeSqliteClient`** (lowercase module name) so desktop and other packages can reuse the same layer without duplicating SQLite wiring.
> 
> **`packages/shared`** gains a **`./nodeSqliteClient`** export; the implementation and its unit test live under **`packages/shared/src/`**. **`apps/server`** updates every consumer—dev DB and sqlite-state CLIs, migration tests, and the Node runtime loader in **`Sqlite.ts`**—to import from the shared package instead of **`../NodeSqliteClient`**. Behavior of the client is unchanged; this is an import-path and packaging move.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit ae568f8bd04fb8734dc76529f42363c8f544c1bf. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

<!-- Macroscope's pull request summary starts here -->
<!-- Macroscope will only edit the content between these invisible markers, and the markers themselves will not be visible in the GitHub rendered markdown. -->
<!-- If you delete either of the start / end markers from your PR's description, Macroscope will append its summary at the bottom of the description. -->
> [!NOTE]
> ### Move `NodeSqliteClient` into `@t3tools/shared` package
> - Moves `NodeSqliteClient.ts` and its test from `apps/server/src/persistence/` to `packages/shared/src/` (renamed to lowercase `nodeSqliteClient`), and adds a `./nodeSqliteClient` export path in [package.json](https://github.com/pingdotgg/t3code/pull/7272/files#diff-3752b1e4e3e2032593e21e9268ec0379680a59e4e7b8517d0d5492a71530d3e8)
> - Updates all imports across `apps/server` scripts, migration tests, and the `defaultSqliteClientLoaders` loader to use `@t3tools/shared/nodeSqliteClient` instead of relative paths
> - Disables browser profile create/rename/remove and default-profile changes in [IntegrationsSettings.tsx](https://github.com/pingdotgg/t3code/pull/7272/files#diff-8ecfd51e80236f708bcd5b2191dc1d30ac76dd2752851089b78353b9f86878f6) until client settings are hydrated, preventing premature mutations
> - Risk: all consumers must now use the scoped import `@t3tools/shared/nodeSqliteClient`; any remaining references to the old `apps/server/src/persistence/NodeSqliteClient.ts` path will fail to resolve
>
> <!-- Macroscope's review summary starts here -->
>
> <sup><a href="https://app.macroscope.com">Macroscope</a> summarized ae568f8.</sup>
> <!-- Macroscope's review summary ends here -->
>
<!-- Macroscope's pull request summary ends here -->
