@astrojs/db 0.1.20 → 0.1.22

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.
@@ -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.20",
3
+ "version": "0.1.22",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "type": "module",