rwsdk 1.0.0-beta.26 → 1.0.0-beta.27
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.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DurableObject } from "cloudflare:workers";
|
|
2
|
-
import { Kysely, QueryResult } from "kysely";
|
|
2
|
+
import { Kysely, KyselyPlugin, QueryResult } from "kysely";
|
|
3
3
|
export declare class SqliteDurableObject<T = any> extends DurableObject {
|
|
4
4
|
migrations: Record<string, any>;
|
|
5
5
|
kysely: Kysely<T>;
|
|
6
6
|
private initialized;
|
|
7
7
|
private migrationTableName;
|
|
8
|
-
constructor(ctx: DurableObjectState, env: any, migrations: Record<string, any>, migrationTableName?: string);
|
|
8
|
+
constructor(ctx: DurableObjectState, env: any, migrations: Record<string, any>, migrationTableName?: string, plugins?: KyselyPlugin[]);
|
|
9
9
|
initialize(): Promise<void>;
|
|
10
10
|
kyselyExecuteQuery<R>(compiledQuery: {
|
|
11
11
|
sql: string;
|
|
@@ -6,14 +6,14 @@ import { createMigrator } from "./index.js";
|
|
|
6
6
|
const log = debug("sdk:do-db");
|
|
7
7
|
// Base class for Durable Objects that need Kysely database access
|
|
8
8
|
export class SqliteDurableObject extends DurableObject {
|
|
9
|
-
constructor(ctx, env, migrations, migrationTableName = "__migrations") {
|
|
9
|
+
constructor(ctx, env, migrations, migrationTableName = "__migrations", plugins = [new ParseJSONResultsPlugin()]) {
|
|
10
10
|
super(ctx, env);
|
|
11
11
|
this.initialized = false;
|
|
12
12
|
this.migrations = migrations;
|
|
13
13
|
this.migrationTableName = migrationTableName;
|
|
14
14
|
this.kysely = new Kysely({
|
|
15
15
|
dialect: new DODialect({ ctx }),
|
|
16
|
-
plugins:
|
|
16
|
+
plugins: plugins,
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
async initialize() {
|
|
@@ -43,7 +43,7 @@ export declare function defineRoutes<T extends RequestInfo = RequestInfo>(routes
|
|
|
43
43
|
* Supports three types of path patterns:
|
|
44
44
|
* - Static: /about, /contact
|
|
45
45
|
* - Parameters: /users/:id, /posts/:postId/edit
|
|
46
|
-
* - Wildcards: /files/*, /api
|
|
46
|
+
* - Wildcards: /files/*, /api/*\/download
|
|
47
47
|
*
|
|
48
48
|
* @example
|
|
49
49
|
* // Static route
|
|
@@ -227,7 +227,7 @@ export function defineRoutes(routes) {
|
|
|
227
227
|
* Supports three types of path patterns:
|
|
228
228
|
* - Static: /about, /contact
|
|
229
229
|
* - Parameters: /users/:id, /posts/:postId/edit
|
|
230
|
-
* - Wildcards: /files/*, /api
|
|
230
|
+
* - Wildcards: /files/*, /api/*\/download
|
|
231
231
|
*
|
|
232
232
|
* @example
|
|
233
233
|
* // Static route
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rwsdk",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.27",
|
|
4
4
|
"description": "Build fast, server-driven webapps on Cloudflare with SSR, RSC, and realtime",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -196,7 +196,7 @@
|
|
|
196
196
|
"semver": "~7.7.1",
|
|
197
197
|
"tsx": "~4.20.0",
|
|
198
198
|
"typescript": "~5.9.0",
|
|
199
|
-
"vite": "~7.
|
|
199
|
+
"vite": "~7.2.0",
|
|
200
200
|
"vitest": "~3.2.0"
|
|
201
201
|
}
|
|
202
202
|
}
|