@prisma/studio-core 0.1.0 → 0.2.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.
Files changed (45) hide show
  1. package/dist/chunk-BUOKRYKO.js +10 -0
  2. package/dist/chunk-FRW62KTF.js +10 -0
  3. package/dist/chunk-P5LRZ6C2.js +10 -0
  4. package/dist/chunk-T2BEVNT5.js +10 -0
  5. package/dist/data/accelerate/index.cjs +2 -1
  6. package/dist/data/accelerate/index.d.cts +10 -2
  7. package/dist/data/accelerate/index.d.ts +10 -2
  8. package/dist/data/accelerate/index.js +10 -1
  9. package/dist/data/bff/index.cjs +2 -1
  10. package/dist/data/bff/index.d.cts +10 -3
  11. package/dist/data/bff/index.d.ts +10 -3
  12. package/dist/data/bff/index.js +10 -1
  13. package/dist/data/index.cjs +2 -1
  14. package/dist/data/index.d.cts +11 -2
  15. package/dist/data/index.d.ts +11 -2
  16. package/dist/data/index.js +10 -1
  17. package/dist/data/pglite/index.cjs +2 -1
  18. package/dist/data/pglite/index.d.cts +22 -5
  19. package/dist/data/pglite/index.d.ts +22 -5
  20. package/dist/data/pglite/index.js +10 -1
  21. package/dist/data/postgres-core/index.cjs +2 -1
  22. package/dist/data/postgres-core/index.d.cts +103 -18
  23. package/dist/data/postgres-core/index.d.ts +103 -18
  24. package/dist/data/postgres-core/index.js +10 -1
  25. package/dist/metafile-cjs.json +1 -0
  26. package/dist/metafile-esm.json +1 -0
  27. package/dist/query-Q-ZKX_Vr.d.cts +288 -0
  28. package/dist/query-Q-ZKX_Vr.d.ts +288 -0
  29. package/dist/ui/index.cjs +263 -1367
  30. package/dist/ui/index.css +1327 -680
  31. package/dist/ui/index.d.cts +69 -3
  32. package/dist/ui/index.d.ts +69 -3
  33. package/dist/ui/index.js +274 -41
  34. package/package.json +38 -31
  35. package/dist/CPIOZS5X-NALOZFPD.js +0 -1
  36. package/dist/OKF6E45R-6KC3BLVB.js +0 -1
  37. package/dist/adapter-Co8KY8Hi.d.cts +0 -166
  38. package/dist/adapter-Co8KY8Hi.d.ts +0 -166
  39. package/dist/chunk-2FW6TKD6.js +0 -1
  40. package/dist/chunk-5MNS4IJC.js +0 -1332
  41. package/dist/chunk-N2MLAUEV.js +0 -1
  42. package/dist/chunk-RGBMDID6.js +0 -1
  43. package/dist/chunk-ZCFLMQMM.js +0 -1
  44. package/dist/index-CnVNNyod.d.cts +0 -35
  45. package/dist/index-M4EjPWNJ.d.ts +0 -35
@@ -1,6 +1,6 @@
1
- import { A as Adapter, T as Table, a as AdapterInsertDetails, b as AdapterQueryDetails, c as AdapterUpdateDetails } from '../../adapter-Co8KY8Hi.cjs';
2
- import { E as Executor, B as BuilderRequirements, Q as Query } from '../../index-CnVNNyod.cjs';
3
- import 'kysely';
1
+ import { A as Adapter, T as Table, F as FilterOperator, Q as Query, c as AdapterInsertDetails, B as BuilderRequirements, d as AdapterQueryDetails, e as AdapterUpdateDetails, f as AdapterDeleteDetails } from '../../query-Q-ZKX_Vr.cjs';
2
+ import { Executor } from '../index.cjs';
3
+ import * as kysely from 'kysely';
4
4
 
5
5
  interface PostgresAdapterRequirements {
6
6
  executor: Executor;
@@ -11,10 +11,13 @@ declare function createPostgresAdapter(requirements: PostgresAdapterRequirements
11
11
  * For testing purposes.
12
12
  */
13
13
  declare function mockIntrospect(): {
14
- schemas: { [K in "public"]: {
15
- tables: { [T in "users"]: Table; };
14
+ schemas: { [K in "zoo" | "public"]: {
15
+ name: K;
16
+ tables: { [T in "animals" | "users"]: Table; };
16
17
  }; };
17
18
  timezone: "UTC";
19
+ filterOperators: FilterOperator[];
20
+ query: Query;
18
21
  };
19
22
 
20
23
  /**
@@ -26,10 +29,7 @@ declare function mockIntrospect(): {
26
29
  */
27
30
  type CTIDasText = `(${number},${number})`;
28
31
  /**
29
- * Inserts a row into a table and returns the inserted row along with its `ctid`.
30
- * The `ctid` is returned as a string in the format `(blockNumber, tupleIndex)`.
31
- * This is useful for identifying the row in the table, even if it has no primary key or unique constraints.
32
- * The `ctid` is a system column that represents the physical location of a row in a table.
32
+ * Inserts one or more rows into a table and returns the inserted rows along with their `ctid`.
33
33
  */
34
34
  declare function getInsertQuery(details: AdapterInsertDetails, requirements?: Omit<BuilderRequirements, "Adapter" | "QueryCompiler">): Query<{
35
35
  [x: string]: unknown;
@@ -41,8 +41,8 @@ declare function getInsertQuery(details: AdapterInsertDetails, requirements?: Om
41
41
  */
42
42
  declare function getSelectQuery(details: AdapterQueryDetails, requirements?: Omit<BuilderRequirements, "Adapter" | "QueryCompiler">): Query<{
43
43
  [x: string]: unknown;
44
- ctid: `(${number},${number})`;
45
44
  oid: `${bigint}`;
45
+ ctid: `(${number},${number})`;
46
46
  }>;
47
47
  /**
48
48
  * For testing purposes.
@@ -55,6 +55,7 @@ declare function mockSelectQuery(): [{
55
55
  readonly name: "John Doe";
56
56
  readonly oid: "2";
57
57
  readonly role: "admin";
58
+ readonly name_role: "Jonn Doe - admin";
58
59
  }, {
59
60
  readonly created_at: Date;
60
61
  readonly ctid: "(0,2)";
@@ -63,6 +64,7 @@ declare function mockSelectQuery(): [{
63
64
  readonly name: "Jane Doe";
64
65
  readonly oid: "2";
65
66
  readonly role: "poweruser";
67
+ readonly name_role: "Jane Doe - poweruser";
66
68
  }];
67
69
  /**
68
70
  * Returns a query that updates a given row in a table with given changes.
@@ -72,6 +74,10 @@ declare function getUpdateQuery(details: AdapterUpdateDetails, requirements?: Om
72
74
  ctid: `(${number},${number})`;
73
75
  __ps_updated_at__: `${bigint}`;
74
76
  }>;
77
+ /**
78
+ * Returns a query that deletes a given set of rows.
79
+ */
80
+ declare function getDeleteQuery(details: AdapterDeleteDetails, requirements?: Omit<BuilderRequirements, "Adapter" | "QueryCompiler">): Query<kysely.DeleteResult>;
75
81
 
76
82
  /**
77
83
  * Returns a query that returns metadata for all user-defined tables and views in the database.
@@ -82,35 +88,114 @@ declare function getTablesQuery(requirements?: Omit<BuilderRequirements, "Adapte
82
88
  columns: {
83
89
  name: string;
84
90
  datatype: string;
91
+ datatype_schema: string;
92
+ foreign_key_schema: string | null;
93
+ foreign_key_table: string | null;
94
+ foreign_key_column: string | null;
85
95
  pk: boolean;
96
+ computed: boolean;
97
+ nullable: boolean;
98
+ options: string[];
86
99
  }[];
87
100
  }>;
88
101
  /**
89
102
  * For testing purposes.
90
103
  */
91
104
  declare function mockTablesQuery(): [{
105
+ readonly schema: "zoo";
106
+ readonly name: "animals";
107
+ readonly columns: [{
108
+ readonly name: "id";
109
+ readonly datatype: "int4";
110
+ readonly datatype_schema: "pg_catalog";
111
+ readonly pk: true;
112
+ readonly computed: false;
113
+ readonly options: [];
114
+ readonly nullable: false;
115
+ readonly foreign_key_schema: null;
116
+ readonly foreign_key_table: null;
117
+ readonly foreign_key_column: null;
118
+ }, {
119
+ readonly name: "name";
120
+ readonly datatype: "text";
121
+ readonly datatype_schema: "pg_catalog";
122
+ readonly pk: false;
123
+ readonly computed: false;
124
+ readonly options: [];
125
+ readonly nullable: true;
126
+ readonly foreign_key_schema: null;
127
+ readonly foreign_key_table: null;
128
+ readonly foreign_key_column: null;
129
+ }];
130
+ }, {
92
131
  readonly schema: "public";
93
132
  readonly name: "users";
94
133
  readonly columns: [{
95
134
  readonly name: "id";
96
- readonly datatype: "bigint";
135
+ readonly datatype: "int4";
136
+ readonly datatype_schema: "pg_catalog";
97
137
  readonly pk: true;
138
+ readonly computed: false;
139
+ readonly options: [];
140
+ readonly nullable: false;
141
+ readonly foreign_key_schema: null;
142
+ readonly foreign_key_table: null;
143
+ readonly foreign_key_column: null;
98
144
  }, {
99
- readonly name: "name";
100
- readonly datatype: "varchar";
145
+ readonly name: "created_at";
146
+ readonly datatype: "timestamp";
147
+ readonly datatype_schema: "pg_catalog";
101
148
  readonly pk: false;
149
+ readonly computed: false;
150
+ readonly options: [];
151
+ readonly nullable: true;
152
+ readonly foreign_key_schema: null;
153
+ readonly foreign_key_table: null;
154
+ readonly foreign_key_column: null;
155
+ }, {
156
+ readonly name: "deleted_at";
157
+ readonly datatype: "timestamp";
158
+ readonly datatype_schema: "pg_catalog";
159
+ readonly pk: false;
160
+ readonly computed: false;
161
+ readonly options: [];
162
+ readonly nullable: true;
163
+ readonly foreign_key_schema: null;
164
+ readonly foreign_key_table: null;
165
+ readonly foreign_key_column: null;
102
166
  }, {
103
167
  readonly name: "role";
104
168
  readonly datatype: "varchar";
169
+ readonly datatype_schema: "pg_catalog";
105
170
  readonly pk: false;
171
+ readonly computed: false;
172
+ readonly options: [];
173
+ readonly nullable: true;
174
+ readonly foreign_key_schema: null;
175
+ readonly foreign_key_table: null;
176
+ readonly foreign_key_column: null;
106
177
  }, {
107
- readonly name: "created_at";
108
- readonly datatype: "timestamptz";
178
+ readonly name: "name";
179
+ readonly datatype: "varchar";
180
+ readonly datatype_schema: "pg_catalog";
109
181
  readonly pk: false;
182
+ readonly computed: false;
183
+ readonly options: [];
184
+ readonly nullable: true;
185
+ readonly foreign_key_schema: null;
186
+ readonly foreign_key_table: null;
187
+ readonly foreign_key_column: null;
110
188
  }, {
111
- readonly name: "deleted_at";
112
- readonly datatype: "timestamptz";
189
+ readonly name: "name_role";
190
+ readonly datatype: "text";
191
+ readonly datatype_schema: "pg_catalog";
113
192
  readonly pk: false;
193
+ readonly computed: true;
194
+ readonly options: [];
195
+ readonly nullable: false;
196
+ readonly foreign_key_schema: null;
197
+ readonly foreign_key_table: null;
198
+ readonly foreign_key_column: null;
114
199
  }];
115
200
  }];
116
201
  /**
@@ -126,4 +211,4 @@ declare function mockTimezoneQuery(): [{
126
211
  readonly timezone: "UTC";
127
212
  }];
128
213
 
129
- export { type CTIDasText, type PostgresAdapterRequirements, createPostgresAdapter, getInsertQuery, getSelectQuery, getTablesQuery, getTimezoneQuery, getUpdateQuery, mockIntrospect, mockSelectQuery, mockTablesQuery, mockTimezoneQuery };
214
+ export { type CTIDasText, type PostgresAdapterRequirements, createPostgresAdapter, getDeleteQuery, getInsertQuery, getSelectQuery, getTablesQuery, getTimezoneQuery, getUpdateQuery, mockIntrospect, mockSelectQuery, mockTablesQuery, mockTimezoneQuery };
@@ -1,6 +1,6 @@
1
- import { A as Adapter, T as Table, a as AdapterInsertDetails, b as AdapterQueryDetails, c as AdapterUpdateDetails } from '../../adapter-Co8KY8Hi.js';
2
- import { E as Executor, B as BuilderRequirements, Q as Query } from '../../index-M4EjPWNJ.js';
3
- import 'kysely';
1
+ import { A as Adapter, T as Table, F as FilterOperator, Q as Query, c as AdapterInsertDetails, B as BuilderRequirements, d as AdapterQueryDetails, e as AdapterUpdateDetails, f as AdapterDeleteDetails } from '../../query-Q-ZKX_Vr.js';
2
+ import { Executor } from '../index.js';
3
+ import * as kysely from 'kysely';
4
4
 
5
5
  interface PostgresAdapterRequirements {
6
6
  executor: Executor;
@@ -11,10 +11,13 @@ declare function createPostgresAdapter(requirements: PostgresAdapterRequirements
11
11
  * For testing purposes.
12
12
  */
13
13
  declare function mockIntrospect(): {
14
- schemas: { [K in "public"]: {
15
- tables: { [T in "users"]: Table; };
14
+ schemas: { [K in "zoo" | "public"]: {
15
+ name: K;
16
+ tables: { [T in "animals" | "users"]: Table; };
16
17
  }; };
17
18
  timezone: "UTC";
19
+ filterOperators: FilterOperator[];
20
+ query: Query;
18
21
  };
19
22
 
20
23
  /**
@@ -26,10 +29,7 @@ declare function mockIntrospect(): {
26
29
  */
27
30
  type CTIDasText = `(${number},${number})`;
28
31
  /**
29
- * Inserts a row into a table and returns the inserted row along with its `ctid`.
30
- * The `ctid` is returned as a string in the format `(blockNumber, tupleIndex)`.
31
- * This is useful for identifying the row in the table, even if it has no primary key or unique constraints.
32
- * The `ctid` is a system column that represents the physical location of a row in a table.
32
+ * Inserts one or more rows into a table and returns the inserted rows along with their `ctid`.
33
33
  */
34
34
  declare function getInsertQuery(details: AdapterInsertDetails, requirements?: Omit<BuilderRequirements, "Adapter" | "QueryCompiler">): Query<{
35
35
  [x: string]: unknown;
@@ -41,8 +41,8 @@ declare function getInsertQuery(details: AdapterInsertDetails, requirements?: Om
41
41
  */
42
42
  declare function getSelectQuery(details: AdapterQueryDetails, requirements?: Omit<BuilderRequirements, "Adapter" | "QueryCompiler">): Query<{
43
43
  [x: string]: unknown;
44
- ctid: `(${number},${number})`;
45
44
  oid: `${bigint}`;
45
+ ctid: `(${number},${number})`;
46
46
  }>;
47
47
  /**
48
48
  * For testing purposes.
@@ -55,6 +55,7 @@ declare function mockSelectQuery(): [{
55
55
  readonly name: "John Doe";
56
56
  readonly oid: "2";
57
57
  readonly role: "admin";
58
+ readonly name_role: "Jonn Doe - admin";
58
59
  }, {
59
60
  readonly created_at: Date;
60
61
  readonly ctid: "(0,2)";
@@ -63,6 +64,7 @@ declare function mockSelectQuery(): [{
63
64
  readonly name: "Jane Doe";
64
65
  readonly oid: "2";
65
66
  readonly role: "poweruser";
67
+ readonly name_role: "Jane Doe - poweruser";
66
68
  }];
67
69
  /**
68
70
  * Returns a query that updates a given row in a table with given changes.
@@ -72,6 +74,10 @@ declare function getUpdateQuery(details: AdapterUpdateDetails, requirements?: Om
72
74
  ctid: `(${number},${number})`;
73
75
  __ps_updated_at__: `${bigint}`;
74
76
  }>;
77
+ /**
78
+ * Returns a query that deletes a given set of rows.
79
+ */
80
+ declare function getDeleteQuery(details: AdapterDeleteDetails, requirements?: Omit<BuilderRequirements, "Adapter" | "QueryCompiler">): Query<kysely.DeleteResult>;
75
81
 
76
82
  /**
77
83
  * Returns a query that returns metadata for all user-defined tables and views in the database.
@@ -82,35 +88,114 @@ declare function getTablesQuery(requirements?: Omit<BuilderRequirements, "Adapte
82
88
  columns: {
83
89
  name: string;
84
90
  datatype: string;
91
+ datatype_schema: string;
92
+ foreign_key_schema: string | null;
93
+ foreign_key_table: string | null;
94
+ foreign_key_column: string | null;
85
95
  pk: boolean;
96
+ computed: boolean;
97
+ nullable: boolean;
98
+ options: string[];
86
99
  }[];
87
100
  }>;
88
101
  /**
89
102
  * For testing purposes.
90
103
  */
91
104
  declare function mockTablesQuery(): [{
105
+ readonly schema: "zoo";
106
+ readonly name: "animals";
107
+ readonly columns: [{
108
+ readonly name: "id";
109
+ readonly datatype: "int4";
110
+ readonly datatype_schema: "pg_catalog";
111
+ readonly pk: true;
112
+ readonly computed: false;
113
+ readonly options: [];
114
+ readonly nullable: false;
115
+ readonly foreign_key_schema: null;
116
+ readonly foreign_key_table: null;
117
+ readonly foreign_key_column: null;
118
+ }, {
119
+ readonly name: "name";
120
+ readonly datatype: "text";
121
+ readonly datatype_schema: "pg_catalog";
122
+ readonly pk: false;
123
+ readonly computed: false;
124
+ readonly options: [];
125
+ readonly nullable: true;
126
+ readonly foreign_key_schema: null;
127
+ readonly foreign_key_table: null;
128
+ readonly foreign_key_column: null;
129
+ }];
130
+ }, {
92
131
  readonly schema: "public";
93
132
  readonly name: "users";
94
133
  readonly columns: [{
95
134
  readonly name: "id";
96
- readonly datatype: "bigint";
135
+ readonly datatype: "int4";
136
+ readonly datatype_schema: "pg_catalog";
97
137
  readonly pk: true;
138
+ readonly computed: false;
139
+ readonly options: [];
140
+ readonly nullable: false;
141
+ readonly foreign_key_schema: null;
142
+ readonly foreign_key_table: null;
143
+ readonly foreign_key_column: null;
98
144
  }, {
99
- readonly name: "name";
100
- readonly datatype: "varchar";
145
+ readonly name: "created_at";
146
+ readonly datatype: "timestamp";
147
+ readonly datatype_schema: "pg_catalog";
101
148
  readonly pk: false;
149
+ readonly computed: false;
150
+ readonly options: [];
151
+ readonly nullable: true;
152
+ readonly foreign_key_schema: null;
153
+ readonly foreign_key_table: null;
154
+ readonly foreign_key_column: null;
155
+ }, {
156
+ readonly name: "deleted_at";
157
+ readonly datatype: "timestamp";
158
+ readonly datatype_schema: "pg_catalog";
159
+ readonly pk: false;
160
+ readonly computed: false;
161
+ readonly options: [];
162
+ readonly nullable: true;
163
+ readonly foreign_key_schema: null;
164
+ readonly foreign_key_table: null;
165
+ readonly foreign_key_column: null;
102
166
  }, {
103
167
  readonly name: "role";
104
168
  readonly datatype: "varchar";
169
+ readonly datatype_schema: "pg_catalog";
105
170
  readonly pk: false;
171
+ readonly computed: false;
172
+ readonly options: [];
173
+ readonly nullable: true;
174
+ readonly foreign_key_schema: null;
175
+ readonly foreign_key_table: null;
176
+ readonly foreign_key_column: null;
106
177
  }, {
107
- readonly name: "created_at";
108
- readonly datatype: "timestamptz";
178
+ readonly name: "name";
179
+ readonly datatype: "varchar";
180
+ readonly datatype_schema: "pg_catalog";
109
181
  readonly pk: false;
182
+ readonly computed: false;
183
+ readonly options: [];
184
+ readonly nullable: true;
185
+ readonly foreign_key_schema: null;
186
+ readonly foreign_key_table: null;
187
+ readonly foreign_key_column: null;
110
188
  }, {
111
- readonly name: "deleted_at";
112
- readonly datatype: "timestamptz";
189
+ readonly name: "name_role";
190
+ readonly datatype: "text";
191
+ readonly datatype_schema: "pg_catalog";
113
192
  readonly pk: false;
193
+ readonly computed: true;
194
+ readonly options: [];
195
+ readonly nullable: false;
196
+ readonly foreign_key_schema: null;
197
+ readonly foreign_key_table: null;
198
+ readonly foreign_key_column: null;
114
199
  }];
115
200
  }];
116
201
  /**
@@ -126,4 +211,4 @@ declare function mockTimezoneQuery(): [{
126
211
  readonly timezone: "UTC";
127
212
  }];
128
213
 
129
- export { type CTIDasText, type PostgresAdapterRequirements, createPostgresAdapter, getInsertQuery, getSelectQuery, getTablesQuery, getTimezoneQuery, getUpdateQuery, mockIntrospect, mockSelectQuery, mockTablesQuery, mockTimezoneQuery };
214
+ export { type CTIDasText, type PostgresAdapterRequirements, createPostgresAdapter, getDeleteQuery, getInsertQuery, getSelectQuery, getTablesQuery, getTimezoneQuery, getUpdateQuery, mockIntrospect, mockSelectQuery, mockTablesQuery, mockTimezoneQuery };
@@ -1 +1,10 @@
1
- import{a,b,c,d,e,f,g,h,i,j}from"../../chunk-ZCFLMQMM.js";import"../../chunk-RGBMDID6.js";import"../../chunk-2FW6TKD6.js";export{i as createPostgresAdapter,a as getInsertQuery,b as getSelectQuery,e as getTablesQuery,g as getTimezoneQuery,d as getUpdateQuery,j as mockIntrospect,c as mockSelectQuery,f as mockTablesQuery,h as mockTimezoneQuery};
1
+ import * as ___react___ from 'react';
2
+ import * as ___react_dom___ from 'react-dom';
3
+
4
+ function require(mod) {
5
+ if (mod === 'react') return ___react___;
6
+ if (mod === 'react-dom') return ___react_dom___;
7
+ throw new Error(`Unknown module ${mod}`);
8
+ }
9
+ import{a,b,c,d,e,f,g,h,i,j,k}from"../../chunk-T2BEVNT5.js";import"../../chunk-FRW62KTF.js";import"../../chunk-P5LRZ6C2.js";export{j as createPostgresAdapter,e as getDeleteQuery,a as getInsertQuery,b as getSelectQuery,f as getTablesQuery,h as getTimezoneQuery,d as getUpdateQuery,k as mockIntrospect,c as mockSelectQuery,g as mockTablesQuery,i as mockTimezoneQuery};
10
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K