Skip to content

Commit 1fb48f6

Browse files
committed
fix(starters): update turso createClient import, update turso docs note
1 parent 0ed5803 commit 1fb48f6

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.changeset/serious-pandas-joke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@builder.io/qwik': patch
3+
---
4+
5+
fix: changed turso createClient import to work with file urls, updated docs note with info & link to the corresponding section in the turso docs

packages/docs/src/routes/docs/integrations/turso/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ inside `.env.local`.
9595
PRIVATE_TURSO_DATABASE_URL=file:foo.db
9696
```
9797

98-
> ***Note***: A database token is not needed when working with file databases.
98+
> ***Note***: A database token is not needed when working with file databases and `createClient` must be imported from `@libsql/client` since importing from `@libsql/client/web` [does not support local file URLs](https://docs.turso.tech/sdk/ts/reference#local-development).
9999
100100
## Using a Turso database
101101

starters/features/turso/src/utils/turso.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { RequestEventBase } from "@builder.io/qwik-city";
2-
import { createClient, type Client } from "@libsql/client/web";
2+
import { createClient, type Client } from "@libsql/client";
33

44
export function tursoClient(requestEvent: RequestEventBase): Client {
55
const url = requestEvent.env.get("PRIVATE_TURSO_DATABASE_URL")?.trim();

0 commit comments

Comments
 (0)