sst 2.1.0 → 2.1.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.
- package/cli/commands/plugins/kysely.js +5 -2
- package/package.json +1 -1
- package/sst.mjs +3 -1
|
@@ -2,7 +2,7 @@ import { Kysely } from "kysely";
|
|
|
2
2
|
import { DataApiDialect } from "kysely-data-api";
|
|
3
3
|
import RDSDataService from "aws-sdk/clients/rdsdataservice.js";
|
|
4
4
|
import * as fs from "fs/promises";
|
|
5
|
-
import { DatabaseMetadata, EnumCollection, PostgresDialect, Serializer, Transformer, } from "kysely-codegen";
|
|
5
|
+
import { DatabaseMetadata, EnumCollection, PostgresDialect, MysqlDialect, Serializer, Transformer, } from "kysely-codegen";
|
|
6
6
|
import { Context } from "../../../context/context.js";
|
|
7
7
|
import { useBus } from "../../../bus.js";
|
|
8
8
|
import { useProject } from "../../../project.js";
|
|
@@ -53,8 +53,11 @@ export const useKyselyTypeGenerator = Context.memo(async () => {
|
|
|
53
53
|
})),
|
|
54
54
|
}));
|
|
55
55
|
const transformer = new Transformer();
|
|
56
|
+
const Dialect = db.engine.includes("postgres")
|
|
57
|
+
? new PostgresDialect()
|
|
58
|
+
: new MysqlDialect();
|
|
56
59
|
const nodes = transformer.transform({
|
|
57
|
-
dialect:
|
|
60
|
+
dialect: Dialect,
|
|
58
61
|
camelCase: db.types.camelCase === true,
|
|
59
62
|
metadata: new DatabaseMetadata(metadata, new EnumCollection()),
|
|
60
63
|
});
|
package/package.json
CHANGED
package/sst.mjs
CHANGED
|
@@ -6235,6 +6235,7 @@ import {
|
|
|
6235
6235
|
DatabaseMetadata,
|
|
6236
6236
|
EnumCollection,
|
|
6237
6237
|
PostgresDialect,
|
|
6238
|
+
MysqlDialect,
|
|
6238
6239
|
Serializer,
|
|
6239
6240
|
Transformer
|
|
6240
6241
|
} from "kysely-codegen";
|
|
@@ -6290,8 +6291,9 @@ var init_kysely = __esm({
|
|
|
6290
6291
|
}))
|
|
6291
6292
|
}));
|
|
6292
6293
|
const transformer = new Transformer();
|
|
6294
|
+
const Dialect = db.engine.includes("postgres") ? new PostgresDialect() : new MysqlDialect();
|
|
6293
6295
|
const nodes = transformer.transform({
|
|
6294
|
-
dialect:
|
|
6296
|
+
dialect: Dialect,
|
|
6295
6297
|
camelCase: db.types.camelCase === true,
|
|
6296
6298
|
metadata: new DatabaseMetadata(metadata3, new EnumCollection())
|
|
6297
6299
|
});
|