@vantreeseba/drizzle-graphql 12.0.1 → 13.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 +99 -11
- package/dist/index.cjs +157 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +453 -55
- package/dist/index.d.ts +453 -55
- package/dist/index.js +157 -39
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -7,6 +7,291 @@ import { SQLiteAsyncDatabase } from "drizzle-orm/sqlite-core";
|
|
|
7
7
|
import "drizzle-orm/sqlite-core/query-builders/query";
|
|
8
8
|
import { ASTNode, GraphQLEnumType, GraphQLError, GraphQLFieldResolver, GraphQLInputObjectType, GraphQLInputType, GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLOutputType, GraphQLResolveInfo, GraphQLScalarType, GraphQLSchema } from "graphql";
|
|
9
9
|
import { GraphQLDate, GraphQLDateTime, GraphQLJSON, GraphQLUUID } from "graphql-scalars";
|
|
10
|
+
//#region src/util/type-naming.d.ts
|
|
11
|
+
/** A word the rules decline to decide. Widens the keys derived from it rather than guessing. */
|
|
12
|
+
type Unresolved = string;
|
|
13
|
+
type Letter = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z';
|
|
14
|
+
type Vowel = 'a' | 'e' | 'i' | 'o' | 'u';
|
|
15
|
+
/** `pluralize`'s `[^aou]` class, from the `[^aou]us` stem both directions share. */
|
|
16
|
+
type NotAOU = Exclude<Letter, 'a' | 'o' | 'u'>;
|
|
17
|
+
/** True when `S` ends with any member of the union `Suffix`. */
|
|
18
|
+
type EndsWith<S extends string, Suffix extends string> = Lowercase<S> extends `${string}${Suffix}` ? true : false;
|
|
19
|
+
/**
|
|
20
|
+
* `pluralize`'s uncountable list: these are their own singular *and* plural. Trimmed to the
|
|
21
|
+
* entries that could plausibly name a table; the corpus test pins the ones that are here.
|
|
22
|
+
*/
|
|
23
|
+
type Uncountable = 'advice' | 'agenda' | 'aid' | 'aircraft' | 'alcohol' | 'ammo' | 'analytics' | 'anime' | 'athletics' | 'audio' | 'blood' | 'cash' | 'chassis' | 'chess' | 'clothing' | 'commerce' | 'cooperation' | 'corps' | 'debris' | 'digestion' | 'energy' | 'equipment' | 'expertise' | 'firmware' | 'fun' | 'garbage' | 'graffiti' | 'hardware' | 'headquarters' | 'health' | 'homework' | 'housework' | 'information' | 'jeans' | 'justice' | 'kudos' | 'labour' | 'literature' | 'machinery' | 'mail' | 'manga' | 'media' | 'mews' | 'music' | 'mud' | 'news' | 'personnel' | 'plankton' | 'pliers' | 'police' | 'pollution' | 'premises' | 'rain' | 'research' | 'rice' | 'scissors' | 'series' | 'sewage' | 'shambles' | 'software' | 'species' | 'staff' | 'tennis' | 'traffic' | 'transportation' | 'wealth' | 'welfare' | 'wildlife';
|
|
24
|
+
/** The same list's regex members, as the endings they stand for. */
|
|
25
|
+
type UncountableEnding = 'fish' | 'deer' | 'sheep' | 'pox' | 'measles' | 'pokemon' | 'pokémon' | `${Exclude<Letter, Vowel>}ese` | `o${'i' | 'u'}s`;
|
|
26
|
+
/**
|
|
27
|
+
* `pluralize`'s irregular pairs, minus the pronouns, plus the handful of words whose rule is
|
|
28
|
+
* `\b`-anchored and so behaves as a whole word: `mice`/`lice` from `\b((?:tit)?m|l)ice$`,
|
|
29
|
+
* `people` and `children` from their own rules, and `lives` from the guarded `li` in the
|
|
30
|
+
* `-ves` rule that leaves `olives` alone.
|
|
31
|
+
*/
|
|
32
|
+
type IrregularPlurals = {
|
|
33
|
+
anathema: 'anathemata';
|
|
34
|
+
axe: 'axes';
|
|
35
|
+
carve: 'carves';
|
|
36
|
+
child: 'children';
|
|
37
|
+
die: 'dice';
|
|
38
|
+
dingo: 'dingoes';
|
|
39
|
+
dogma: 'dogmata';
|
|
40
|
+
eave: 'eaves';
|
|
41
|
+
echo: 'echoes';
|
|
42
|
+
foot: 'feet';
|
|
43
|
+
genus: 'genera';
|
|
44
|
+
goose: 'geese';
|
|
45
|
+
groove: 'grooves';
|
|
46
|
+
human: 'humans';
|
|
47
|
+
lemma: 'lemmata';
|
|
48
|
+
life: 'lives';
|
|
49
|
+
louse: 'lice';
|
|
50
|
+
man: 'men';
|
|
51
|
+
mouse: 'mice';
|
|
52
|
+
ox: 'oxen';
|
|
53
|
+
passerby: 'passersby';
|
|
54
|
+
person: 'people';
|
|
55
|
+
pickaxe: 'pickaxes';
|
|
56
|
+
proof: 'proofs';
|
|
57
|
+
quiz: 'quizzes';
|
|
58
|
+
schema: 'schemata';
|
|
59
|
+
stigma: 'stigmata';
|
|
60
|
+
stoma: 'stomata';
|
|
61
|
+
thief: 'thieves';
|
|
62
|
+
titmouse: 'titmice';
|
|
63
|
+
tooth: 'teeth';
|
|
64
|
+
tornado: 'tornadoes';
|
|
65
|
+
torpedo: 'torpedoes';
|
|
66
|
+
valve: 'valves';
|
|
67
|
+
viscus: 'viscera';
|
|
68
|
+
volcano: 'volcanoes';
|
|
69
|
+
yes: 'yeses';
|
|
70
|
+
};
|
|
71
|
+
type IrregularSingulars = {
|
|
72
|
+
anathemata: 'anathema';
|
|
73
|
+
axes: 'axe';
|
|
74
|
+
carves: 'carve';
|
|
75
|
+
children: 'child';
|
|
76
|
+
dice: 'die';
|
|
77
|
+
dingoes: 'dingo';
|
|
78
|
+
dogmata: 'dogma';
|
|
79
|
+
eaves: 'eave';
|
|
80
|
+
echoes: 'echo';
|
|
81
|
+
feet: 'foot';
|
|
82
|
+
geese: 'goose';
|
|
83
|
+
genera: 'genus';
|
|
84
|
+
grooves: 'groove';
|
|
85
|
+
humans: 'human';
|
|
86
|
+
lemmata: 'lemma';
|
|
87
|
+
lice: 'louse';
|
|
88
|
+
lives: 'life';
|
|
89
|
+
men: 'man';
|
|
90
|
+
mice: 'mouse';
|
|
91
|
+
oxen: 'ox';
|
|
92
|
+
passersby: 'passerby';
|
|
93
|
+
people: 'person';
|
|
94
|
+
pickaxes: 'pickaxe';
|
|
95
|
+
proofs: 'proof';
|
|
96
|
+
quizzes: 'quiz';
|
|
97
|
+
schemata: 'schema';
|
|
98
|
+
stigmata: 'stigma';
|
|
99
|
+
stomata: 'stoma';
|
|
100
|
+
teeth: 'tooth';
|
|
101
|
+
thieves: 'thief';
|
|
102
|
+
titmice: 'titmouse';
|
|
103
|
+
tornadoes: 'tornado';
|
|
104
|
+
torpedoes: 'torpedo';
|
|
105
|
+
valves: 'valve';
|
|
106
|
+
viscera: 'viscus';
|
|
107
|
+
volcanoes: 'volcano';
|
|
108
|
+
yeses: 'yes';
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* The stems that keep their `ie` instead of collapsing to `y`. `pluralize` anchors this rule
|
|
112
|
+
* at a word boundary, so these are whole stems and not endings: `ties` gives `tie` and
|
|
113
|
+
* `cuties` gives `cutie`, but `oldies` gives `oldy` and `cookies` gives `cooky`. Guessing
|
|
114
|
+
* from the ending is precisely what does not work here, hence the list.
|
|
115
|
+
*/
|
|
116
|
+
type IeWholeStem = 'l' | 't' | 'neckt' | 'crosst' | 'coll' | 'faer' | 'food' | 'gen' | 'goon' | 'group' | 'lass' | 'talk' | 'goal' | 'p' | 'cut' | 'zomb';
|
|
117
|
+
/** `\b(mon|smil)ies$` — the two stems that take `ey` rather than `y` or `ie`. */
|
|
118
|
+
type EyWholeStem = 'mon' | 'smil';
|
|
119
|
+
/** `(movie|twelve|abuse|e[mn]u)s$` — words that just drop the `s`, ahead of the `ies` rule. */
|
|
120
|
+
type PlainSStem = 'movie' | 'twelve' | 'abuse' | `e${'m' | 'n'}u`;
|
|
121
|
+
/**
|
|
122
|
+
* Stems the big `(x|ch|ss|sh|zz|…)(?:es)?$` rule strips `es` from — the ones expressible as a
|
|
123
|
+
* plain ending. Its character-class members are {@link EsClassStem}, since a union of endings
|
|
124
|
+
* cannot say "any letter but these".
|
|
125
|
+
*/
|
|
126
|
+
type EsStem = 'x' | 'ch' | 'ss' | 'sh' | 'zz' | 'tto' | 'go' | 'cho' | 'alias' | 'gas' | 'hero' | 'ato' | 'gro';
|
|
127
|
+
/** The same rule's character classes, expanded into the unions they stand for. */
|
|
128
|
+
type EsClassStem = `${NotAOU}us` | `t${'l' | 'm'}as` | `${Vowel}ris`;
|
|
129
|
+
/**
|
|
130
|
+
* `(agend|addend|…|quor)(?:a|um)$` and `(apheli|…|automat)(?:a|on)$`. Both directions read
|
|
131
|
+
* these as endings rather than whole words, so `metadata` gives `metadatum`.
|
|
132
|
+
*/
|
|
133
|
+
type AToUmStem = 'agend' | 'addend' | 'millenni' | 'dat' | 'extrem' | 'bacteri' | 'desiderat' | 'strat' | 'candelabr' | 'errat' | 'ov' | 'symposi' | 'curricul' | 'quor';
|
|
134
|
+
type AToOnStem = 'apheli' | 'hyperbat' | 'periheli' | 'asyndet' | 'noumen' | 'phenomen' | 'criteri' | 'organ' | 'prolegomen' | 'hedr' | 'automat';
|
|
135
|
+
/** `(ax|test)is$` -> `es`. */
|
|
136
|
+
type AxisStem = 'ax' | 'test';
|
|
137
|
+
/** `(analy|diagno|…)(?:sis|ses)$` — the `-sis` family, which keeps its `sis`. */
|
|
138
|
+
type SisStem = 'analy' | 'diagno' | 'parenthe' | 'progno' | 'synop' | 'the' | 'empha' | 'cri' | 'ne';
|
|
139
|
+
/**
|
|
140
|
+
* `-ves` plurals that restore an `f` or `fe`. These are endings, not whole words, so
|
|
141
|
+
* `bookshelves` gives `bookshelf` and `housewives` gives `housewife` — but `archives`,
|
|
142
|
+
* `olives` and `sieves` match none of them and fall through to the plain `s` drop, which is
|
|
143
|
+
* the whole point of listing the stems rather than keying off `ves`.
|
|
144
|
+
*/
|
|
145
|
+
type VesToFStem = 'ar' | 'wol' | 'al' | 'el' | 'ea' | 'eo' | 'oa' | 'oo';
|
|
146
|
+
type VesToFeStem = 'wi' | 'kni';
|
|
147
|
+
/** The same rule's `\b`-anchored `li`, which is why `lives` is `life` but `olives` is `olive`. */
|
|
148
|
+
type LiWholeStem = 'li' | `${'after' | 'half' | 'high' | 'low' | 'mid' | 'night' | 'non'}li`;
|
|
149
|
+
/** `(cod|mur|sil|vert|ind)ices$` -> `ex` and `(matr|append)ices$` -> `ix`. */
|
|
150
|
+
type IcesToExStem = 'cod' | 'mur' | 'sil' | 'vert' | 'ind';
|
|
151
|
+
type IcesToIxStem = 'matr' | 'append';
|
|
152
|
+
/** Latin plurals whose singular no ending-based rule recovers. */
|
|
153
|
+
type LatinSingulars = {
|
|
154
|
+
addenda: 'addendum';
|
|
155
|
+
algae: 'alga';
|
|
156
|
+
alumnae: 'alumna';
|
|
157
|
+
alumni: 'alumnus';
|
|
158
|
+
bacteria: 'bacterium';
|
|
159
|
+
cacti: 'cactus';
|
|
160
|
+
candelabra: 'candelabrum';
|
|
161
|
+
cherubim: 'cherub';
|
|
162
|
+
criteria: 'criterion';
|
|
163
|
+
curricula: 'curriculum';
|
|
164
|
+
data: 'datum';
|
|
165
|
+
errata: 'erratum';
|
|
166
|
+
foci: 'focus';
|
|
167
|
+
fungi: 'fungus';
|
|
168
|
+
millennia: 'millennium';
|
|
169
|
+
nuclei: 'nucleus';
|
|
170
|
+
ova: 'ovum';
|
|
171
|
+
phenomena: 'phenomenon';
|
|
172
|
+
radii: 'radius';
|
|
173
|
+
seraphim: 'seraph';
|
|
174
|
+
strata: 'stratum';
|
|
175
|
+
syllabi: 'syllabus';
|
|
176
|
+
symposia: 'symposium';
|
|
177
|
+
termini: 'terminus';
|
|
178
|
+
testes: 'testis';
|
|
179
|
+
vertebrae: 'vertebra';
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* Endings the rules above leave undecided and the plain `s` drop would get wrong — Latin
|
|
183
|
+
* stems and the `-is` family, mostly. A word ending in one of these that matched nothing
|
|
184
|
+
* earlier is left unresolved rather than guessed at.
|
|
185
|
+
*/
|
|
186
|
+
type UndecidedSingularEnding = 'a' | 'i' | 'ae' | 'im' | 'ice' | 'ren' | 'eaux' | 'is';
|
|
187
|
+
/**
|
|
188
|
+
* The singular of a table key, as `pluralize.singular` would return it — or `string` where
|
|
189
|
+
* these rules decline to decide. Matching is case-insensitive, and the word's interior case
|
|
190
|
+
* survives (`auditLogs` -> `auditLog`); a whole-word match comes back lower case, which is
|
|
191
|
+
* immaterial since every caller re-cases the first letter anyway.
|
|
192
|
+
*/
|
|
193
|
+
type Singularize<S extends string> = Lowercase<S> extends Uncountable ? Lowercase<S> : EndsWith<S, UncountableEnding> extends true ? S : Lowercase<S> extends keyof IrregularPlurals ? Lowercase<S> : Lowercase<S> extends keyof IrregularSingulars ? IrregularSingulars[Lowercase<S>] : Lowercase<S> extends keyof LatinSingulars ? LatinSingulars[Lowercase<S>] : S extends `${infer A}men` ? `${A}man` : S extends `${infer A}s` ? SingularizeS<S, A> : S extends `${infer A}a` ? SingularizeA<A> : EndsWith<S, EsStem | EsClassStem> extends true ? S : EndsWith<S, UndecidedSingularEnding> extends true ? Unresolved : S;
|
|
194
|
+
/** The `…s` forks, in `pluralize`'s priority order, each testing a stem it has already split. */
|
|
195
|
+
type SingularizeS<S extends string, A extends string> = EndsWith<A, PlainSStem> extends true ? A : S extends `${infer B}ies` ? SingularizeIes<S, B> : EndsWith<S, 'ss'> extends true ? S : S extends `${infer B}ses` ? SingularizeSes<S, B> : S extends `${infer B}ves` ? SingularizeVes<B> : S extends `${infer B}ices` ? SingularizeIces<B> : S extends `${infer B}es` ? SingularizeEs<S, B> : S extends `${infer B}sis` ? SingularizeSis<S, B> : EndsWith<S, EsStem | EsClassStem> extends true ? S : EndsWith<S, UndecidedSingularEnding> extends true ? Unresolved : A;
|
|
196
|
+
/** `(analy|…)sis$` is already singular; any other `-sis` word the rules leave alone. */
|
|
197
|
+
type SingularizeSis<S extends string, A extends string> = EndsWith<A, SisStem> extends true ? S : Unresolved;
|
|
198
|
+
/** `(agend|…)a$` -> `um` and `(apheli|…)a$` -> `on`, both read as endings. */
|
|
199
|
+
type SingularizeA<A extends string> = EndsWith<A, AToOnStem> extends true ? `${A}on` : EndsWith<A, AToUmStem> extends true ? `${A}um` : Unresolved;
|
|
200
|
+
/** `…ies` -> `y`, `ie` or `ey`, following `pluralize`'s three competing `ies` rules. */
|
|
201
|
+
type SingularizeIes<S extends string, A extends string> = Lowercase<A> extends EyWholeStem ? `${A}ey` : Lowercase<A> extends IeWholeStem ? `${A}ie` : EndsWith<S, 'ss'> extends true ? S : `${A}y`;
|
|
202
|
+
/**
|
|
203
|
+
* The `…ses` fork. `(analy|…)(?:sis|ses)$` restores that family's `sis`; anything else ending
|
|
204
|
+
* in `ses` is an ordinary `es` plural (`houses`, `roses`, `statuses`) and is handed on.
|
|
205
|
+
*/
|
|
206
|
+
type SingularizeSes<S extends string, A extends string> = EndsWith<A, SisStem> extends true ? `${A}sis` : S extends `${infer B}es` ? SingularizeEs<S, B> : Unresolved;
|
|
207
|
+
/** The `…ves` fork: `f`/`fe` for the listed stems, an ordinary `e` for everything else. */
|
|
208
|
+
type SingularizeVes<A extends string> = Lowercase<A> extends LiWholeStem ? `${A}fe` : EndsWith<A, VesToFeStem> extends true ? `${A}fe` : EndsWith<A, VesToFStem> extends true ? `${A}f` : `${A}ve`;
|
|
209
|
+
/** The `…ices` fork: `ex`, `ix`, or — for `invoices` and its like — an ordinary `e`. */
|
|
210
|
+
type SingularizeIces<A extends string> = EndsWith<A, IcesToExStem> extends true ? `${A}ex` : EndsWith<A, IcesToIxStem> extends true ? `${A}ix` : `${A}ice`;
|
|
211
|
+
/** The `…es` fork: strip `es` for the stems that call for it, else drop the trailing `s`. */
|
|
212
|
+
type SingularizeEs<S extends string, A extends string> = EndsWith<A, EsStem | EsClassStem> extends true ? A : EndsWith<S, UndecidedSingularEnding> extends true ? Unresolved : `${A}e`;
|
|
213
|
+
/** `([^aeiouy]|qu)y$` -> `ies`. A vowel before the `y` keeps it: `days`, not `daies`. */
|
|
214
|
+
type ConsonantBeforeY = Exclude<Letter, Vowel | 'y'>;
|
|
215
|
+
/** `(x|ch|ss|sh|zz)$` and `(alias|t[lm]as|gas|ris)$`, both -> `es`. */
|
|
216
|
+
type PluralEsStem = 'x' | 'ch' | 'ss' | 'sh' | 'zz' | 'alias' | 'gas' | 'ris' | `t${'l' | 'm'}as`;
|
|
217
|
+
/** `(her|at|gr)o$` -> `oes`. */
|
|
218
|
+
type OesStem = 'hero' | 'ato' | 'gro';
|
|
219
|
+
/** `(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$` -> `ices`. */
|
|
220
|
+
type IcesStem = 'matr' | 'cod' | 'mur' | 'sil' | 'vert' | 'ind' | 'append';
|
|
221
|
+
/** `(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$` -> `ves`. */
|
|
222
|
+
type FToVesStem = 'ar' | 'l' | 'ea' | 'eo' | 'oa' | 'hoo';
|
|
223
|
+
type FeToVesStem = 'kni' | 'wi' | 'li';
|
|
224
|
+
/** `(apheli|…|criteri|organ|…|automat)(?:a|on)$` -> `a`. */
|
|
225
|
+
type OnToAStem = 'apheli' | 'hyperbat' | 'periheli' | 'asyndet' | 'noumen' | 'phenomen' | 'criteri' | 'organ' | 'prolegomen' | 'hedr' | 'automat';
|
|
226
|
+
/** `(alumn|syllab|vir|…|strat)(?:us|i)$` -> `i`, which outranks the `[^aou]us` -> `es` rule. */
|
|
227
|
+
type UsToIStem = 'alumn' | 'syllab' | 'vir' | 'radi' | 'nucle' | 'fung' | 'cact' | 'stimul' | 'termin' | 'bacill' | 'foc' | 'uter' | 'loc' | 'strat';
|
|
228
|
+
/** `(seraph|cherub)(?:im)?$` -> `im`. */
|
|
229
|
+
type ImStem = 'seraph' | 'cherub';
|
|
230
|
+
/**
|
|
231
|
+
* Endings `pluralize` handles with rules these types do not reproduce: the Latin `-a`/`-um`
|
|
232
|
+
* and `-ae` stems, the `([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$` rule that leaves `atlas`
|
|
233
|
+
* alone, `(ax|test)is$`, and `eaux$`. Left unresolved, not guessed.
|
|
234
|
+
*/
|
|
235
|
+
type UndecidedPluralEnding = 'ae' | 'i' | 'ias' | 'las' | `${'i' | 'u'}am` | 'eaux';
|
|
236
|
+
/**
|
|
237
|
+
* The plural of a table key, as `pluralize.plural` would return it — or `string` where these
|
|
238
|
+
* rules decline to decide. A key that is already plural comes back unchanged, because
|
|
239
|
+
* `pluralize`'s base rule is `s?$` -> `s` rather than a bare append.
|
|
240
|
+
*/
|
|
241
|
+
type Pluralize<S extends string> = Lowercase<S> extends Uncountable ? Lowercase<S> : EndsWith<S, UncountableEnding> extends true ? S : Lowercase<S> extends keyof IrregularPlurals ? IrregularPlurals[Lowercase<S>] : Lowercase<S> extends keyof IrregularSingulars ? Lowercase<S> : Lowercase<S> extends keyof LatinSingulars ? Lowercase<S> : S extends `${infer A}m${'a' | 'e'}n` ? `${A}men` : S extends `${infer A}${'ix' | 'ex'}` ? PluralizeIxEx<S, A> : S extends `${infer A}${'i' | 'e' | 'o'}${'l' | 'n'}ey` ? PluralizeEy<S, A> : S extends `${infer A}${ConsonantBeforeY}y` ? PluralizeY<S, A> : S extends `${infer A}fe` ? PluralizeFe<S, A> : S extends `${infer A}f` ? PluralizeF<S, A> : S extends `${infer A}sis` ? `${A}ses` : S extends `${infer A}on` ? PluralizeOn<S, A> : S extends `${infer A}um` ? PluralizeUm<A> : S extends `${infer A}a` ? PluralizeA<A> : S extends `${infer A}is` ? PluralizeIs<A> : S extends `${infer A}us` ? PluralizeUs<S, A> : EndsWith<S, ImStem> extends true ? `${S}im` : EndsWith<S, UndecidedPluralEnding> extends true ? Unresolved : EndsWith<S, OesStem> extends true ? `${S}es` : EndsWith<S, PluralEsStem> extends true ? `${S}es` : S extends `${infer A}s` ? `${A}s` : `${S}s`;
|
|
242
|
+
/** Re-attaches the consonant the ending split off, so `category` -> `categories`. */
|
|
243
|
+
type PluralizeY<S extends string, A extends string> = S extends `${A}${infer C}y` ? `${A}${C}ies` : Unresolved;
|
|
244
|
+
/** `([^ch][ieo][ln])ey$` -> `ies`; any other `-ey` word falls through to the `y` rules. */
|
|
245
|
+
type PluralizeEy<S extends string, A extends string> = EndsWith<A, Exclude<Letter, 'c' | 'h'>> extends true ? S extends `${A}${infer Mid}ey` ? `${A}${Mid}ies` : Unresolved : `${S}s`;
|
|
246
|
+
/** `(kni|wi|li)fe$` -> `ves`; any other `-fe` word just takes an `s`. */
|
|
247
|
+
type PluralizeFe<S extends string, A extends string> = EndsWith<A, FeToVesStem> extends true ? `${A}ves` : `${S}s`;
|
|
248
|
+
/** `(ar|l|ea|eo|oa|hoo)f$` -> `ves`; `belief`, `roof` and `chef` take an `s`. */
|
|
249
|
+
type PluralizeF<S extends string, A extends string> = EndsWith<A, FToVesStem> extends true ? `${A}ves` : `${S}s`;
|
|
250
|
+
/** `(matr|cod|…|append)(?:ix|ex)$` -> `ices`; `prefix` and `apex` fall to the `x` -> `es` rule. */
|
|
251
|
+
type PluralizeIxEx<S extends string, A extends string> = EndsWith<A, IcesStem> extends true ? `${A}ices` : `${S}es`;
|
|
252
|
+
/** `(agend|…)um$` -> `a`; `album` and `aquarium` take an `s`. */
|
|
253
|
+
type PluralizeUm<A extends string> = EndsWith<A, AToUmStem> extends true ? `${A}a` : `${A}ums`;
|
|
254
|
+
/** A word already in its Latin `-a` plural stays put; `area` and `villa` take an `s`. */
|
|
255
|
+
type PluralizeA<A extends string> = EndsWith<A, AToUmStem | AToOnStem> extends true ? `${A}a` : `${A}as`;
|
|
256
|
+
/** `(ax|test)is$` -> `es`; every other `-is` word is left undecided. */
|
|
257
|
+
type PluralizeIs<A extends string> = EndsWith<A, AxisStem> extends true ? `${A}es` : Unresolved;
|
|
258
|
+
/** `(criteri|phenomen|…)on$` -> `a`; `session` and `icon` take an `s`. */
|
|
259
|
+
type PluralizeOn<S extends string, A extends string> = EndsWith<A, OnToAStem> extends true ? `${A}a` : `${S}s`;
|
|
260
|
+
/**
|
|
261
|
+
* The two `-us` rules, in priority order: the Latin stems take `i` (`focus` -> `foci`), and
|
|
262
|
+
* `[^aou]us` takes `es` (`bus` -> `buses`, `status` -> `statuses`). A `-us` word that is
|
|
263
|
+
* neither — one with `a`, `o` or `u` before the `us` — just takes an `s`.
|
|
264
|
+
*/
|
|
265
|
+
type PluralizeUs<S extends string, A extends string> = EndsWith<A, UsToIStem> extends true ? `${A}i` : EndsWith<S, `${NotAOU}us`> extends true ? `${S}es` : `${S}s`;
|
|
266
|
+
/**
|
|
267
|
+
* How a build's `typeNameMapper` decides the keys of the generated entity maps.
|
|
268
|
+
*
|
|
269
|
+
* - `false` — no mapper. Every noun is the table key itself and the one-row operations keep
|
|
270
|
+
* their `Single` suffix, which is exactly what these types described before singularization
|
|
271
|
+
* existed.
|
|
272
|
+
* - `'singularize'` — the built-in preset, whose two nouns {@link Singularize} and
|
|
273
|
+
* {@link Pluralize} replicate. The one-row operations take the singular noun and no suffix.
|
|
274
|
+
* - `'loose'` — a mapper function, whose output no type can know. Every noun widens to
|
|
275
|
+
* `string`, so the entity maps fall back to an index signature rather than naming fields the
|
|
276
|
+
* build does not publish.
|
|
277
|
+
*/
|
|
278
|
+
type TypeNaming = 'singularize' | 'loose' | false;
|
|
279
|
+
/** The naming modes whose nouns a type can actually name. */
|
|
280
|
+
type KnownNaming = Exclude<TypeNaming, 'loose'>;
|
|
281
|
+
/** The noun the plural (set-of-rows) operations are named from. */
|
|
282
|
+
type PluralNoun<TNaming extends KnownNaming, TName extends string> = TNaming extends 'singularize' ? Pluralize<TName> : TName;
|
|
283
|
+
/** The noun the singular (one-row) operations and the object type are named from. */
|
|
284
|
+
type SingularNoun<TNaming extends KnownNaming, TName extends string> = TNaming extends 'singularize' ? Singularize<TName> : TName;
|
|
285
|
+
/** The plural noun as a root field name starts — `users` in `usersAggregate`. */
|
|
286
|
+
type LowerPlural<TNaming extends TypeNaming, TName extends string> = TNaming extends 'loose' ? string : Uncapitalize<PluralNoun<Extract<TNaming, KnownNaming>, TName>>;
|
|
287
|
+
/** The plural noun as a field name continues — `Users` in `createUsers`. */
|
|
288
|
+
type UpperPlural<TNaming extends TypeNaming, TName extends string> = TNaming extends 'loose' ? string : Capitalize<PluralNoun<Extract<TNaming, KnownNaming>, TName>>;
|
|
289
|
+
/** The singular noun as a root field name starts — `user` in `user(where:)`. */
|
|
290
|
+
type LowerSingular<TNaming extends TypeNaming, TName extends string> = TNaming extends 'loose' ? string : Uncapitalize<SingularNoun<Extract<TNaming, KnownNaming>, TName>>;
|
|
291
|
+
/** The singular noun as a type or field name continues — `User` in `UserFilters`. */
|
|
292
|
+
type UpperSingular<TNaming extends TypeNaming, TName extends string> = TNaming extends 'loose' ? string : Capitalize<SingularNoun<Extract<TNaming, KnownNaming>, TName>>;
|
|
293
|
+
type SingleSuffix<TNaming extends TypeNaming> = TNaming extends 'singularize' ? '' : TNaming extends 'loose' ? string : 'Single';
|
|
294
|
+
//#endregion
|
|
10
295
|
//#region src/util/extensions.d.ts
|
|
11
296
|
/**
|
|
12
297
|
* The identity a generated field publishes about itself, under `extensions.drizzle`.
|
|
@@ -281,6 +566,23 @@ type EnumNameInfo = {
|
|
|
281
566
|
* `BuildSchemaConfig.enumNameMapper`.
|
|
282
567
|
*/
|
|
283
568
|
type EnumNameMapper = (info: EnumNameInfo) => string | undefined;
|
|
569
|
+
/**
|
|
570
|
+
* Everything an {@link EnumValueNameMapper} needs to name one value of a generated enum: the
|
|
571
|
+
* value itself, plus the same context an {@link EnumNameMapper} gets for the enum around it.
|
|
572
|
+
*/
|
|
573
|
+
type EnumValueNameInfo = EnumNameInfo & {
|
|
574
|
+
/** The stored value being named. It stays the GraphQL value's internal `value` either way. */
|
|
575
|
+
value: string;
|
|
576
|
+
/** The value's position in {@link EnumNameInfo.values}. */
|
|
577
|
+
index: number;
|
|
578
|
+
/** The GraphQL type name the enum was given — after `enumNameMapper`, if there is one. */
|
|
579
|
+
typeName: string;
|
|
580
|
+
};
|
|
581
|
+
/**
|
|
582
|
+
* Names one value of a generated GraphQL enum. Return `undefined` to keep the default name.
|
|
583
|
+
* See `BuildSchemaConfig.enumValueNameMapper`.
|
|
584
|
+
*/
|
|
585
|
+
type EnumValueNameMapper = (info: EnumValueNameInfo) => string | undefined;
|
|
284
586
|
/** Context handed to the documentation and deprecation hooks alongside the column itself. */
|
|
285
587
|
type ColumnDocInfo = {
|
|
286
588
|
/** The table's key in the Drizzle schema object. */
|
|
@@ -517,6 +819,10 @@ type WriteHookPayload = {
|
|
|
517
819
|
* The rows the write produced, as the database returned them — before the output mapper,
|
|
518
820
|
* so values are database-shaped. Empty at the `before` position, and on MySQL, whose
|
|
519
821
|
* mutations return no rows.
|
|
822
|
+
*
|
|
823
|
+
* Each row holds the columns the client's selection asked for (plus any key a relation or
|
|
824
|
+
* nested write needed), **and** every column the hook names in `columns`. A column the
|
|
825
|
+
* client did not select and the hook did not name is absent.
|
|
520
826
|
*/
|
|
521
827
|
rows: any[];
|
|
522
828
|
context: any;
|
|
@@ -528,12 +834,26 @@ type WriteHook = (payload: WriteHookPayload) => void | Promise<void>;
|
|
|
528
834
|
type WriteHookPositions = {
|
|
529
835
|
before?: WriteHook;
|
|
530
836
|
after?: WriteHook;
|
|
837
|
+
/**
|
|
838
|
+
* Columns the `after` hook's `rows` always carry, whatever the client selected: a list of
|
|
839
|
+
* column keys (the table object's property names, as `rows` is keyed), or `'all'` for
|
|
840
|
+
* every column of the table. They are added to the statement's `RETURNING` and taken back
|
|
841
|
+
* off before the result is mapped, so the client's response is unchanged.
|
|
842
|
+
*
|
|
843
|
+
* An unknown column fails the build, and so does `columns` without an `after` hook. On a
|
|
844
|
+
* top-level (every-table) registration a named column must exist on every table.
|
|
845
|
+
*/
|
|
846
|
+
columns?: readonly string[] | 'all';
|
|
531
847
|
};
|
|
532
848
|
type WriteHooks = WriteHook | WriteHookPositions;
|
|
533
|
-
/**
|
|
849
|
+
/**
|
|
850
|
+
* Resolved, per-field hooks: `undefined` when the table registered none. `columns` is the
|
|
851
|
+
* hook's `columns` resolved against the table, or `undefined` when it named none.
|
|
852
|
+
*/
|
|
534
853
|
type ResolvedWriteHooks = {
|
|
535
854
|
before?: WriteHook;
|
|
536
855
|
after?: WriteHook;
|
|
856
|
+
columns?: Record<string, Column>;
|
|
537
857
|
};
|
|
538
858
|
/** Build-time lookup of a table's hooks, installed on {@link TablePolicies}. */
|
|
539
859
|
type WriteHookFor = (tableName: string, operation: WriteOperation) => ResolvedWriteHooks | undefined;
|
|
@@ -765,6 +1085,8 @@ type AnyDrizzleDB<TSchema extends Record<string, any>> = PgAsyncDatabase<any, TS
|
|
|
765
1085
|
* The two branches differ in one detail: a module's members are `readonly`, a
|
|
766
1086
|
* relations config's are not, so the derived entity types are `readonly` only on that path.
|
|
767
1087
|
*/
|
|
1088
|
+
/** The Drizzle schema a database handle carries. */
|
|
1089
|
+
type SchemaOf<TDatabase> = TDatabase extends AnyDrizzleDB<infer ISchema> ? ISchema : never;
|
|
768
1090
|
type ExtractTables<TSchema extends Record<string, Table | unknown>> = TSchema extends TablesRelationalConfig ? { [K in keyof TSchema]: TSchema[K]['table'] extends (infer TTable extends Table) ? TTable : never; } : { [K in keyof TSchema as TSchema[K] extends Table ? K : never]: TSchema[K] extends Table ? TSchema[K] : never; };
|
|
769
1091
|
type ExtractRelations<TSchema extends Record<string, Table | unknown>> = { [K in keyof TSchema as TSchema[K] extends Relations ? K : never]: TSchema[K] extends Relations ? TSchema[K] : never; };
|
|
770
1092
|
type ExtractTableRelations<TTable extends Table, TSchemaRelations extends Record<string, Relations>> = { [K in keyof TSchemaRelations as TSchemaRelations[K]['table']['_']['name'] extends TTable['_']['name'] ? K : never]: TSchemaRelations[K]['table']['_']['name'] extends TTable['_']['name'] ? TSchemaRelations[K] extends Relations<any, infer RelationConfig> ? RelationConfig : never : never; };
|
|
@@ -866,8 +1188,8 @@ type DeleteResolver<TTable extends Table, IsReturnless extends boolean> = (sourc
|
|
|
866
1188
|
* out. Throws before writing anything when `where` matches more than one row.
|
|
867
1189
|
*/
|
|
868
1190
|
type DeleteSingleResolver<TTable extends Table, IsReturnless extends boolean> = (source: any, args: DeleteSingleArgs<TTable>, context: any, info: GraphQLResolveInfo) => Promise<IsReturnless extends false ? GetRemappedTableDataType<TTable> | undefined : MutationReturnlessResult>;
|
|
869
|
-
type QueriesCore<TSchemaTables extends Record<string, Table>, TSchemaRelations extends Record<string, Relations>, TInputs extends Record<string, GraphQLInputObjectType>, TOutputs extends Record<string, GraphQLObjectType
|
|
870
|
-
type: GraphQLNonNull<GraphQLList<GraphQLNonNull<TOutputs[
|
|
1191
|
+
type QueriesCore<TSchemaTables extends Record<string, Table>, TSchemaRelations extends Record<string, Relations>, TInputs extends Record<string, GraphQLInputObjectType>, TOutputs extends Record<string, GraphQLObjectType>, TNaming extends TypeNaming = false> = { [TName in keyof TSchemaTables as TName extends string ? `${LowerPlural<TNaming, TName>}` : never]: TName extends string ? {
|
|
1192
|
+
type: GraphQLNonNull<GraphQLList<GraphQLNonNull<TOutputs[UpperSingular<TNaming, TName>]>>>;
|
|
871
1193
|
args: {
|
|
872
1194
|
offset: {
|
|
873
1195
|
type: GraphQLScalarType<number, number>;
|
|
@@ -876,120 +1198,120 @@ type QueriesCore<TSchemaTables extends Record<string, Table>, TSchemaRelations e
|
|
|
876
1198
|
type: GraphQLScalarType<number, number>;
|
|
877
1199
|
};
|
|
878
1200
|
orderBy: {
|
|
879
|
-
type: TInputs[`${
|
|
1201
|
+
type: TInputs[`${UpperSingular<TNaming, TName>}OrderBy`] extends GraphQLInputObjectType ? TInputs[`${UpperSingular<TNaming, TName>}OrderBy`] : never;
|
|
880
1202
|
};
|
|
881
1203
|
where: {
|
|
882
|
-
type: TInputs[`${
|
|
1204
|
+
type: TInputs[`${UpperSingular<TNaming, TName>}Filters`] extends GraphQLInputObjectType ? TInputs[`${UpperSingular<TNaming, TName>}Filters`] : never;
|
|
883
1205
|
};
|
|
884
1206
|
distinct: {
|
|
885
1207
|
type: GraphQLList<GraphQLNonNull<GraphQLEnumType>>;
|
|
886
1208
|
};
|
|
887
1209
|
};
|
|
888
1210
|
resolve: SelectResolver<TSchemaTables[TName], TSchemaTables, ExtractTableRelations<TSchemaTables[TName], TSchemaRelations> extends (infer R) ? R[keyof R] : never>;
|
|
889
|
-
} : never; } & { [TName in keyof TSchemaTables as TName extends string ? `${
|
|
890
|
-
type: TOutputs[
|
|
1211
|
+
} : never; } & { [TName in keyof TSchemaTables as TName extends string ? `${LowerSingular<TNaming, TName>}${SingleSuffix<TNaming>}` : never]: TName extends string ? {
|
|
1212
|
+
type: TOutputs[UpperSingular<TNaming, TName>];
|
|
891
1213
|
args: {
|
|
892
1214
|
offset: {
|
|
893
1215
|
type: GraphQLScalarType<number, number>;
|
|
894
1216
|
};
|
|
895
1217
|
orderBy: {
|
|
896
|
-
type: TInputs[`${
|
|
1218
|
+
type: TInputs[`${UpperSingular<TNaming, TName>}OrderBy`] extends GraphQLInputObjectType ? TInputs[`${UpperSingular<TNaming, TName>}OrderBy`] : never;
|
|
897
1219
|
};
|
|
898
1220
|
where: {
|
|
899
|
-
type: TInputs[`${
|
|
1221
|
+
type: TInputs[`${UpperSingular<TNaming, TName>}Filters`] extends GraphQLInputObjectType ? TInputs[`${UpperSingular<TNaming, TName>}Filters`] : never;
|
|
900
1222
|
};
|
|
901
1223
|
};
|
|
902
1224
|
resolve: SelectSingleResolver<TSchemaTables[TName], TSchemaTables, ExtractTableRelations<TSchemaTables[TName], TSchemaRelations> extends (infer R) ? R[keyof R] : never>;
|
|
903
|
-
} : never; } & { [TName in keyof TSchemaTables as TName extends string ? `${
|
|
904
|
-
type: GraphQLNonNull<TOutputs[`${
|
|
1225
|
+
} : never; } & { [TName in keyof TSchemaTables as TName extends string ? `${LowerPlural<TNaming, TName>}Aggregate` : never]: TName extends string ? {
|
|
1226
|
+
type: GraphQLNonNull<TOutputs[`${UpperSingular<TNaming, TName>}Aggregate`] extends GraphQLObjectType ? TOutputs[`${UpperSingular<TNaming, TName>}Aggregate`] : GraphQLObjectType>;
|
|
905
1227
|
args: {
|
|
906
1228
|
where: {
|
|
907
|
-
type: TInputs[`${
|
|
1229
|
+
type: TInputs[`${UpperSingular<TNaming, TName>}Filters`] extends GraphQLInputObjectType ? TInputs[`${UpperSingular<TNaming, TName>}Filters`] : never;
|
|
908
1230
|
};
|
|
909
1231
|
};
|
|
910
1232
|
resolve: AggregateResolver<TSchemaTables[TName]>;
|
|
911
1233
|
} : never; };
|
|
912
|
-
type MutationsCore<TSchemaTables extends Record<string, Table>, TInputs extends Record<string, GraphQLInputObjectType>, TOutputs extends Record<string, GraphQLObjectType>, IsReturnless extends boolean> = { [TName in keyof TSchemaTables as TName extends string ? `create${
|
|
913
|
-
type: IsReturnless extends true ? TOutputs['MutationReturn'] extends GraphQLObjectType ? TOutputs['MutationReturn'] : never : GraphQLNonNull<GraphQLList<GraphQLNonNull<TOutputs[
|
|
1234
|
+
type MutationsCore<TSchemaTables extends Record<string, Table>, TInputs extends Record<string, GraphQLInputObjectType>, TOutputs extends Record<string, GraphQLObjectType>, IsReturnless extends boolean, TNaming extends TypeNaming = false> = { [TName in keyof TSchemaTables as TName extends string ? `create${UpperPlural<TNaming, TName>}` : never]: TName extends string ? {
|
|
1235
|
+
type: IsReturnless extends true ? TOutputs['MutationReturn'] extends GraphQLObjectType ? TOutputs['MutationReturn'] : never : GraphQLNonNull<GraphQLList<GraphQLNonNull<TOutputs[UpperSingular<TNaming, TName>]>>>;
|
|
914
1236
|
args: {
|
|
915
1237
|
values: {
|
|
916
|
-
type: GraphQLNonNull<GraphQLList<GraphQLNonNull<TInputs[`Create${
|
|
1238
|
+
type: GraphQLNonNull<GraphQLList<GraphQLNonNull<TInputs[`Create${UpperSingular<TNaming, TName>}Input`]>>>;
|
|
917
1239
|
};
|
|
918
1240
|
};
|
|
919
1241
|
resolve: InsertArrResolver<TSchemaTables[TName], IsReturnless>;
|
|
920
|
-
} : never; } & { [TName in keyof TSchemaTables as TName extends string ? `create${
|
|
921
|
-
type: IsReturnless extends true ? TOutputs['MutationReturn'] extends GraphQLObjectType ? TOutputs['MutationReturn'] : never : TOutputs[
|
|
1242
|
+
} : never; } & { [TName in keyof TSchemaTables as TName extends string ? `create${UpperSingular<TNaming, TName>}${SingleSuffix<TNaming>}` : never]: TName extends string ? {
|
|
1243
|
+
type: IsReturnless extends true ? TOutputs['MutationReturn'] extends GraphQLObjectType ? TOutputs['MutationReturn'] : never : TOutputs[UpperSingular<TNaming, TName>];
|
|
922
1244
|
args: {
|
|
923
1245
|
values: {
|
|
924
|
-
type: GraphQLNonNull<TInputs[`Create${
|
|
1246
|
+
type: GraphQLNonNull<TInputs[`Create${UpperSingular<TNaming, TName>}Input`]>;
|
|
925
1247
|
};
|
|
926
1248
|
};
|
|
927
1249
|
resolve: InsertResolver<TSchemaTables[TName], IsReturnless>;
|
|
928
|
-
} : never; } & { [TName in keyof TSchemaTables as TName extends string ? `upsert${
|
|
929
|
-
type: IsReturnless extends true ? TOutputs['MutationReturn'] extends GraphQLObjectType ? TOutputs['MutationReturn'] : never : GraphQLNonNull<GraphQLList<GraphQLNonNull<TOutputs[
|
|
1250
|
+
} : never; } & { [TName in keyof TSchemaTables as TName extends string ? `upsert${UpperPlural<TNaming, TName>}` : never]?: TName extends string ? {
|
|
1251
|
+
type: IsReturnless extends true ? TOutputs['MutationReturn'] extends GraphQLObjectType ? TOutputs['MutationReturn'] : never : GraphQLNonNull<GraphQLList<GraphQLNonNull<TOutputs[UpperSingular<TNaming, TName>]>>>;
|
|
930
1252
|
args: {
|
|
931
1253
|
values: {
|
|
932
|
-
type: GraphQLNonNull<GraphQLList<GraphQLNonNull<TInputs[`Create${
|
|
1254
|
+
type: GraphQLNonNull<GraphQLList<GraphQLNonNull<TInputs[`Create${UpperSingular<TNaming, TName>}Input`]>>>;
|
|
933
1255
|
};
|
|
934
1256
|
onConflict: {
|
|
935
1257
|
type: GraphQLInputObjectType;
|
|
936
1258
|
};
|
|
937
1259
|
};
|
|
938
1260
|
resolve: UpsertArrResolver<TSchemaTables[TName], IsReturnless>;
|
|
939
|
-
} : never; } & { [TName in keyof TSchemaTables as TName extends string ? `upsert${
|
|
940
|
-
type: IsReturnless extends true ? TOutputs['MutationReturn'] extends GraphQLObjectType ? TOutputs['MutationReturn'] : never : TOutputs[
|
|
1261
|
+
} : never; } & { [TName in keyof TSchemaTables as TName extends string ? `upsert${UpperSingular<TNaming, TName>}${SingleSuffix<TNaming>}` : never]?: TName extends string ? {
|
|
1262
|
+
type: IsReturnless extends true ? TOutputs['MutationReturn'] extends GraphQLObjectType ? TOutputs['MutationReturn'] : never : TOutputs[UpperSingular<TNaming, TName>];
|
|
941
1263
|
args: {
|
|
942
1264
|
values: {
|
|
943
|
-
type: GraphQLNonNull<TInputs[`Create${
|
|
1265
|
+
type: GraphQLNonNull<TInputs[`Create${UpperSingular<TNaming, TName>}Input`]>;
|
|
944
1266
|
};
|
|
945
1267
|
onConflict: {
|
|
946
1268
|
type: GraphQLInputObjectType;
|
|
947
1269
|
};
|
|
948
1270
|
};
|
|
949
1271
|
resolve: UpsertResolver<TSchemaTables[TName], IsReturnless>;
|
|
950
|
-
} : never; } & { [TName in keyof TSchemaTables as TName extends string ? `update${
|
|
951
|
-
type: IsReturnless extends true ? TOutputs['MutationReturn'] extends GraphQLObjectType ? TOutputs['MutationReturn'] : never : GraphQLNonNull<GraphQLList<GraphQLNonNull<TOutputs[
|
|
1272
|
+
} : never; } & { [TName in keyof TSchemaTables as TName extends string ? `update${UpperPlural<TNaming, TName>}` : never]: TName extends string ? {
|
|
1273
|
+
type: IsReturnless extends true ? TOutputs['MutationReturn'] extends GraphQLObjectType ? TOutputs['MutationReturn'] : never : GraphQLNonNull<GraphQLList<GraphQLNonNull<TOutputs[UpperSingular<TNaming, TName>]>>>;
|
|
952
1274
|
args: {
|
|
953
1275
|
set: {
|
|
954
|
-
type: GraphQLNonNull<TInputs[`Update${
|
|
1276
|
+
type: GraphQLNonNull<TInputs[`Update${UpperSingular<TNaming, TName>}Input`]>;
|
|
955
1277
|
};
|
|
956
1278
|
where: {
|
|
957
|
-
type: TInputs[`${
|
|
1279
|
+
type: TInputs[`${UpperSingular<TNaming, TName>}Filters`] extends GraphQLInputObjectType ? TInputs[`${UpperSingular<TNaming, TName>}Filters`] : never;
|
|
958
1280
|
};
|
|
959
1281
|
};
|
|
960
1282
|
resolve: UpdateResolver<TSchemaTables[TName], IsReturnless>;
|
|
961
|
-
} : never; } & { [TName in keyof TSchemaTables as TName extends string ? `update${
|
|
962
|
-
type: IsReturnless extends true ? TOutputs['MutationReturn'] extends GraphQLObjectType ? TOutputs['MutationReturn'] : never : GraphQLNonNull<GraphQLList<TOutputs[
|
|
1283
|
+
} : never; } & { [TName in keyof TSchemaTables as TName extends string ? `update${UpperPlural<TNaming, TName>}Many` : never]: TName extends string ? {
|
|
1284
|
+
type: IsReturnless extends true ? TOutputs['MutationReturn'] extends GraphQLObjectType ? TOutputs['MutationReturn'] : never : GraphQLNonNull<GraphQLList<TOutputs[UpperSingular<TNaming, TName>]>>;
|
|
963
1285
|
args: {
|
|
964
1286
|
updates: {
|
|
965
|
-
type: GraphQLNonNull<GraphQLList<GraphQLNonNull<TInputs[`Update${
|
|
1287
|
+
type: GraphQLNonNull<GraphQLList<GraphQLNonNull<TInputs[`Update${UpperSingular<TNaming, TName>}ManyInput`]>>>;
|
|
966
1288
|
};
|
|
967
1289
|
};
|
|
968
1290
|
resolve: UpdateManyResolver<TSchemaTables[TName], IsReturnless>;
|
|
969
|
-
} : never; } & { [TName in keyof TSchemaTables as TName extends string ? `update${
|
|
970
|
-
type: IsReturnless extends true ? TOutputs['MutationReturn'] extends GraphQLObjectType ? TOutputs['MutationReturn'] : never : TOutputs[
|
|
1291
|
+
} : never; } & { [TName in keyof TSchemaTables as TName extends string ? `update${UpperSingular<TNaming, TName>}${SingleSuffix<TNaming>}` : never]: TName extends string ? {
|
|
1292
|
+
type: IsReturnless extends true ? TOutputs['MutationReturn'] extends GraphQLObjectType ? TOutputs['MutationReturn'] : never : TOutputs[UpperSingular<TNaming, TName>];
|
|
971
1293
|
args: {
|
|
972
1294
|
set: {
|
|
973
|
-
type: GraphQLNonNull<TInputs[`Update${
|
|
1295
|
+
type: GraphQLNonNull<TInputs[`Update${UpperSingular<TNaming, TName>}Input`]>;
|
|
974
1296
|
};
|
|
975
1297
|
where: {
|
|
976
|
-
type: GraphQLNonNull<TInputs[`${
|
|
1298
|
+
type: GraphQLNonNull<TInputs[`${UpperSingular<TNaming, TName>}Filters`] extends GraphQLInputObjectType ? TInputs[`${UpperSingular<TNaming, TName>}Filters`] : never>;
|
|
977
1299
|
};
|
|
978
1300
|
};
|
|
979
1301
|
resolve: UpdateSingleResolver<TSchemaTables[TName], IsReturnless>;
|
|
980
|
-
} : never; } & { [TName in keyof TSchemaTables as TName extends string ? `delete${
|
|
981
|
-
type: IsReturnless extends true ? TOutputs['MutationReturn'] extends GraphQLObjectType ? TOutputs['MutationReturn'] : never : GraphQLNonNull<GraphQLList<GraphQLNonNull<TOutputs[
|
|
1302
|
+
} : never; } & { [TName in keyof TSchemaTables as TName extends string ? `delete${UpperPlural<TNaming, TName>}` : never]: TName extends string ? {
|
|
1303
|
+
type: IsReturnless extends true ? TOutputs['MutationReturn'] extends GraphQLObjectType ? TOutputs['MutationReturn'] : never : GraphQLNonNull<GraphQLList<GraphQLNonNull<TOutputs[UpperSingular<TNaming, TName>]>>>;
|
|
982
1304
|
args: {
|
|
983
1305
|
where: {
|
|
984
|
-
type: TInputs[`${
|
|
1306
|
+
type: TInputs[`${UpperSingular<TNaming, TName>}Filters`] extends GraphQLInputObjectType ? TInputs[`${UpperSingular<TNaming, TName>}Filters`] : never;
|
|
985
1307
|
};
|
|
986
1308
|
};
|
|
987
1309
|
resolve: DeleteResolver<TSchemaTables[TName], IsReturnless>;
|
|
988
|
-
} : never; } & { [TName in keyof TSchemaTables as TName extends string ? `delete${
|
|
989
|
-
type: IsReturnless extends true ? TOutputs['MutationReturn'] extends GraphQLObjectType ? TOutputs['MutationReturn'] : never : TOutputs[
|
|
1310
|
+
} : never; } & { [TName in keyof TSchemaTables as TName extends string ? `delete${UpperSingular<TNaming, TName>}${SingleSuffix<TNaming>}` : never]: TName extends string ? {
|
|
1311
|
+
type: IsReturnless extends true ? TOutputs['MutationReturn'] extends GraphQLObjectType ? TOutputs['MutationReturn'] : never : TOutputs[UpperSingular<TNaming, TName>];
|
|
990
1312
|
args: {
|
|
991
1313
|
where: {
|
|
992
|
-
type: GraphQLNonNull<TInputs[`${
|
|
1314
|
+
type: GraphQLNonNull<TInputs[`${UpperSingular<TNaming, TName>}Filters`] extends GraphQLInputObjectType ? TInputs[`${UpperSingular<TNaming, TName>}Filters`] : never>;
|
|
993
1315
|
};
|
|
994
1316
|
};
|
|
995
1317
|
resolve: DeleteSingleResolver<TSchemaTables[TName], IsReturnless>;
|
|
@@ -1003,7 +1325,7 @@ type MutationsCore<TSchemaTables extends Record<string, Table>, TInputs extends
|
|
|
1003
1325
|
* enabled — `${Table}OnConflict` for upsert, `${Table}Having` for group-by — are not listed,
|
|
1004
1326
|
* since whether they were generated is a runtime decision.
|
|
1005
1327
|
*/
|
|
1006
|
-
type GeneratedInputs<TSchema extends Record<string, Table
|
|
1328
|
+
type GeneratedInputs<TSchema extends Record<string, Table>, TNaming extends TypeNaming = false> = { [TName in keyof TSchema as TName extends string ? `Create${UpperSingular<TNaming, TName>}Input` : never]: GraphQLInputObjectType; } & { [TName in keyof TSchema as TName extends string ? `Update${UpperSingular<TNaming, TName>}Input` : never]: GraphQLInputObjectType; } & { [TName in keyof TSchema as TName extends string ? `Update${UpperSingular<TNaming, TName>}ManyInput` : never]: GraphQLInputObjectType; } & { [TName in keyof TSchema as TName extends string ? `${UpperSingular<TNaming, TName>}OrderBy` : never]: GraphQLInputObjectType; } & { [TName in keyof TSchema as TName extends string ? `${UpperSingular<TNaming, TName>}Filters` : never]: GraphQLInputObjectType; };
|
|
1007
1329
|
/**
|
|
1008
1330
|
* Keys of `entities.types`, which is keyed by generated GraphQL type name.
|
|
1009
1331
|
*
|
|
@@ -1012,12 +1334,12 @@ type GeneratedInputs<TSchema extends Record<string, Table>> = { [TName in keyof
|
|
|
1012
1334
|
* type kept those names long after the generator stopped producing them. MySQL still has a
|
|
1013
1335
|
* shared `MutationReturn` instead of per-table return types, because its writes return no rows.
|
|
1014
1336
|
*/
|
|
1015
|
-
type GeneratedOutputs<TSchema extends Record<string, Table>, IsReturnless extends boolean> = { [TName in keyof TSchema as TName extends string ?
|
|
1337
|
+
type GeneratedOutputs<TSchema extends Record<string, Table>, IsReturnless extends boolean, TNaming extends TypeNaming = false> = { [TName in keyof TSchema as TName extends string ? UpperSingular<TNaming, TName> : never]: GraphQLObjectType; } & { [TName in keyof TSchema as TName extends string ? `${UpperSingular<TNaming, TName>}Aggregate` : never]: GraphQLObjectType; } & (IsReturnless extends true ? {
|
|
1016
1338
|
MutationReturn: GraphQLObjectType;
|
|
1017
|
-
} : { [TName in keyof TSchema as TName extends string ?
|
|
1018
|
-
type GeneratedEntities<TDatabase extends AnyDrizzleDB<TSchema>, TSchema extends Record<string, unknown> = TDatabase
|
|
1019
|
-
queries: QueriesCore<TSchemaTables, TSchemaRelations, TInputs, TOutputs>;
|
|
1020
|
-
mutations: MutationsCore<TSchemaTables, TInputs, TOutputs, TDatabase extends MySqlAsyncDatabase<any, any> ? true : false>;
|
|
1339
|
+
} : { [TName in keyof TSchema as TName extends string ? UpperSingular<TNaming, TName> : never]: GraphQLObjectType; });
|
|
1340
|
+
type GeneratedEntities<TDatabase extends AnyDrizzleDB<TSchema>, TSchema extends Record<string, unknown> = SchemaOf<TDatabase>, TSchemaTables extends ExtractTables<TSchema> = ExtractTables<TSchema>, TSchemaRelations extends ExtractRelations<TSchema> = ExtractRelations<TSchema>, TNaming extends TypeNaming = false, TInputs extends GeneratedInputs<TSchemaTables, TNaming> = GeneratedInputs<TSchemaTables, TNaming>, TOutputs extends GeneratedOutputs<TSchemaTables, TDatabase extends MySqlAsyncDatabase<any, any> ? true : false, TNaming> = GeneratedOutputs<TSchemaTables, TDatabase extends MySqlAsyncDatabase<any, any> ? true : false, TNaming>> = {
|
|
1341
|
+
queries: QueriesCore<TSchemaTables, TSchemaRelations, TInputs, TOutputs, TNaming>;
|
|
1342
|
+
mutations: MutationsCore<TSchemaTables, TInputs, TOutputs, TDatabase extends MySqlAsyncDatabase<any, any> ? true : false, TNaming>;
|
|
1021
1343
|
inputs: TInputs;
|
|
1022
1344
|
types: TOutputs;
|
|
1023
1345
|
/**
|
|
@@ -1028,10 +1350,24 @@ type GeneratedEntities<TDatabase extends AnyDrizzleDB<TSchema>, TSchema extends
|
|
|
1028
1350
|
*/
|
|
1029
1351
|
fieldResolvers: { [TName in keyof TSchemaTables as TName extends string ? TName : never]?: Record<string, (source: any, args: any, context: any, info: GraphQLResolveInfo) => Promise<any>>; };
|
|
1030
1352
|
};
|
|
1031
|
-
type GeneratedData<TDatabase extends AnyDrizzleDB<any
|
|
1353
|
+
type GeneratedData<TDatabase extends AnyDrizzleDB<any>, TNaming extends TypeNaming = false> = {
|
|
1032
1354
|
schema: GraphQLSchema;
|
|
1033
|
-
entities: GeneratedEntities<TDatabase>;
|
|
1355
|
+
entities: GeneratedEntities<TDatabase, SchemaOf<TDatabase>, ExtractTables<SchemaOf<TDatabase>>, ExtractRelations<SchemaOf<TDatabase>>, TNaming>;
|
|
1034
1356
|
};
|
|
1357
|
+
/**
|
|
1358
|
+
* The naming mode a `buildSchema` config selects, which decides how {@link GeneratedEntities}
|
|
1359
|
+
* keys its maps.
|
|
1360
|
+
*
|
|
1361
|
+
* Read off the config's *static* type, so it answers only for a config written inline (or
|
|
1362
|
+
* `as const`): a `typeNameMapper` assigned through a variable of type
|
|
1363
|
+
* {@link BuildSchemaConfig} is invisible here and keys as if there were no mapper, the same
|
|
1364
|
+
* way these types behaved before singularization existed.
|
|
1365
|
+
*/
|
|
1366
|
+
type NamingOf<TConfig> = TConfig extends {
|
|
1367
|
+
typeNameMapper: 'singularize';
|
|
1368
|
+
} ? 'singularize' : TConfig extends {
|
|
1369
|
+
typeNameMapper: (...args: any[]) => any;
|
|
1370
|
+
} ? 'loose' : false;
|
|
1035
1371
|
/**
|
|
1036
1372
|
* A feature switch. `true` / `false` decides for the whole build; a predicate decides per
|
|
1037
1373
|
* table, receiving the table's key in the Drizzle schema.
|
|
@@ -1418,6 +1754,15 @@ type BuildSchemaConfig = {
|
|
|
1418
1754
|
/**
|
|
1419
1755
|
* Customizes query name suffixes for generated GraphQL operations.
|
|
1420
1756
|
*
|
|
1757
|
+
* Both reach every operation that comes in a list/single pair, mutations included. The
|
|
1758
|
+
* variants that carry their own disambiguator — `<plural>Aggregate`, `<plural>GroupBy`,
|
|
1759
|
+
* `update<Table>Many`, `update<Table>Count`, `delete<Table>Count` — take neither.
|
|
1760
|
+
*
|
|
1761
|
+
* The two cannot be the same string unless a {@link BuildSchemaConfig.typeNameMapper} is
|
|
1762
|
+
* also configured: without one both nouns are the table key, so the pair would collapse
|
|
1763
|
+
* onto a single field name. With one, the mapper's singular/plural forms separate every
|
|
1764
|
+
* pair on their own and the single side takes no suffix at all — see `typeNameMapper`.
|
|
1765
|
+
*
|
|
1421
1766
|
* @default { list: '', single: 'Single' }
|
|
1422
1767
|
*/
|
|
1423
1768
|
suffixes?: {
|
|
@@ -1728,8 +2073,12 @@ type BuildSchemaConfig = {
|
|
|
1728
2073
|
* ```ts
|
|
1729
2074
|
* buildSchema(db, {
|
|
1730
2075
|
* onWrite: {
|
|
1731
|
-
* posts:
|
|
1732
|
-
*
|
|
2076
|
+
* posts: {
|
|
2077
|
+
* after: async ({ table, operation, rows, tx }) => {
|
|
2078
|
+
* await tx.insert(auditLog).values(rows.map((row) => ({ table, operation, rowId: row.id })));
|
|
2079
|
+
* },
|
|
2080
|
+
* // `rows` always carries `id`, whether or not the client selected it.
|
|
2081
|
+
* columns: ['id'],
|
|
1733
2082
|
* },
|
|
1734
2083
|
* },
|
|
1735
2084
|
* });
|
|
@@ -1747,6 +2096,13 @@ type BuildSchemaConfig = {
|
|
|
1747
2096
|
* - **Throwing rolls the mutation back.** That is the point of the position.
|
|
1748
2097
|
* - **`rows` are the post-write rows as the database returned them**, before the output
|
|
1749
2098
|
* mapper. Empty at the `before` position, and on MySQL, whose mutations return no rows.
|
|
2099
|
+
* - **A row holds the columns the client selected**, because `RETURNING` is built from the
|
|
2100
|
+
* selection — plus every column the registration names in `columns` (column keys, or
|
|
2101
|
+
* `'all'`). Those are added to `RETURNING` for insert, upsert, update, `updateMany`, delete
|
|
2102
|
+
* and restore, and taken back off before the result is mapped, so the client's response
|
|
2103
|
+
* is unchanged. An unknown column, or `columns` with no `after` hook, fails the build; on
|
|
2104
|
+
* a top-level registration a named column must exist on every table. MySQL returns no
|
|
2105
|
+
* rows, so `columns` has no effect there.
|
|
1750
2106
|
* - The hook fires for the **mutation field's own table**. Rows a nested write creates in
|
|
1751
2107
|
* another table do not fire that table's hook.
|
|
1752
2108
|
*
|
|
@@ -1790,8 +2146,15 @@ type BuildSchemaConfig = {
|
|
|
1790
2146
|
* Return `undefined` for tables that should use the default naming.
|
|
1791
2147
|
*
|
|
1792
2148
|
* Example: `(name) => name === 'users' ? { singular: 'user', plural: 'users' } : undefined`
|
|
1793
|
-
* produces type `User`, queries `users` / `user`, mutations `createUsers` / `createUser
|
|
1794
|
-
*
|
|
2149
|
+
* produces type `User`, queries `users` / `user`, mutations `createUsers` / `createUser`,
|
|
2150
|
+
* `updateUsers` / `updateUser` and `deleteUsers` / `deleteUser` for the `users` table, and
|
|
2151
|
+
* leaves other tables with their default names.
|
|
2152
|
+
*
|
|
2153
|
+
* The noun is what separates a mapped table's pairs — plural on the form that operates on
|
|
2154
|
+
* a set of rows, singular on the one that operates on exactly one — so a mapped table's
|
|
2155
|
+
* operations carry no `Single` suffix, whatever {@link BuildSchemaConfig.suffixes} says.
|
|
2156
|
+
* A table the mapper returns `undefined` for is back on the default naming, where
|
|
2157
|
+
* `suffixes.single` is the only thing separating its pairs.
|
|
1795
2158
|
*
|
|
1796
2159
|
* Pass the string `'singularize'` for the built-in preset, which derives both forms of every
|
|
1797
2160
|
* table key with the library's own `pluralize` — the mapper most schemas with plural table
|
|
@@ -1808,6 +2171,12 @@ type BuildSchemaConfig = {
|
|
|
1808
2171
|
* The function half is the exported {@link TypeNameMapper}, so a mapper can be declared once
|
|
1809
2172
|
* and handed both to `buildSchema` and to `selectionToWith` / `resolveSelection`, which need
|
|
1810
2173
|
* the same naming rule to read a selection back out of a schema built with it.
|
|
2174
|
+
*
|
|
2175
|
+
* `entities` is keyed to match, when the config is written inline so its type is visible:
|
|
2176
|
+
* the preset's two nouns are replicated at the type level, so `entities.queries.task`
|
|
2177
|
+
* autocompletes. A mapper *function* renames types in a way no type can predict, so those
|
|
2178
|
+
* maps fall back to an index signature rather than naming fields the build does not
|
|
2179
|
+
* publish — see {@link NamingOf}.
|
|
1811
2180
|
*/
|
|
1812
2181
|
typeNameMapper?: 'singularize' | TypeNameMapper;
|
|
1813
2182
|
/**
|
|
@@ -2057,6 +2426,35 @@ type BuildSchemaConfig = {
|
|
|
2057
2426
|
* Return `undefined` to keep the default name.
|
|
2058
2427
|
*/
|
|
2059
2428
|
enumNameMapper?: EnumNameMapper;
|
|
2429
|
+
/**
|
|
2430
|
+
* Names the *values* of the generated GraphQL enum types.
|
|
2431
|
+
*
|
|
2432
|
+
* By default a value's GraphQL name is the stored value itself (`'running'` → `running`),
|
|
2433
|
+
* or `Option<index>` when the stored value is not a usable GraphQL name. This hook overrides
|
|
2434
|
+
* that per value — most often to follow GraphQL's SCREAMING_CASE convention while the
|
|
2435
|
+
* database keeps its lowercase values:
|
|
2436
|
+
*
|
|
2437
|
+
* ```ts
|
|
2438
|
+
* buildSchema(db, {
|
|
2439
|
+
* enumValueNameMapper: ({ value }) => value.toUpperCase(),
|
|
2440
|
+
* });
|
|
2441
|
+
* // enum RunsStatusEnum { RUNNING OK ERROR STOPPED }
|
|
2442
|
+
* ```
|
|
2443
|
+
*
|
|
2444
|
+
* Only the GraphQL name changes. Each value's internal `value` stays the stored string, so
|
|
2445
|
+
* filters, create/update inputs, outputs and resolvers keep sending and receiving exactly
|
|
2446
|
+
* what the database stores; the generated TypeScript types keep the stored values too.
|
|
2447
|
+
*
|
|
2448
|
+
* Pass the string `'constant'` for the built-in preset, which CONSTANT_CASEs every value
|
|
2449
|
+
* (`inProgress` / `in-progress` → `IN_PROGRESS`).
|
|
2450
|
+
*
|
|
2451
|
+
* The mapper receives the stored `value`, its `index`, the enum's GraphQL `typeName` (after
|
|
2452
|
+
* `enumNameMapper`), and everything `enumNameMapper` receives. Return `undefined` to keep the
|
|
2453
|
+
* default name for that value. The build throws when a returned name is not a valid GraphQL
|
|
2454
|
+
* enum value name, when two values of one enum map to the same name, or when columns sharing
|
|
2455
|
+
* one enum type would name its values differently.
|
|
2456
|
+
*/
|
|
2457
|
+
enumValueNameMapper?: 'constant' | EnumValueNameMapper;
|
|
2060
2458
|
};
|
|
2061
2459
|
//#endregion
|
|
2062
2460
|
//#region src/util/case-ops/index.d.ts
|
|
@@ -2174,7 +2572,7 @@ type ResolveSelectionOptions = SelectionOptions & {
|
|
|
2174
2572
|
declare const resolveSelection: (info: GraphQLResolveInfo | ResolveTree, options: ResolveSelectionOptions) => Promise<any>;
|
|
2175
2573
|
//#endregion
|
|
2176
2574
|
//#region src/index.d.ts
|
|
2177
|
-
declare const buildSchema: <TDbClient extends AnyDrizzleDB<any
|
|
2575
|
+
declare const buildSchema: <TDbClient extends AnyDrizzleDB<any>, TConfig extends BuildSchemaConfig = BuildSchemaConfig>(db: TDbClient, config?: TConfig) => GeneratedData<TDbClient, NamingOf<TConfig>>;
|
|
2178
2576
|
//#endregion
|
|
2179
|
-
export { type AggregateResolver, type AnyDrizzleDB, type BuildSchemaConfig, type ColumnDeprecator, type ColumnDescriber, type ColumnDocInfo, type ColumnTypeMapper, type ColumnTypeMapperInfo, type ComplexityConfig, type ContextValuesConfig, type DefaultOrderByEntry, type DefaultsConfig, type DeleteResolver, type DeleteSingleResolver, type DerivedTypeNameMapper, type DrizzleErrorCode, type DrizzleErrorContext, type DrizzleExtension, type DrizzleFieldExtension, type DrizzleFieldKind, type DrizzleFieldOperation, type DrizzleTargetArg, type DrizzleTypeExtension, type EnumNameInfo, type EnumNameMapper, type ExtractRelations, type ExtractTableByName, type ExtractTableRelations, type ExtractTables, type FeatureSwitch, type FieldsByTypeName, type GeneratedData, type GeneratedEntities, type GeneratedInputs, type GeneratedOutputs, type GeneratedTypeInfo, type GeneratedTypeKind, GraphQLBigIntString, GraphQLDate, GraphQLDateTime, GraphQLDecimalString, GraphQLJSON, GraphQLUUID, type IdentifiedRows, type InsertArrResolver, type InsertResolver, type LimitsConfig, type MutationReturnlessResult, type MutationsCore, type OnWriteConfig, type ParseResolveInfoOptions, type QueriesCore, type RelationDescriber, type RelationResolverFactory, type ResolveSelectionOptions, type ResolveTree, type RowScope, type RowScopeFilter, type ScalarOverride, type ScalarOverridesConfig, type SchemaDocs, type SchemaExclusions, type SchemaFeatures, type ScopeConfig, type SelectResolver, type SelectSingleResolver, type SelectionOptions, type SoftDeleteColumn, type SoftDeleteConfig, type TableDefaults, type TableDescriber, type TableLimitPolicy, type TableNamedRelations, type TypeNameMapper, type UpdateManyArgs, type UpdateManyEntry, type UpdateManyResolver, type UpdateResolver, type UpdateSingleResolver, type UpsertArgs, type UpsertArrResolver, type UpsertConflictArgs, type UpsertResolver, type WriteHook, type WriteHookPayload, type WriteHookPositions, type WriteHooks, type WriteOperation, buildSchema, createRelationResolverFactory, defaultErrorMapper, drizzleError, drizzleExecutorKey, drizzleExtension, extractFilters, extractOrderBy, extractRelationJoinColumns, identifyRows, isDrizzleFieldExtension, parseResolveInfo, resolveSelection, selectionToWith, singularizeMapper };
|
|
2577
|
+
export { type AggregateResolver, type AnyDrizzleDB, type BuildSchemaConfig, type ColumnDeprecator, type ColumnDescriber, type ColumnDocInfo, type ColumnTypeMapper, type ColumnTypeMapperInfo, type ComplexityConfig, type ContextValuesConfig, type DefaultOrderByEntry, type DefaultsConfig, type DeleteResolver, type DeleteSingleResolver, type DerivedTypeNameMapper, type DrizzleErrorCode, type DrizzleErrorContext, type DrizzleExtension, type DrizzleFieldExtension, type DrizzleFieldKind, type DrizzleFieldOperation, type DrizzleTargetArg, type DrizzleTypeExtension, type EnumNameInfo, type EnumNameMapper, type EnumValueNameInfo, type EnumValueNameMapper, type ExtractRelations, type ExtractTableByName, type ExtractTableRelations, type ExtractTables, type FeatureSwitch, type FieldsByTypeName, type GeneratedData, type GeneratedEntities, type GeneratedInputs, type GeneratedOutputs, type GeneratedTypeInfo, type GeneratedTypeKind, GraphQLBigIntString, GraphQLDate, GraphQLDateTime, GraphQLDecimalString, GraphQLJSON, GraphQLUUID, type IdentifiedRows, type InsertArrResolver, type InsertResolver, type LimitsConfig, type MutationReturnlessResult, type MutationsCore, type NamingOf, type OnWriteConfig, type ParseResolveInfoOptions, type Pluralize, type QueriesCore, type RelationDescriber, type RelationResolverFactory, type ResolveSelectionOptions, type ResolveTree, type RowScope, type RowScopeFilter, type ScalarOverride, type ScalarOverridesConfig, type SchemaDocs, type SchemaExclusions, type SchemaFeatures, type ScopeConfig, type SelectResolver, type SelectSingleResolver, type SelectionOptions, type Singularize, type SoftDeleteColumn, type SoftDeleteConfig, type TableDefaults, type TableDescriber, type TableLimitPolicy, type TableNamedRelations, type TypeNameMapper, type TypeNaming, type UpdateManyArgs, type UpdateManyEntry, type UpdateManyResolver, type UpdateResolver, type UpdateSingleResolver, type UpsertArgs, type UpsertArrResolver, type UpsertConflictArgs, type UpsertResolver, type WriteHook, type WriteHookPayload, type WriteHookPositions, type WriteHooks, type WriteOperation, buildSchema, createRelationResolverFactory, defaultErrorMapper, drizzleError, drizzleExecutorKey, drizzleExtension, extractFilters, extractOrderBy, extractRelationJoinColumns, identifyRows, isDrizzleFieldExtension, parseResolveInfo, resolveSelection, selectionToWith, singularizeMapper };
|
|
2180
2578
|
//# sourceMappingURL=index.d.cts.map
|