@storecraft/database-planetscale 1.0.17 → 1.2.5
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/README.md +6 -6
- package/index.js +2 -2
- package/kysely.planet.dialect.js +0 -4
- package/package.json +1 -2
package/README.md
CHANGED
@@ -29,7 +29,6 @@ import { NodeLocalStorage } from '@storecraft/core/storage/node'
|
|
29
29
|
import { PlanetScale } from '@storecraft/database-planetscale'
|
30
30
|
import { migrateToLatest } from '@storecraft/database-planetscale/migrate.js'
|
31
31
|
|
32
|
-
|
33
32
|
const app = new App(
|
34
33
|
{
|
35
34
|
auth_admins_emails: ['admin@sc.com'],
|
@@ -47,14 +46,15 @@ const app = new App(
|
|
47
46
|
)
|
48
47
|
)
|
49
48
|
.withStorage(new NodeLocalStorage('storage'))
|
49
|
+
.init();
|
50
|
+
|
51
|
+
await migrateToLatest(app.__show_me_everything.db, false);
|
52
|
+
await app.__show_me_everything.vector_store.createVectorIndex();
|
50
53
|
|
51
|
-
|
52
|
-
await migrateToLatest(app.db, false);
|
53
|
-
|
54
|
-
const server = http.createServer(app.handler).listen(
|
54
|
+
http.createServer(app.handler).listen(
|
55
55
|
8000,
|
56
56
|
() => {
|
57
|
-
|
57
|
+
app.print_banner('http://localhost:8000');
|
58
58
|
}
|
59
59
|
);
|
60
60
|
|
package/index.js
CHANGED
@@ -22,7 +22,7 @@ const assert = (b, msg) => {
|
|
22
22
|
export class PlanetScale extends SQL {
|
23
23
|
|
24
24
|
/** @satisfies {ENV<PlanetScaleDialectConfig>} */
|
25
|
-
static EnvConfig = /** @type{const} */ ({
|
25
|
+
static EnvConfig = /** @type {const} */ ({
|
26
26
|
url: 'PLANETSCALE_CONNECTION_URL'
|
27
27
|
});
|
28
28
|
|
@@ -45,7 +45,7 @@ export class PlanetScale extends SQL {
|
|
45
45
|
const dialect = /** @type {PlanetScaleDialect} */ (this.config.dialect);
|
46
46
|
const config = dialect.config;
|
47
47
|
|
48
|
-
config.url ??= app.
|
48
|
+
config.url ??= app.env[PlanetScale.EnvConfig.url];
|
49
49
|
|
50
50
|
super.init(app);
|
51
51
|
}
|
package/kysely.planet.dialect.js
CHANGED
@@ -164,11 +164,7 @@ class PlanetScaleConnection {
|
|
164
164
|
return {
|
165
165
|
insertId,
|
166
166
|
rows: ( /** @type {R[]} */ (results.rows)),
|
167
|
-
// @ts-ignore replaces `QueryResult.numUpdatedOrDeletedRows` in kysely > 0.22
|
168
|
-
// following https://github.com/koskimas/kysely/pull/188
|
169
167
|
numAffectedRows,
|
170
|
-
// deprecated in kysely > 0.22, keep for backward compatibility.
|
171
|
-
numUpdatedOrDeletedRows: numAffectedRows,
|
172
168
|
}
|
173
169
|
}
|
174
170
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@storecraft/database-planetscale",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.2.5",
|
4
4
|
"description": "`Storecraft` database driver for `PlanetScale` (cloud mysql)",
|
5
5
|
"license": "MIT",
|
6
6
|
"author": "Tomer Shalev (https://github.com/store-craft)",
|
@@ -31,7 +31,6 @@
|
|
31
31
|
"scripts": {
|
32
32
|
"database-planetscale:test": "node ./tests/runner.test.js",
|
33
33
|
"test": "npm run database-planetscale:test",
|
34
|
-
"prepublishOnly": "npm version patch --force",
|
35
34
|
"sc-publish": "npm publish"
|
36
35
|
},
|
37
36
|
"dependencies": {
|