@astrojs/db 0.1.19 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -53,7 +53,7 @@ function astroDBIntegration() {
53
53
  await writeFile(dbUrl, "");
54
54
  const db = await createLocalDatabaseClient({
55
55
  collections,
56
- dbUrl: dbUrl.href,
56
+ dbUrl: dbUrl.toString(),
57
57
  seeding: true
58
58
  });
59
59
  await setupDbTables({
@@ -5,12 +5,14 @@ import { drizzle as drizzleProxy } from "drizzle-orm/sqlite-proxy";
5
5
  import {} from "drizzle-orm/sqlite-core";
6
6
  import { z } from "zod";
7
7
  import { getTableName } from "drizzle-orm";
8
+ const isWebContainer = !!process.versions?.webcontainer;
8
9
  async function createLocalDatabaseClient({
9
10
  collections,
10
11
  dbUrl,
11
12
  seeding
12
13
  }) {
13
- const client = createClient({ url: dbUrl });
14
+ const url = isWebContainer ? "file:content.db" : dbUrl;
15
+ const client = createClient({ url });
14
16
  const db = drizzleLibsql(client);
15
17
  if (seeding)
16
18
  return db;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/db",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "type": "module",