@astrojs/db 0.1.23 → 0.2.1

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.
@@ -157,6 +157,9 @@ async function prepareMigrateQuery({
157
157
  }),
158
158
  body: JSON.stringify(requestBody)
159
159
  });
160
+ if (result.status >= 400) {
161
+ throw new Error(await result.text());
162
+ }
160
163
  return await result.json();
161
164
  }
162
165
  export {
@@ -42,27 +42,12 @@ export type AstroJson<T extends GeneratedConfig<'custom'>> = SQLiteColumn<T & {
42
42
  enumValues: never;
43
43
  baseColumn: never;
44
44
  }>;
45
- export type AstroId<T extends Pick<GeneratedConfig<'string'>, 'tableName'>> = SQLiteColumn<T & {
46
- name: 'id';
47
- hasDefault: true;
48
- notNull: true;
49
- data: string;
50
- dataType: 'custom';
51
- columnType: 'SQLiteCustomColumn';
52
- driverParam: string;
53
- enumValues: never;
54
- baseColumn: never;
55
- }>;
56
45
  export type Column<T extends DBField['type'], S extends GeneratedConfig> = T extends 'boolean' ? AstroBoolean<S> : T extends 'number' ? AstroNumber<S> : T extends 'text' ? AstroText<S> : T extends 'date' ? AstroDate<S> : T extends 'json' ? AstroJson<S> : never;
57
46
  export type Table<TTableName extends string, TFields extends Record<string, Pick<DBField, 'type' | 'default' | 'optional'>>> = SQLiteTableWithColumns<{
58
47
  name: TTableName;
59
48
  schema: undefined;
60
49
  dialect: 'sqlite';
61
50
  columns: {
62
- id: AstroId<{
63
- tableName: TTableName;
64
- }>;
65
- } & {
66
51
  [K in Extract<keyof TFields, string>]: Column<TFields[K]['type'], {
67
52
  tableName: TTableName;
68
53
  name: K;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/db",
3
- "version": "0.1.23",
3
+ "version": "0.2.1",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -64,8 +64,8 @@
64
64
  "mocha": "^10.2.0",
65
65
  "typescript": "^5.2.2",
66
66
  "vite": "^4.4.11",
67
- "astro-scripts": "0.0.14",
68
- "astro": "4.2.4"
67
+ "astro": "4.2.4",
68
+ "astro-scripts": "0.0.14"
69
69
  },
70
70
  "scripts": {
71
71
  "build": "astro-scripts build \"src/**/*.ts\" && tsc",