@prisma/studio-core-licensed 0.0.0-dev.202506201836

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.
@@ -0,0 +1,251 @@
1
+ import { A as Adapter, T as Table, F as FilterOperator, Q as Query, b as AdapterInsertDetails, B as BuilderRequirements, c as AdapterQueryDetails, d as AdapterUpdateDetails, e as AdapterDeleteDetails } from '../../query-C7LxjwdN.cjs';
2
+ import { Executor } from '../index.cjs';
3
+ import * as kysely from 'kysely';
4
+
5
+ interface PostgresAdapterRequirements {
6
+ executor: Executor;
7
+ noParameters?: boolean;
8
+ }
9
+ declare function createPostgresAdapter(requirements: PostgresAdapterRequirements): Adapter;
10
+ /**
11
+ * For testing purposes.
12
+ */
13
+ declare function mockIntrospect(): {
14
+ schemas: { [K in "zoo" | "public"]: {
15
+ name: K;
16
+ tables: { [T in "animals" | "users" | "composite_pk"]: Table; };
17
+ }; };
18
+ timezone: "UTC";
19
+ filterOperators: FilterOperator[];
20
+ query: Query;
21
+ };
22
+
23
+ /**
24
+ * `ctid` is a system column that represents the physical location of a row in a table.
25
+ * It is a tuple of two integers: `(blockNumber, tupleIndex)`.
26
+ * It is used to uniquely identify a row in a table, even if the row has no primary key, or other unique constraints.
27
+ *
28
+ * Example: '(0,23)' represents the 24th row in the first block of the table.
29
+ */
30
+ type CTIDasText = `(${number},${number})`;
31
+ /**
32
+ * Inserts one or more rows into a table and returns the inserted rows along with their `ctid`.
33
+ */
34
+ declare function getInsertQuery(details: AdapterInsertDetails, requirements?: Omit<BuilderRequirements, "Adapter" | "QueryCompiler">): Query<{
35
+ [x: string]: unknown;
36
+ } & {
37
+ ctid: `(${number},${number})`;
38
+ }>;
39
+ /**
40
+ * Returns a query that selects all columns from a table, along with the `ctid` column, and unbound row count as `oid` (reserved column name that cannot conflict with user columns).
41
+ */
42
+ declare function getSelectQuery(details: AdapterQueryDetails, requirements?: Omit<BuilderRequirements, "Adapter" | "QueryCompiler">): Query<{
43
+ [x: string]: unknown;
44
+ oid: `${bigint}`;
45
+ ctid: `(${number},${number})`;
46
+ }>;
47
+ /**
48
+ * For testing purposes.
49
+ */
50
+ declare function mockSelectQuery(): [{
51
+ readonly created_at: Date;
52
+ readonly ctid: "(0,1)";
53
+ readonly deleted_at: null;
54
+ readonly id: 1;
55
+ readonly name: "John Doe";
56
+ readonly oid: "2";
57
+ readonly role: "admin";
58
+ readonly name_role: "Jonn Doe - admin";
59
+ }, {
60
+ readonly created_at: Date;
61
+ readonly ctid: "(0,2)";
62
+ readonly deleted_at: null;
63
+ readonly id: 2;
64
+ readonly name: "Jane Doe";
65
+ readonly oid: "2";
66
+ readonly role: "poweruser";
67
+ readonly name_role: "Jane Doe - poweruser";
68
+ }];
69
+ /**
70
+ * Returns a query that updates a given row in a table with given changes.
71
+ */
72
+ declare function getUpdateQuery(details: AdapterUpdateDetails, requirements?: Omit<BuilderRequirements, "Adapter" | "QueryCompiler">): Query<{
73
+ [x: string]: unknown;
74
+ ctid: `(${number},${number})`;
75
+ __ps_updated_at__: `${bigint}`;
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>;
81
+
82
+ /**
83
+ * Returns a query that returns metadata for all user-defined tables and views in the database.
84
+ */
85
+ declare function getTablesQuery(requirements?: Omit<BuilderRequirements, "Adapter" | "QueryCompiler">): Query<{
86
+ schema: string;
87
+ name: string;
88
+ columns: {
89
+ name: string;
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;
95
+ pk: boolean;
96
+ computed: boolean;
97
+ nullable: boolean;
98
+ options: string[];
99
+ }[];
100
+ }>;
101
+ /**
102
+ * For testing purposes.
103
+ */
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
+ }, {
131
+ readonly schema: "public";
132
+ readonly name: "users";
133
+ readonly columns: [{
134
+ readonly name: "id";
135
+ readonly datatype: "int4";
136
+ readonly datatype_schema: "pg_catalog";
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;
144
+ }, {
145
+ readonly name: "created_at";
146
+ readonly datatype: "timestamp";
147
+ readonly datatype_schema: "pg_catalog";
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;
166
+ }, {
167
+ readonly name: "role";
168
+ readonly datatype: "varchar";
169
+ readonly datatype_schema: "pg_catalog";
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;
177
+ }, {
178
+ readonly name: "name";
179
+ readonly datatype: "varchar";
180
+ readonly datatype_schema: "pg_catalog";
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;
188
+ }, {
189
+ readonly name: "name_role";
190
+ readonly datatype: "text";
191
+ readonly datatype_schema: "pg_catalog";
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;
199
+ }];
200
+ }, {
201
+ readonly schema: "public";
202
+ readonly name: "composite_pk";
203
+ readonly columns: [{
204
+ readonly name: "id";
205
+ readonly datatype: "uuid";
206
+ readonly datatype_schema: "pg_catalog";
207
+ readonly pk: true;
208
+ readonly computed: false;
209
+ readonly options: [];
210
+ readonly nullable: false;
211
+ readonly foreign_key_schema: null;
212
+ readonly foreign_key_table: null;
213
+ readonly foreign_key_column: null;
214
+ }, {
215
+ readonly name: "name";
216
+ readonly datatype: "text";
217
+ readonly datatype_schema: "pg_catalog";
218
+ readonly pk: true;
219
+ readonly computed: false;
220
+ readonly options: [];
221
+ readonly nullable: true;
222
+ readonly foreign_key_schema: null;
223
+ readonly foreign_key_table: null;
224
+ readonly foreign_key_column: null;
225
+ }, {
226
+ readonly name: "created_at";
227
+ readonly datatype: "timestamp";
228
+ readonly datatype_schema: "pg_catalog";
229
+ readonly pk: false;
230
+ readonly computed: false;
231
+ readonly options: [];
232
+ readonly nullable: true;
233
+ readonly foreign_key_schema: null;
234
+ readonly foreign_key_table: null;
235
+ readonly foreign_key_column: null;
236
+ }];
237
+ }];
238
+ /**
239
+ * Returns a query that returns the current timezone setting of the PostgreSQL database.
240
+ */
241
+ declare function getTimezoneQuery(): Query<{
242
+ timezone: string;
243
+ }>;
244
+ /**
245
+ * For testing purposes.
246
+ */
247
+ declare function mockTimezoneQuery(): [{
248
+ readonly timezone: "UTC";
249
+ }];
250
+
251
+ export { type CTIDasText, type PostgresAdapterRequirements, createPostgresAdapter, getDeleteQuery, getInsertQuery, getSelectQuery, getTablesQuery, getTimezoneQuery, getUpdateQuery, mockIntrospect, mockSelectQuery, mockTablesQuery, mockTimezoneQuery };
@@ -0,0 +1,251 @@
1
+ import { A as Adapter, T as Table, F as FilterOperator, Q as Query, b as AdapterInsertDetails, B as BuilderRequirements, c as AdapterQueryDetails, d as AdapterUpdateDetails, e as AdapterDeleteDetails } from '../../query-C7LxjwdN.js';
2
+ import { Executor } from '../index.js';
3
+ import * as kysely from 'kysely';
4
+
5
+ interface PostgresAdapterRequirements {
6
+ executor: Executor;
7
+ noParameters?: boolean;
8
+ }
9
+ declare function createPostgresAdapter(requirements: PostgresAdapterRequirements): Adapter;
10
+ /**
11
+ * For testing purposes.
12
+ */
13
+ declare function mockIntrospect(): {
14
+ schemas: { [K in "zoo" | "public"]: {
15
+ name: K;
16
+ tables: { [T in "animals" | "users" | "composite_pk"]: Table; };
17
+ }; };
18
+ timezone: "UTC";
19
+ filterOperators: FilterOperator[];
20
+ query: Query;
21
+ };
22
+
23
+ /**
24
+ * `ctid` is a system column that represents the physical location of a row in a table.
25
+ * It is a tuple of two integers: `(blockNumber, tupleIndex)`.
26
+ * It is used to uniquely identify a row in a table, even if the row has no primary key, or other unique constraints.
27
+ *
28
+ * Example: '(0,23)' represents the 24th row in the first block of the table.
29
+ */
30
+ type CTIDasText = `(${number},${number})`;
31
+ /**
32
+ * Inserts one or more rows into a table and returns the inserted rows along with their `ctid`.
33
+ */
34
+ declare function getInsertQuery(details: AdapterInsertDetails, requirements?: Omit<BuilderRequirements, "Adapter" | "QueryCompiler">): Query<{
35
+ [x: string]: unknown;
36
+ } & {
37
+ ctid: `(${number},${number})`;
38
+ }>;
39
+ /**
40
+ * Returns a query that selects all columns from a table, along with the `ctid` column, and unbound row count as `oid` (reserved column name that cannot conflict with user columns).
41
+ */
42
+ declare function getSelectQuery(details: AdapterQueryDetails, requirements?: Omit<BuilderRequirements, "Adapter" | "QueryCompiler">): Query<{
43
+ [x: string]: unknown;
44
+ oid: `${bigint}`;
45
+ ctid: `(${number},${number})`;
46
+ }>;
47
+ /**
48
+ * For testing purposes.
49
+ */
50
+ declare function mockSelectQuery(): [{
51
+ readonly created_at: Date;
52
+ readonly ctid: "(0,1)";
53
+ readonly deleted_at: null;
54
+ readonly id: 1;
55
+ readonly name: "John Doe";
56
+ readonly oid: "2";
57
+ readonly role: "admin";
58
+ readonly name_role: "Jonn Doe - admin";
59
+ }, {
60
+ readonly created_at: Date;
61
+ readonly ctid: "(0,2)";
62
+ readonly deleted_at: null;
63
+ readonly id: 2;
64
+ readonly name: "Jane Doe";
65
+ readonly oid: "2";
66
+ readonly role: "poweruser";
67
+ readonly name_role: "Jane Doe - poweruser";
68
+ }];
69
+ /**
70
+ * Returns a query that updates a given row in a table with given changes.
71
+ */
72
+ declare function getUpdateQuery(details: AdapterUpdateDetails, requirements?: Omit<BuilderRequirements, "Adapter" | "QueryCompiler">): Query<{
73
+ [x: string]: unknown;
74
+ ctid: `(${number},${number})`;
75
+ __ps_updated_at__: `${bigint}`;
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>;
81
+
82
+ /**
83
+ * Returns a query that returns metadata for all user-defined tables and views in the database.
84
+ */
85
+ declare function getTablesQuery(requirements?: Omit<BuilderRequirements, "Adapter" | "QueryCompiler">): Query<{
86
+ schema: string;
87
+ name: string;
88
+ columns: {
89
+ name: string;
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;
95
+ pk: boolean;
96
+ computed: boolean;
97
+ nullable: boolean;
98
+ options: string[];
99
+ }[];
100
+ }>;
101
+ /**
102
+ * For testing purposes.
103
+ */
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
+ }, {
131
+ readonly schema: "public";
132
+ readonly name: "users";
133
+ readonly columns: [{
134
+ readonly name: "id";
135
+ readonly datatype: "int4";
136
+ readonly datatype_schema: "pg_catalog";
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;
144
+ }, {
145
+ readonly name: "created_at";
146
+ readonly datatype: "timestamp";
147
+ readonly datatype_schema: "pg_catalog";
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;
166
+ }, {
167
+ readonly name: "role";
168
+ readonly datatype: "varchar";
169
+ readonly datatype_schema: "pg_catalog";
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;
177
+ }, {
178
+ readonly name: "name";
179
+ readonly datatype: "varchar";
180
+ readonly datatype_schema: "pg_catalog";
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;
188
+ }, {
189
+ readonly name: "name_role";
190
+ readonly datatype: "text";
191
+ readonly datatype_schema: "pg_catalog";
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;
199
+ }];
200
+ }, {
201
+ readonly schema: "public";
202
+ readonly name: "composite_pk";
203
+ readonly columns: [{
204
+ readonly name: "id";
205
+ readonly datatype: "uuid";
206
+ readonly datatype_schema: "pg_catalog";
207
+ readonly pk: true;
208
+ readonly computed: false;
209
+ readonly options: [];
210
+ readonly nullable: false;
211
+ readonly foreign_key_schema: null;
212
+ readonly foreign_key_table: null;
213
+ readonly foreign_key_column: null;
214
+ }, {
215
+ readonly name: "name";
216
+ readonly datatype: "text";
217
+ readonly datatype_schema: "pg_catalog";
218
+ readonly pk: true;
219
+ readonly computed: false;
220
+ readonly options: [];
221
+ readonly nullable: true;
222
+ readonly foreign_key_schema: null;
223
+ readonly foreign_key_table: null;
224
+ readonly foreign_key_column: null;
225
+ }, {
226
+ readonly name: "created_at";
227
+ readonly datatype: "timestamp";
228
+ readonly datatype_schema: "pg_catalog";
229
+ readonly pk: false;
230
+ readonly computed: false;
231
+ readonly options: [];
232
+ readonly nullable: true;
233
+ readonly foreign_key_schema: null;
234
+ readonly foreign_key_table: null;
235
+ readonly foreign_key_column: null;
236
+ }];
237
+ }];
238
+ /**
239
+ * Returns a query that returns the current timezone setting of the PostgreSQL database.
240
+ */
241
+ declare function getTimezoneQuery(): Query<{
242
+ timezone: string;
243
+ }>;
244
+ /**
245
+ * For testing purposes.
246
+ */
247
+ declare function mockTimezoneQuery(): [{
248
+ readonly timezone: "UTC";
249
+ }];
250
+
251
+ export { type CTIDasText, type PostgresAdapterRequirements, createPostgresAdapter, getDeleteQuery, getInsertQuery, getSelectQuery, getTablesQuery, getTimezoneQuery, getUpdateQuery, mockIntrospect, mockSelectQuery, mockTablesQuery, mockTimezoneQuery };
@@ -0,0 +1,10 @@
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-ZB3J55HW.js";import"../../chunk-GSTLSVFG.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