prepareMySQLPush() — drizzle-orm Function Reference
Architecture documentation for the prepareMySQLPush() function in migrate.ts from the drizzle-orm codebase.
Entity Profile
Dependency Diagram
graph TD f33a49b1_2979_711d_4a14_81aa99a6f2a0["prepareMySQLPush()"] b14d3855_8cce_38c9_8952_a9d014c2fb1b["migrate.ts"] f33a49b1_2979_711d_4a14_81aa99a6f2a0 -->|defined in| b14d3855_8cce_38c9_8952_a9d014c2fb1b 205531e5_bccd_7be7_bb95_69ddeac3a4a2["prepareMySqlDbPushSnapshot()"] f33a49b1_2979_711d_4a14_81aa99a6f2a0 -->|calls| 205531e5_bccd_7be7_bb95_69ddeac3a4a2 f3976464_9993_b7cc_1cb7_d8087b203650["squashMysqlScheme()"] f33a49b1_2979_711d_4a14_81aa99a6f2a0 -->|calls| f3976464_9993_b7cc_1cb7_d8087b203650 a5972ffc_ff1b_9523_2495_5373af710e65["applyMysqlSnapshotsDiff()"] f33a49b1_2979_711d_4a14_81aa99a6f2a0 -->|calls| a5972ffc_ff1b_9523_2495_5373af710e65 b0ef3d06_896b_eefc_c410_dfb419673d70["error()"] f33a49b1_2979_711d_4a14_81aa99a6f2a0 -->|calls| b0ef3d06_896b_eefc_c410_dfb419673d70 style f33a49b1_2979_711d_4a14_81aa99a6f2a0 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
drizzle-kit/src/cli/commands/migrate.ts lines 491–525
export const prepareMySQLPush = async (
schemaPath: string | string[],
snapshot: MySqlSchema,
casing: CasingType | undefined,
) => {
try {
const { prev, cur } = await prepareMySqlDbPushSnapshot(
snapshot,
schemaPath,
casing,
);
const validatedPrev = mysqlSchema.parse(prev);
const validatedCur = mysqlSchema.parse(cur);
const squashedPrev = squashMysqlScheme(validatedPrev);
const squashedCur = squashMysqlScheme(validatedCur);
const { sqlStatements, statements } = await applyMysqlSnapshotsDiff(
squashedPrev,
squashedCur,
tablesResolver,
columnsResolver,
mySqlViewsResolver,
validatedPrev,
validatedCur,
'push',
);
return { sqlStatements, statements, validatedCur, validatedPrev };
} catch (e) {
console.error(e);
process.exit(1);
}
};
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does prepareMySQLPush() do?
prepareMySQLPush() is a function in the drizzle-orm codebase, defined in drizzle-kit/src/cli/commands/migrate.ts.
Where is prepareMySQLPush() defined?
prepareMySQLPush() is defined in drizzle-kit/src/cli/commands/migrate.ts at line 491.
What does prepareMySQLPush() call?
prepareMySQLPush() calls 4 function(s): applyMysqlSnapshotsDiff, error, prepareMySqlDbPushSnapshot, squashMysqlScheme.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free