MCPcopy
hub / github.com/drizzle-team/drizzle-orm / refine

Method refine

drizzle-seed/src/index.ts:195–205  ·  view source on GitHub ↗
(
		callback: (
			funcs: FunctionsVersioning<VERSION>,
		) => InferCallbackType<DB, SCHEMA>,
	)

Source from the content-addressed store, hash-verified

193 }
194
195 async refine(
196 callback: (
197 funcs: FunctionsVersioning<VERSION>,
198 ) => InferCallbackType<DB, SCHEMA>,
199 ): Promise<void> {
200 const refinements = this.options?.version === undefined || this.options.version === '2'
201 ? callback(generatorsFuncsV2 as FunctionsVersioning<VERSION>) as RefinementsType
202 : callback(generatorsFuncs as FunctionsVersioning<VERSION>) as RefinementsType;
203
204 await seedFunc(this.db, this.schema, this.options, refinements);
205 }
206}
207
208type FunctionsVersioning<VERSION extends string | undefined> = VERSION extends `1` ? typeof generatorsFuncs

Callers 14

mysql.test.tsFile · 0.80
pg.test.tsFile · 0.80
sqlite.test.tsFile · 0.80
mysql.test.tsFile · 0.80
generators.test.tsFile · 0.80
sqliteTest.tsFile · 0.80
pgTest.tsFile · 0.80
mysqlTest.tsFile · 0.80
pg.test.tsFile · 0.80
generators.test.tsFile · 0.80

Calls 2

callbackFunction · 0.85
seedFuncFunction · 0.85

Tested by

no test coverage detected