@astrojs/db 0.7.2 → 0.8.0

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.
@@ -16,8 +16,8 @@ import {
16
16
  import { isSerializedSQL } from "../../runtime/types.js";
17
17
  import { MIGRATION_VERSION } from "../consts.js";
18
18
  import { RENAME_COLUMN_ERROR, RENAME_TABLE_ERROR } from "../errors.js";
19
+ import { columnSchema } from "../schemas.js";
19
20
  import {
20
- columnSchema
21
21
  } from "../types.js";
22
22
  import { getRemoteDatabaseUrl } from "../utils.js";
23
23
  const sqlite = new SQLiteAsyncDialect();
@@ -42,7 +42,6 @@ async function getMigrationQueries({
42
42
  );
43
43
  }
44
44
  for (const [collectionName, collection] of Object.entries(addedCollections)) {
45
- queries.push(getDropTableIfExistsQuery(collectionName));
46
45
  queries.push(getCreateTableQuery(collectionName, collection));
47
46
  queries.push(...getCreateIndexQueries(collectionName, collection));
48
47
  }
@@ -27,7 +27,7 @@ function printHelp({
27
27
  message.push(
28
28
  linebreak(),
29
29
  ` ${bgGreen(black(` ${commandName} `))} ${green(
30
- `v${"0.7.2"}`
30
+ `v${"0.8.0"}`
31
31
  )} ${headline}`
32
32
  );
33
33
  }
@@ -102,8 +102,8 @@ export declare function resolveDbConfig({ root, integrations }: AstroConfig): Pr
102
102
  unique?: boolean | undefined;
103
103
  }> | undefined;
104
104
  foreignKeys?: (Omit<{
105
- columns: import("./types.js").MaybeArray<string>;
106
- references: () => import("./types.js").MaybeArray<Omit<{
105
+ columns: import("./schemas.js").MaybeArray<string>;
106
+ references: () => import("./schemas.js").MaybeArray<Omit<{
107
107
  type: "number";
108
108
  schema: ({
109
109
  name?: string | undefined;
@@ -161,7 +161,7 @@ export declare function resolveDbConfig({ root, integrations }: AstroConfig): Pr
161
161
  });
162
162
  }, "references">>;
163
163
  }, "references"> & {
164
- references: import("./types.js").MaybeArray<Omit<{
164
+ references: import("./schemas.js").MaybeArray<Omit<{
165
165
  type: "number";
166
166
  schema: ({
167
167
  unique: boolean;
@@ -7,7 +7,8 @@ import { CONFIG_FILE_NAMES, VIRTUAL_MODULE_ID } from "./consts.js";
7
7
  import { INTEGRATION_TABLE_CONFLICT_ERROR } from "./errors.js";
8
8
  import { errorMap } from "./integration/error-map.js";
9
9
  import { getConfigVirtualModContents } from "./integration/vite-plugin-db.js";
10
- import { dbConfigSchema } from "./types.js";
10
+ import { dbConfigSchema } from "./schemas.js";
11
+ import {} from "./types.js";
11
12
  import { getDbDirectoryUrl } from "./utils.js";
12
13
  const isDbIntegration = (integration) => "astro:db:setup" in integration.hooks;
13
14
  async function resolveDbConfig({ root, integrations }) {