prepareGenerateConfig() — drizzle-orm Function Reference
Architecture documentation for the prepareGenerateConfig() function in utils.ts from the drizzle-orm codebase.
Entity Profile
Dependency Diagram
graph TD d8e81f13_ca82_f43e_b1af_dd7ca01cbee1["prepareGenerateConfig()"] 09e5bcf1_0f03_3dbd_fbdb_762440f28855["utils.ts"] d8e81f13_ca82_f43e_b1af_dd7ca01cbee1 -->|defined in| 09e5bcf1_0f03_3dbd_fbdb_762440f28855 cb25439a_9bb1_11b4_f51d_495e7dd1da07["generate.transform()"] cb25439a_9bb1_11b4_f51d_495e7dd1da07 -->|calls| d8e81f13_ca82_f43e_b1af_dd7ca01cbee1 face3c40_88e9_a534_6538_9c662631c6f6["drizzleConfigFromFile()"] d8e81f13_ca82_f43e_b1af_dd7ca01cbee1 -->|calls| face3c40_88e9_a534_6538_9c662631c6f6 b0ef3d06_896b_eefc_c410_dfb419673d70["error()"] d8e81f13_ca82_f43e_b1af_dd7ca01cbee1 -->|calls| b0ef3d06_896b_eefc_c410_dfb419673d70 b00190f0_9c7c_acbf_86f7_950ac8c79592["wrapParam()"] d8e81f13_ca82_f43e_b1af_dd7ca01cbee1 -->|calls| b00190f0_9c7c_acbf_86f7_950ac8c79592 d2a6d85b_7d3b_7d17_794c_d2cd77de724c["prepareFilenames()"] d8e81f13_ca82_f43e_b1af_dd7ca01cbee1 -->|calls| d2a6d85b_7d3b_7d17_794c_d2cd77de724c style d8e81f13_ca82_f43e_b1af_dd7ca01cbee1 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
drizzle-kit/src/cli/commands/utils.ts lines 158–206
export const prepareGenerateConfig = async (
options: {
config?: string;
schema?: string;
out?: string;
breakpoints?: boolean;
custom?: boolean;
name?: string;
dialect?: Dialect;
driver?: Driver;
prefix?: Prefix;
casing?: CasingType;
},
from: 'config' | 'cli',
): Promise<GenerateConfig> => {
const config = from === 'config' ? await drizzleConfigFromFile(options.config) : options;
const { schema, out, breakpoints, dialect, driver, casing } = config;
if (!schema || !dialect) {
console.log(error('Please provide required params:'));
console.log(wrapParam('schema', schema));
console.log(wrapParam('dialect', dialect));
console.log(wrapParam('out', out, true));
process.exit(1);
}
const fileNames = prepareFilenames(schema);
if (fileNames.length === 0) {
render(`[${chalk.blue('i')}] No schema file in ${schema} was found`);
process.exit(0);
}
const prefix = ('migrations' in config ? config.migrations?.prefix : options.prefix)
|| 'index';
return {
dialect: dialect,
name: options.name,
custom: options.custom || false,
prefix,
breakpoints: breakpoints ?? true,
schema: schema,
out: out || 'drizzle',
bundle: driver === 'expo' || driver === 'durable-sqlite',
casing,
driver,
};
};
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does prepareGenerateConfig() do?
prepareGenerateConfig() is a function in the drizzle-orm codebase, defined in drizzle-kit/src/cli/commands/utils.ts.
Where is prepareGenerateConfig() defined?
prepareGenerateConfig() is defined in drizzle-kit/src/cli/commands/utils.ts at line 158.
What does prepareGenerateConfig() call?
prepareGenerateConfig() calls 4 function(s): drizzleConfigFromFile, error, prepareFilenames, wrapParam.
What calls prepareGenerateConfig()?
prepareGenerateConfig() is called by 1 function(s): generate.transform.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free