@trycompai/db 1.0.9 → 1.1.0

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 CHANGED
@@ -48,10 +48,18 @@ if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = db;
48
48
 
49
49
  ```typescript
50
50
  import { db } from '@/lib/db';
51
- import type { User, Organization } from '@trycompai/db';
51
+ import type { User, Organization, Prisma } from '@trycompai/db';
52
52
 
53
53
  // Full type safety!
54
54
  const users: User[] = await db.user.findMany();
55
+
56
+ // Create with type-safe input
57
+ const newUser = await db.user.create({
58
+ data: {
59
+ email: 'user@example.com',
60
+ name: 'John Doe',
61
+ } satisfies Prisma.UserCreateInput,
62
+ });
55
63
  ```
56
64
 
57
65
  ## Why This Approach?
package/dist/index.d.mts CHANGED
@@ -1,5 +1,2 @@
1
- export { Organization, Prisma, PrismaClient, User } from '@prisma/client';
2
-
3
- declare const DATABASE_URL: string;
4
-
5
- export { DATABASE_URL };
1
+ export * from '@prisma/client';
2
+ export { PrismaClient } from '@prisma/client';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- export { Organization, Prisma, PrismaClient, User } from '@prisma/client';
2
-
3
- declare const DATABASE_URL: string;
4
-
5
- export { DATABASE_URL };
1
+ export * from '@prisma/client';
2
+ export { PrismaClient } from '@prisma/client';
package/dist/index.js CHANGED
@@ -3,10 +3,6 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
6
  var __copyProps = (to, from, except, desc) => {
11
7
  if (from && typeof from === "object" || typeof from === "function") {
12
8
  for (let key of __getOwnPropNames(from))
@@ -15,16 +11,14 @@ var __copyProps = (to, from, except, desc) => {
15
11
  }
16
12
  return to;
17
13
  };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
15
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
16
 
20
17
  // src/index.ts
21
18
  var index_exports = {};
22
- __export(index_exports, {
23
- DATABASE_URL: () => DATABASE_URL
24
- });
25
19
  module.exports = __toCommonJS(index_exports);
26
- var DATABASE_URL = process.env.DATABASE_URL || "";
20
+ __reExport(index_exports, require("@prisma/client"), module.exports);
27
21
  // Annotate the CommonJS export names for ESM import in node:
28
22
  0 && (module.exports = {
29
- DATABASE_URL
23
+ ...require("@prisma/client")
30
24
  });
package/dist/index.mjs CHANGED
@@ -1,5 +1,2 @@
1
1
  // src/index.ts
2
- var DATABASE_URL = process.env.DATABASE_URL || "";
3
- export {
4
- DATABASE_URL
5
- };
2
+ export * from "@prisma/client";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@trycompai/db",
3
3
  "description": "Database package with Prisma client and schema for Comp AI",
4
- "version": "1.0.9",
4
+ "version": "1.1.0",
5
5
  "devDependencies": {
6
6
  "@prisma/client": "6.9.0",
7
7
  "prisma": "6.9.0",
@@ -56,7 +56,12 @@ echo "
56
56
  ✨ Setup complete! You can now use the database:
57
57
 
58
58
  import { db } from '@/lib/db';
59
- import type { User, Organization } from '@trycompai/db';
59
+ import type { User, Organization, Prisma } from '@trycompai/db';
60
60
 
61
61
  const users = await db.user.findMany();
62
+
63
+ // All Prisma types are available:
64
+ const newUser = await db.user.create({
65
+ data: {...} satisfies Prisma.UserCreateInput
66
+ });
62
67
  "