Home / Class/ SQLiteBigInt Class — drizzle-orm Architecture

SQLiteBigInt Class — drizzle-orm Architecture

Architecture documentation for the SQLiteBigInt class in blob.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  bfd793a9_5746_1128_6378_17a46760f4cc["SQLiteBigInt"]
  5c8a5ab6_4356_4d2f_782b_4e0b3b38b801["blob.ts"]
  bfd793a9_5746_1128_6378_17a46760f4cc -->|defined in| 5c8a5ab6_4356_4d2f_782b_4e0b3b38b801
  af5b1a4b_2138_3bd0_82ac_cf3ba105ae24["getSQLType()"]
  bfd793a9_5746_1128_6378_17a46760f4cc -->|method| af5b1a4b_2138_3bd0_82ac_cf3ba105ae24
  4fe0cb9f_b714_2cc2_0ed0_7a5af4bb40a2["mapFromDriverValue()"]
  bfd793a9_5746_1128_6378_17a46760f4cc -->|method| 4fe0cb9f_b714_2cc2_0ed0_7a5af4bb40a2
  ec739bf6_dc2f_6c3a_e5d9_5c1e7e917c9d["mapToDriverValue()"]
  bfd793a9_5746_1128_6378_17a46760f4cc -->|method| ec739bf6_dc2f_6c3a_e5d9_5c1e7e917c9d

Relationship Graph

Source Code

drizzle-orm/src/sqlite-core/columns/blob.ts lines 36–62

export class SQLiteBigInt<T extends ColumnBaseConfig<'bigint', 'SQLiteBigInt'>> extends SQLiteColumn<T> {
	static override readonly [entityKind]: string = 'SQLiteBigInt';

	getSQLType(): string {
		return 'blob';
	}

	override mapFromDriverValue(value: Buffer | Uint8Array | ArrayBuffer): bigint {
		if (typeof Buffer !== 'undefined' && Buffer.from) {
			const buf = Buffer.isBuffer(value)
				? value
				// eslint-disable-next-line no-instanceof/no-instanceof
				: value instanceof ArrayBuffer
				? Buffer.from(value)
				: value.buffer
				? Buffer.from(value.buffer, value.byteOffset, value.byteLength)
				: Buffer.from(value);
			return BigInt(buf.toString('utf8'));
		}

		return BigInt(textDecoder!.decode(value));
	}

	override mapToDriverValue(value: bigint): Buffer {
		return Buffer.from(value.toString());
	}
}

Domain

Frequently Asked Questions

What is the SQLiteBigInt class?
SQLiteBigInt is a class in the drizzle-orm codebase, defined in drizzle-orm/src/sqlite-core/columns/blob.ts.
Where is SQLiteBigInt defined?
SQLiteBigInt is defined in drizzle-orm/src/sqlite-core/columns/blob.ts at line 36.

Analyze Your Own Codebase

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

Try Supermodel Free