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

from() — drizzle-orm Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  7fd030ef_bac2_595d_4f22_720d453433dd["from()"]
  b3550288_69f4_670f_8c2e_e82d7003a700["PgUpdateBase"]
  7fd030ef_bac2_595d_4f22_720d453433dd -->|defined in| b3550288_69f4_670f_8c2e_e82d7003a700
  style 7fd030ef_bac2_595d_4f22_720d453433dd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/pg-core/query-builders/update.ts lines 381–394

	from<TFrom extends PgTable | Subquery | PgViewBase | SQL>(
		source: TableLikeHasEmptySelection<TFrom> extends true ? DrizzleTypeError<
				"Cannot reference a data-modifying statement subquery if it doesn't contain a `returning` clause"
			>
			: TFrom,
	): PgUpdateWithJoins<this, TDynamic, TFrom> {
		const src = source as TFrom;
		const tableName = getTableLikeName(src);
		if (typeof tableName === 'string') {
			this.joinsNotNullableMap[tableName] = true;
		}
		this.config.from = src;
		return this as any;
	}

Domain

Subdomains

Frequently Asked Questions

What does from() do?
from() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/pg-core/query-builders/update.ts.
Where is from() defined?
from() is defined in drizzle-orm/src/pg-core/query-builders/update.ts at line 381.

Analyze Your Own Codebase

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

Try Supermodel Free