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

Function resolveTables

drizzle-kit/src/simulator.ts:73–86  ·  view source on GitHub ↗
(added: T[], removed: T[])

Source from the content-addressed store, hash-verified

71handlers.push(new DryRun());
72
73export const resolveTables = <T extends Named>(added: T[], removed: T[]) => {
74 const handler = handlers.filter((it) => {
75 return it.can(added, removed);
76 }).exactlyOne();
77
78 if (!handler) {
79 console.log('added', added.map((it) => it.name).join());
80 console.log('removed', removed.map((it) => it.name).join());
81 throw new Error('No handler');
82 }
83
84 console.log(`Simluated by ${handler.constructor.name}`);
85 return handler.handle(added, removed);
86};
87class LehaColumnsHandler<T extends Named> implements ColumnsHandler<T> {
88 can(tableName: string, _: T[], __: T[]): boolean {
89 return tableName === 'users';

Callers

nothing calls this directly

Calls 3

exactlyOneMethod · 0.80
canMethod · 0.65
handleMethod · 0.65

Tested by

no test coverage detected