Home / Class/ MySqlDouble Class — drizzle-orm Architecture

MySqlDouble Class — drizzle-orm Architecture

Architecture documentation for the MySqlDouble class in double.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  116aec34_4ef2_8dee_568c_b77dffc8bd93["MySqlDouble"]
  3a3f7d81_aaca_ece9_6332_89b4938ad4ae["double.ts"]
  116aec34_4ef2_8dee_568c_b77dffc8bd93 -->|defined in| 3a3f7d81_aaca_ece9_6332_89b4938ad4ae
  47191642_4503_f191_fbbb_648debca8083["getSQLType()"]
  116aec34_4ef2_8dee_568c_b77dffc8bd93 -->|method| 47191642_4503_f191_fbbb_648debca8083

Relationship Graph

Source Code

drizzle-orm/src/mysql-core/columns/double.ts lines 37–57

export class MySqlDouble<T extends ColumnBaseConfig<'number', 'MySqlDouble'>>
	extends MySqlColumnWithAutoIncrement<T, MySqlDoubleConfig>
{
	static override readonly [entityKind]: string = 'MySqlDouble';

	readonly precision: number | undefined = this.config.precision;
	readonly scale: number | undefined = this.config.scale;
	readonly unsigned: boolean | undefined = this.config.unsigned;

	getSQLType(): string {
		let type = '';
		if (this.precision !== undefined && this.scale !== undefined) {
			type += `double(${this.precision},${this.scale})`;
		} else if (this.precision === undefined) {
			type += 'double';
		} else {
			type += `double(${this.precision})`;
		}
		return this.unsigned ? `${type} unsigned` : type;
	}
}

Domain

Frequently Asked Questions

What is the MySqlDouble class?
MySqlDouble is a class in the drizzle-orm codebase, defined in drizzle-orm/src/mysql-core/columns/double.ts.
Where is MySqlDouble defined?
MySqlDouble is defined in drizzle-orm/src/mysql-core/columns/double.ts at line 37.

Analyze Your Own Codebase

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

Try Supermodel Free