Home / Function/ handleEnumType() — drizzle-orm Function Reference

handleEnumType() — drizzle-orm Function Reference

Architecture documentation for the handleEnumType() function in mysqlSerializer.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  b330e594_2e4f_be5c_50e0_07641c420054["handleEnumType()"]
  1f633f0f_d981_8483_0b8f_fbabf0333ced["mysqlSerializer.ts"]
  b330e594_2e4f_be5c_50e0_07641c420054 -->|defined in| 1f633f0f_d981_8483_0b8f_fbabf0333ced
  d8d7539a_23af_4a3d_91f6_f60bb60e4c38["generateMySqlSnapshot()"]
  d8d7539a_23af_4a3d_91f6_f60bb60e4c38 -->|calls| b330e594_2e4f_be5c_50e0_07641c420054
  6a0cfd17_5e20_42bb_3596_ae02093b0fda["escapeSingleQuotes()"]
  b330e594_2e4f_be5c_50e0_07641c420054 -->|calls| 6a0cfd17_5e20_42bb_3596_ae02093b0fda
  style b330e594_2e4f_be5c_50e0_07641c420054 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-kit/src/serializer/mysqlSerializer.ts lines 36–41

const handleEnumType = (type: string) => {
	let str = type.split('(')[1];
	str = str.substring(0, str.length - 1);
	const values = str.split(',').map((v) => `'${escapeSingleQuotes(v.substring(1, v.length - 1))}'`);
	return `enum(${values.join(',')})`;
};

Domain

Subdomains

Frequently Asked Questions

What does handleEnumType() do?
handleEnumType() is a function in the drizzle-orm codebase, defined in drizzle-kit/src/serializer/mysqlSerializer.ts.
Where is handleEnumType() defined?
handleEnumType() is defined in drizzle-kit/src/serializer/mysqlSerializer.ts at line 36.
What does handleEnumType() call?
handleEnumType() calls 1 function(s): escapeSingleQuotes.
What calls handleEnumType()?
handleEnumType() is called by 1 function(s): generateMySqlSnapshot.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free