kfreelance-project-postgresql-prisma 1.0.5 → 1.0.6
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/index.d.ts +7 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
export { PrismaClient } from "../generated/prisma";
|
|
2
|
-
export type { User, PasswordResetToken
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export type { Prisma, User, PasswordResetToken } from "../generated/prisma";
|
|
3
|
+
declare const getDefaultDatabaseUrl: () => string;
|
|
4
|
+
declare const createPrismaClient: (options?: {
|
|
5
5
|
databaseUrl?: string;
|
|
6
6
|
log?: Array<"query" | "info" | "warn" | "error">;
|
|
7
|
-
}) =>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
log: ("query" | "info" | "warn" | "error")[];
|
|
14
|
-
}, "query" | "info" | "warn" | "error", import("../generated/prisma/runtime/library").DefaultArgs>;
|
|
15
|
-
export declare const getDefaultDatabaseUrl: () => string;
|
|
7
|
+
}) => any;
|
|
8
|
+
export { createPrismaClient, getDefaultDatabaseUrl };
|
|
9
|
+
import { PrismaClient } from "../generated/prisma";
|
|
10
|
+
export default PrismaClient;
|
|
16
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG5E,QAAA,MAAM,qBAAqB,cAE1B,CAAC;AAGF,QAAA,MAAM,kBAAkB,GAAI,UAAU;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CAClD,QAWA,CAAC;AAGF,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,CAAC;AAGrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,eAAe,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getDefaultDatabaseUrl = exports.createPrismaClient = exports.PrismaClient = void 0;
|
|
4
|
-
//
|
|
4
|
+
// Export Prisma Client and types
|
|
5
5
|
var prisma_1 = require("../generated/prisma");
|
|
6
6
|
Object.defineProperty(exports, "PrismaClient", { enumerable: true, get: function () { return prisma_1.PrismaClient; } });
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
// Default database URL helper
|
|
8
|
+
const getDefaultDatabaseUrl = () => {
|
|
9
|
+
return process.env.DATABASE_URL || 'postgresql://postgres:password@localhost:5432/freelance_db';
|
|
10
|
+
};
|
|
11
|
+
exports.getDefaultDatabaseUrl = getDefaultDatabaseUrl;
|
|
12
|
+
// Factory function to create Prisma client with custom options
|
|
9
13
|
const createPrismaClient = (options) => {
|
|
10
|
-
|
|
14
|
+
const { PrismaClient } = require("../generated/prisma");
|
|
15
|
+
return new PrismaClient({
|
|
11
16
|
datasources: {
|
|
12
17
|
db: {
|
|
13
|
-
url: options?.databaseUrl ||
|
|
18
|
+
url: options?.databaseUrl || getDefaultDatabaseUrl(),
|
|
14
19
|
},
|
|
15
20
|
},
|
|
16
|
-
log: options?.log || [
|
|
21
|
+
log: options?.log || ['error', 'warn'],
|
|
17
22
|
});
|
|
18
23
|
};
|
|
19
24
|
exports.createPrismaClient = createPrismaClient;
|
|
20
|
-
//
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
"postgresql://postgres:your_secure_password@localhost:5432/freelance_db?schema=public");
|
|
24
|
-
};
|
|
25
|
-
exports.getDefaultDatabaseUrl = getDefaultDatabaseUrl;
|
|
25
|
+
// Default export for convenience
|
|
26
|
+
const prisma_2 = require("../generated/prisma");
|
|
27
|
+
exports.default = prisma_2.PrismaClient;
|
|
26
28
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AACjC,8CAAmD;AAA1C,sGAAA,YAAY,OAAA;AAGrB,8BAA8B;AAC9B,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACjC,OAAO,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,4DAA4D,CAAC;AAClG,CAAC,CAAC;AAoB2B,sDAAqB;AAlBlD,+DAA+D;AAC/D,MAAM,kBAAkB,GAAG,CAAC,OAG3B,EAAE,EAAE;IACH,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAExD,OAAO,IAAI,YAAY,CAAC;QACtB,WAAW,EAAE;YACX,EAAE,EAAE;gBACF,GAAG,EAAE,OAAO,EAAE,WAAW,IAAI,qBAAqB,EAAE;aACrD;SACF;QACD,GAAG,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC;KACvC,CAAC,CAAC;AACL,CAAC,CAAC;AAGO,gDAAkB;AAE3B,iCAAiC;AACjC,gDAAmD;AACnD,kBAAe,qBAAY,CAAC"}
|