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

get() — drizzle-orm Function Reference

Architecture documentation for the get() function in alias.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  8e92df7f_f898_3f9a_f9be_9a9823f94a4f["get()"]
  b4991e83_4bea_3a01_aeb0_ab00b5e6b779["TableAliasProxyHandler"]
  8e92df7f_f898_3f9a_f9be_9a9823f94a4f -->|defined in| b4991e83_4bea_3a01_aeb0_ab00b5e6b779
  50951bff_dee6_567b_2f7e_8f0f762fb6cf["get()"]
  50951bff_dee6_567b_2f7e_8f0f762fb6cf -->|calls| 8e92df7f_f898_3f9a_f9be_9a9823f94a4f
  a40f58bf_d603_3d63_ca91_0e1365452bad["get()"]
  a40f58bf_d603_3d63_ca91_0e1365452bad -->|calls| 8e92df7f_f898_3f9a_f9be_9a9823f94a4f
  c020d230_75a2_3639_d9a6_35f2ba7fd5bc["is()"]
  8e92df7f_f898_3f9a_f9be_9a9823f94a4f -->|calls| c020d230_75a2_3639_d9a6_35f2ba7fd5bc
  50951bff_dee6_567b_2f7e_8f0f762fb6cf["get()"]
  8e92df7f_f898_3f9a_f9be_9a9823f94a4f -->|calls| 50951bff_dee6_567b_2f7e_8f0f762fb6cf
  style 8e92df7f_f898_3f9a_f9be_9a9823f94a4f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/alias.ts lines 29–74

	get(target: T, prop: string | symbol): any {
		if (prop === Table.Symbol.IsAlias) {
			return true;
		}

		if (prop === Table.Symbol.Name) {
			return this.alias;
		}

		if (this.replaceOriginalName && prop === Table.Symbol.OriginalName) {
			return this.alias;
		}

		if (prop === ViewBaseConfig) {
			return {
				...target[ViewBaseConfig as keyof typeof target],
				name: this.alias,
				isAlias: true,
			};
		}

		if (prop === Table.Symbol.Columns) {
			const columns = (target as Table)[Table.Symbol.Columns];
			if (!columns) {
				return columns;
			}

			const proxiedColumns: { [key: string]: any } = {};

			Object.keys(columns).map((key) => {
				proxiedColumns[key] = new Proxy(
					columns[key]!,
					new ColumnAliasProxyHandler(new Proxy(target, this)),
				);
			});

			return proxiedColumns;
		}

		const value = target[prop as keyof typeof target];
		if (is(value, Column)) {
			return new Proxy(value as AnyColumn, new ColumnAliasProxyHandler(new Proxy(target, this)));
		}

		return value;
	}

Domain

Subdomains

Calls

Called By

Frequently Asked Questions

What does get() do?
get() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/alias.ts.
Where is get() defined?
get() is defined in drizzle-orm/src/alias.ts at line 29.
What does get() call?
get() calls 2 function(s): get, is.
What calls get()?
get() is called by 2 function(s): get, get.

Analyze Your Own Codebase

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

Try Supermodel Free