@astrojs/db 0.3.5 → 0.4.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.
- package/dist/core/cli/commands/link/index.js +7 -3
- package/dist/core/cli/commands/push/index.js +3 -3
- package/dist/core/cli/migration-queries.d.ts +4 -4
- package/dist/core/cli/migration-queries.js +73 -73
- package/dist/core/cli/migrations.js +15 -7
- package/dist/core/errors.js +7 -3
- package/dist/core/integration/file-url.js +2 -1
- package/dist/core/integration/index.js +106 -57
- package/dist/core/integration/typegen.d.ts +3 -3
- package/dist/core/integration/typegen.js +8 -8
- package/dist/core/integration/vite-plugin-db.d.ts +14 -9
- package/dist/core/integration/vite-plugin-db.js +15 -12
- package/dist/core/integration/vite-plugin-inject-env-ts.d.ts +4 -2
- package/dist/core/integration/vite-plugin-inject-env-ts.js +8 -4
- package/dist/core/queries.d.ts +12 -12
- package/dist/core/queries.js +49 -46
- package/dist/core/types.d.ts +232 -231
- package/dist/core/types.js +56 -55
- package/dist/core/utils.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/runtime/db-client.d.ts +9 -4
- package/dist/runtime/db-client.js +11 -7
- package/dist/runtime/index.d.ts +7 -7
- package/dist/runtime/index.js +27 -29
- package/dist/runtime/types.d.ts +7 -7
- package/package.json +3 -5
- package/components/Renderer.astro +0 -14
- package/components/astro-env.d.ts +0 -1
- package/components/index.ts +0 -2
- package/components/tsconfig.json +0 -7
- package/dist/cli/commands/push/index.d.ts +0 -6
- package/dist/cli/commands/shell/index.d.ts +0 -6
- package/dist/cli/commands/sync/index.d.ts +0 -6
- package/dist/cli/commands/verify/index.d.ts +0 -6
- package/dist/cli/index.d.ts +0 -6
- package/dist/cli/queries.d.ts +0 -18
- package/dist/cli/seed.d.ts +0 -6
- package/dist/cli/sync/admin.d.ts +0 -33
- package/dist/cli/sync/index.d.ts +0 -1
- package/dist/cli/sync/migrate.d.ts +0 -1
- package/dist/cli/sync/queries.d.ts +0 -19
- package/dist/cli/sync/remote-db.d.ts +0 -1
- package/dist/config.d.ts +0 -1374
- package/dist/consts.d.ts +0 -7
- package/dist/core/cli/commands/sync/index.d.ts +0 -6
- package/dist/error-map.d.ts +0 -6
- package/dist/errors.d.ts +0 -3
- package/dist/file-url-integration.d.ts +0 -2
- package/dist/integration.d.ts +0 -2
- package/dist/internal-drizzle.d.ts +0 -1
- package/dist/internal.d.ts +0 -47
- package/dist/load-astro-config.d.ts +0 -6
- package/dist/migrations.d.ts +0 -12
- package/dist/root.d.ts +0 -3
- package/dist/typegen.d.ts +0 -5
- package/dist/types.d.ts +0 -1604
- package/dist/utils-runtime.d.ts +0 -1
- package/dist/utils.d.ts +0 -59
- package/dist/vite-plugin-db.d.ts +0 -19
- package/dist/vite-plugin-inject-env-ts.d.ts +0 -9
package/dist/consts.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const PACKAGE_NAME: any;
|
|
2
|
-
export declare const INTERNAL_MOD_IMPORT: string;
|
|
3
|
-
export declare const DRIZZLE_MOD_IMPORT: string;
|
|
4
|
-
export declare const DB_TYPES_FILE = "db-types.d.ts";
|
|
5
|
-
export declare const VIRTUAL_MODULE_ID = "astro:db";
|
|
6
|
-
export declare const DB_PATH = ".astro/content.db";
|
|
7
|
-
export declare function getLocalDbUrl(root: URL): URL;
|
package/dist/error-map.d.ts
DELETED
package/dist/errors.d.ts
DELETED
package/dist/integration.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { sql, eq, gt, gte, lt, lte, ne, isNull, isNotNull, inArray, notInArray, exists, notExists, between, notBetween, like, notIlike, not, asc, desc, and, or, } from 'drizzle-orm';
|
package/dist/internal.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { SqliteRemoteDatabase } from 'drizzle-orm/sqlite-proxy';
|
|
2
|
-
import { type BooleanColumn, type DBCollection, type DBCollections, type DBColumn, type DateColumn, type ColumnType, type JsonColumn, type NumberColumn, type TextColumn } from './types.js';
|
|
3
|
-
import { type SQL, type ColumnDataType } from 'drizzle-orm';
|
|
4
|
-
import type { AstroIntegrationLogger } from 'astro';
|
|
5
|
-
import type { DBUserConfig } from './config.js';
|
|
6
|
-
export type SqliteDB = SqliteRemoteDatabase;
|
|
7
|
-
export type { Table } from './types.js';
|
|
8
|
-
export { createRemoteDatabaseClient } from './utils-runtime.js';
|
|
9
|
-
export declare function hasPrimaryKey(column: DBColumn): boolean;
|
|
10
|
-
export declare function createLocalDatabaseClient({ collections, dbUrl, seeding, }: {
|
|
11
|
-
dbUrl: string;
|
|
12
|
-
collections: DBCollections;
|
|
13
|
-
seeding: boolean;
|
|
14
|
-
}): Promise<import("drizzle-orm/libsql").LibSQLDatabase<Record<string, never>>>;
|
|
15
|
-
export declare function setupDbTables({ db, data, collections, logger, mode, }: {
|
|
16
|
-
db: SqliteRemoteDatabase;
|
|
17
|
-
data?: DBUserConfig['data'];
|
|
18
|
-
collections: DBCollections;
|
|
19
|
-
logger?: AstroIntegrationLogger;
|
|
20
|
-
mode: 'dev' | 'build';
|
|
21
|
-
}): Promise<void>;
|
|
22
|
-
export declare function getCreateTableQuery(collectionName: string, collection: DBCollection): string;
|
|
23
|
-
export declare function getTableIndexQueries(collectionName: string, collection: DBCollection): SQL<unknown>[];
|
|
24
|
-
export declare function schemaTypeToSqlType(type: ColumnType): 'text' | 'integer';
|
|
25
|
-
export declare function getModifiers(columnName: string, column: DBColumn): string;
|
|
26
|
-
type WithDefaultDefined<T extends DBColumn> = T & Required<Pick<T, 'default'>>;
|
|
27
|
-
type DBColumnWithDefault = WithDefaultDefined<TextColumn> | WithDefaultDefined<DateColumn> | WithDefaultDefined<NumberColumn> | WithDefaultDefined<BooleanColumn> | WithDefaultDefined<JsonColumn>;
|
|
28
|
-
export declare function hasDefault(column: DBColumn): column is DBColumnWithDefault;
|
|
29
|
-
export declare function collectionToTable(name: string, collection: DBCollection, isJsonSerializable?: boolean): import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
30
|
-
name: string;
|
|
31
|
-
schema: undefined;
|
|
32
|
-
columns: {
|
|
33
|
-
[x: string]: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
34
|
-
name: string;
|
|
35
|
-
tableName: string;
|
|
36
|
-
dataType: ColumnDataType;
|
|
37
|
-
columnType: string;
|
|
38
|
-
data: unknown;
|
|
39
|
-
driverParam: unknown;
|
|
40
|
-
notNull: false;
|
|
41
|
-
hasDefault: false;
|
|
42
|
-
enumValues: string[] | undefined;
|
|
43
|
-
baseColumn: never;
|
|
44
|
-
}, object>;
|
|
45
|
-
};
|
|
46
|
-
dialect: "sqlite";
|
|
47
|
-
}>;
|
package/dist/migrations.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { DBSnapshot } from './types.js';
|
|
2
|
-
import type { AstroConfig } from 'astro';
|
|
3
|
-
export declare function getMigrations(): Promise<string[]>;
|
|
4
|
-
export declare function loadMigration(migration: string): Promise<{
|
|
5
|
-
diff: any[];
|
|
6
|
-
db: string[];
|
|
7
|
-
}>;
|
|
8
|
-
export declare function loadInitialSnapshot(): Promise<DBSnapshot>;
|
|
9
|
-
export declare function initializeMigrationsDirectory(currentSnapshot: DBSnapshot): Promise<void>;
|
|
10
|
-
export declare function initializeFromMigrations(allMigrationFiles: string[]): Promise<DBSnapshot>;
|
|
11
|
-
export declare function createCurrentSnapshot(config: AstroConfig): DBSnapshot;
|
|
12
|
-
export declare function createEmptySnapshot(): DBSnapshot;
|
package/dist/root.d.ts
DELETED