@@ -15,10 +15,10 @@ describe('generate entities', () => {
15
15
export type JSONObject = { readonly [K in string]?: JSONValue }
16
16
export type JSONArray = readonly JSONValue[]
17
17
18
- export type Foo = {
18
+ export type Foo <OverRelation extends string | never = never> = {
19
19
name: 'Foo'
20
20
unique:
21
- | { id: string }
21
+ | Omit< { id: string}, OverRelation>
22
22
columns: {
23
23
id: string
24
24
stringCol: string | null
@@ -59,10 +59,10 @@ describe('generate entities', () => {
59
59
export type JSONObject = { readonly [K in string]?: JSONValue }
60
60
export type JSONArray = readonly JSONValue[]
61
61
62
- export type Foo = {
62
+ export type Foo <OverRelation extends string | never = never> = {
63
63
name: 'Foo'
64
64
unique:
65
- | { id: string }
65
+ | Omit< { id: string}, OverRelation>
66
66
columns: {
67
67
id: string
68
68
enumCol: FooEnumCol | null
@@ -94,11 +94,11 @@ describe('generate entities', () => {
94
94
export type JSONObject = { readonly [K in string]?: JSONValue }
95
95
export type JSONArray = readonly JSONValue[]
96
96
97
- export type Foo = {
97
+ export type Foo <OverRelation extends string | never = never> = {
98
98
name: 'Foo'
99
99
unique:
100
- | { id: string }
101
- | { oneHasOneInverseRel: Bar['unique'] }
100
+ | Omit< { id: string}, OverRelation>
101
+ | Omit< { oneHasOneInverseRel: Bar['unique']}, OverRelation>
102
102
columns: {
103
103
id: string
104
104
}
@@ -110,11 +110,11 @@ describe('generate entities', () => {
110
110
hasManyBy: {
111
111
}
112
112
}
113
- export type Bar = {
113
+ export type Bar <OverRelation extends string | never = never> = {
114
114
name: 'Bar'
115
115
unique:
116
- | { id: string }
117
- | { oneHasOneOwningRel: Foo['unique'] }
116
+ | Omit< { id: string}, OverRelation>
117
+ | Omit< { oneHasOneOwningRel: Foo['unique']}, OverRelation>
118
118
columns: {
119
119
id: string
120
120
}
@@ -148,26 +148,26 @@ describe('generate entities', () => {
148
148
export type JSONObject = { readonly [K in string]?: JSONValue }
149
149
export type JSONArray = readonly JSONValue[]
150
150
151
- export type Foo = {
151
+ export type Foo <OverRelation extends string | never = never> = {
152
152
name: 'Foo'
153
153
unique:
154
- | { id: string }
155
- | { oneHasManyRel: Bar['unique'] }
154
+ | Omit< { id: string}, OverRelation>
155
+ | Omit< { oneHasManyRel: Bar['unique']}, OverRelation>
156
156
columns: {
157
157
id: string
158
158
}
159
159
hasOne: {
160
160
}
161
161
hasMany: {
162
- oneHasManyRel: Bar
162
+ oneHasManyRel: Bar<'manyHasOneRel'>
163
163
}
164
164
hasManyBy: {
165
165
}
166
166
}
167
- export type Bar = {
167
+ export type Bar <OverRelation extends string | never = never> = {
168
168
name: 'Bar'
169
169
unique:
170
- | { id: string }
170
+ | Omit< { id: string}, OverRelation>
171
171
columns: {
172
172
id: string
173
173
}
@@ -201,10 +201,10 @@ describe('generate entities', () => {
201
201
export type JSONObject = { readonly [K in string]?: JSONValue }
202
202
export type JSONArray = readonly JSONValue[]
203
203
204
- export type Foo = {
204
+ export type Foo <OverRelation extends string | never = never> = {
205
205
name: 'Foo'
206
206
unique:
207
- | { id: string }
207
+ | Omit< { id: string}, OverRelation>
208
208
columns: {
209
209
id: string
210
210
}
@@ -216,10 +216,10 @@ describe('generate entities', () => {
216
216
hasManyBy: {
217
217
}
218
218
}
219
- export type Bar = {
219
+ export type Bar <OverRelation extends string | never = never> = {
220
220
name: 'Bar'
221
221
unique:
222
- | { id: string }
222
+ | Omit< { id: string}, OverRelation>
223
223
columns: {
224
224
id: string
225
225
}
@@ -253,28 +253,28 @@ describe('generate entities', () => {
253
253
export type JSONObject = { readonly [K in string]?: JSONValue }
254
254
export type JSONArray = readonly JSONValue[]
255
255
256
- export type Foo = {
256
+ export type Foo <OverRelation extends string | never = never> = {
257
257
name: 'Foo'
258
258
unique:
259
- | { id: string }
260
- | { locales: FooLocale['unique'] }
259
+ | Omit< { id: string}, OverRelation>
260
+ | Omit< { locales: FooLocale['unique']}, OverRelation>
261
261
columns: {
262
262
id: string
263
263
}
264
264
hasOne: {
265
265
}
266
266
hasMany: {
267
- locales: FooLocale
267
+ locales: FooLocale<'foo'>
268
268
}
269
269
hasManyBy: {
270
270
localesByLocale: { entity: FooLocale; by: {locale: string} }
271
271
}
272
272
}
273
- export type FooLocale = {
273
+ export type FooLocale <OverRelation extends string | never = never> = {
274
274
name: 'FooLocale'
275
275
unique:
276
- | { id: string }
277
- | { locale: string, foo: Foo['unique'] }
276
+ | Omit< { id: string}, OverRelation>
277
+ | Omit< { locale: string, foo: Foo['unique']}, OverRelation>
278
278
columns: {
279
279
id: string
280
280
locale: string
0 commit comments