@astrojs/db 0.14.5 → 0.14.7
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/_internal/runtime/virtual.d.ts +1 -1
- package/dist/core/cli/commands/shell/index.js +1 -1
- package/dist/core/cli/print-help.js +1 -1
- package/dist/core/integration/vite-plugin-db.js +1 -1
- package/dist/runtime/db-client.d.ts +1 -1
- package/dist/runtime/db-client.js +1 -1
- package/dist/runtime/virtual.js +2 -0
- package/package.json +7 -7
- package/virtual.d.ts +1 -0
|
@@ -43,6 +43,6 @@ export declare function defineDb(userConfig: DBConfigInput): {
|
|
|
43
43
|
export declare const NOW: import("drizzle-orm").SQL<unknown>;
|
|
44
44
|
export declare const TRUE: import("drizzle-orm").SQL<unknown>;
|
|
45
45
|
export declare const FALSE: import("drizzle-orm").SQL<unknown>;
|
|
46
|
-
export { sql, eq, gt, gte, lt, lte, ne, isNull, isNotNull, inArray, notInArray, exists, notExists, between, notBetween, like, notIlike, not, asc, desc, and, or, count, countDistinct, avg, avgDistinct, sum, sumDistinct, max, min, } from 'drizzle-orm';
|
|
46
|
+
export { sql, eq, gt, gte, lt, lte, ne, isNull, isNotNull, inArray, notInArray, exists, notExists, between, notBetween, like, ilike, notIlike, not, asc, desc, and, or, count, countDistinct, avg, avgDistinct, sum, sumDistinct, max, min, } from 'drizzle-orm';
|
|
47
47
|
export { alias } from 'drizzle-orm/sqlite-core';
|
|
48
48
|
export { isDbError } from './utils.js';
|
|
@@ -33,7 +33,7 @@ async function cmd({
|
|
|
33
33
|
ASTRO_DATABASE_FILE,
|
|
34
34
|
new URL(DB_PATH, astroConfig.root).href
|
|
35
35
|
);
|
|
36
|
-
const db = createLocalDatabaseClient({ dbUrl,
|
|
36
|
+
const db = createLocalDatabaseClient({ dbUrl, enableTransactions: dbInfo.type === "libsql" });
|
|
37
37
|
const result = await db.run(sql.raw(query));
|
|
38
38
|
console.log(result);
|
|
39
39
|
}
|
|
@@ -140,7 +140,7 @@ async function recreateTables({ tables, root }) {
|
|
|
140
140
|
const dbInfo = getRemoteDatabaseInfo();
|
|
141
141
|
const { ASTRO_DATABASE_FILE } = getAstroEnv();
|
|
142
142
|
const dbUrl = normalizeDatabaseUrl(ASTRO_DATABASE_FILE, new URL(DB_PATH, root).href);
|
|
143
|
-
const db = createLocalDatabaseClient({ dbUrl,
|
|
143
|
+
const db = createLocalDatabaseClient({ dbUrl, enableTransactions: dbInfo.type === "libsql" });
|
|
144
144
|
const setupQueries = [];
|
|
145
145
|
for (const [name, table] of Object.entries(tables.get() ?? {})) {
|
|
146
146
|
const dropQuery = sql.raw(`DROP TABLE IF EXISTS ${sqlite.escapeName(name)}`);
|
|
@@ -2,7 +2,7 @@ import type { LibSQLDatabase } from 'drizzle-orm/libsql';
|
|
|
2
2
|
import { type SqliteRemoteDatabase } from 'drizzle-orm/sqlite-proxy';
|
|
3
3
|
type LocalDbClientOptions = {
|
|
4
4
|
dbUrl: string;
|
|
5
|
-
|
|
5
|
+
enableTransactions: boolean;
|
|
6
6
|
};
|
|
7
7
|
export declare function createLocalDatabaseClient(options: LocalDbClientOptions): LibSQLDatabase;
|
|
8
8
|
type RemoteDbClientOptions = {
|
|
@@ -17,7 +17,7 @@ function createLocalDatabaseClient(options) {
|
|
|
17
17
|
const url = isWebContainer ? "file:content.db" : options.dbUrl;
|
|
18
18
|
const client = createClient({ url });
|
|
19
19
|
const db = drizzleLibsql(client);
|
|
20
|
-
if (!options.
|
|
20
|
+
if (!options.enableTransactions) {
|
|
21
21
|
applyTransactionNotSupported(db);
|
|
22
22
|
}
|
|
23
23
|
return db;
|
package/dist/runtime/virtual.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrojs/db",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.7",
|
|
4
4
|
"description": "Add libSQL and Astro Studio support to your Astro site",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -72,18 +72,18 @@
|
|
|
72
72
|
"open": "^10.1.0",
|
|
73
73
|
"prompts": "^2.4.2",
|
|
74
74
|
"yargs-parser": "^21.1.1",
|
|
75
|
-
"yocto-spinner": "^0.
|
|
76
|
-
"zod": "^3.
|
|
77
|
-
"@astrojs/studio": "0.1.
|
|
75
|
+
"yocto-spinner": "^0.2.0",
|
|
76
|
+
"zod": "^3.24.1",
|
|
77
|
+
"@astrojs/studio": "0.1.4"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@types/deep-diff": "^1.0.5",
|
|
81
81
|
"@types/prompts": "^2.4.9",
|
|
82
82
|
"@types/yargs-parser": "^21.0.3",
|
|
83
83
|
"cheerio": "1.0.0",
|
|
84
|
-
"typescript": "^5.
|
|
85
|
-
"vite": "^6.0.
|
|
86
|
-
"astro": "5.
|
|
84
|
+
"typescript": "^5.7.3",
|
|
85
|
+
"vite": "^6.0.11",
|
|
86
|
+
"astro": "5.4.0",
|
|
87
87
|
"astro-scripts": "0.0.14"
|
|
88
88
|
},
|
|
89
89
|
"scripts": {
|
package/virtual.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ declare module 'astro:db' {
|
|
|
28
28
|
export const between: RuntimeConfig['between'];
|
|
29
29
|
export const notBetween: RuntimeConfig['notBetween'];
|
|
30
30
|
export const like: RuntimeConfig['like'];
|
|
31
|
+
export const ilike: RuntimeConfig['ilike'];
|
|
31
32
|
export const notIlike: RuntimeConfig['notIlike'];
|
|
32
33
|
export const not: RuntimeConfig['not'];
|
|
33
34
|
export const asc: RuntimeConfig['asc'];
|