Home / Type/ OptionalKeyOnly Type — drizzle-orm Architecture

OptionalKeyOnly Type — drizzle-orm Architecture

Architecture documentation for the OptionalKeyOnly type/interface in operations.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  7a277873_e23d_2f84_ad62_145da2cadb1b["OptionalKeyOnly"]
  81d6aa88_255a_3715_9d9a_2e5bec22c3c1["operations.ts"]
  7a277873_e23d_2f84_ad62_145da2cadb1b -->|defined in| 81d6aa88_255a_3715_9d9a_2e5bec22c3c1
  style 7a277873_e23d_2f84_ad62_145da2cadb1b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/operations.ts lines 12–24

export type OptionalKeyOnly<TKey extends string, T extends Column, OverrideT extends boolean | undefined = false> =
	TKey extends RequiredKeyOnly<TKey, T> ? never : T extends {
		_: {
			generated: undefined;
		};
	} ? (T extends {
			_: {
				identity: undefined;
			};
		} ? TKey
			: T['_']['identity'] extends 'always' ? OverrideT extends true ? TKey : never
			: TKey)
	: never;

Frequently Asked Questions

What is the OptionalKeyOnly type?
OptionalKeyOnly is a type/interface in the drizzle-orm codebase, defined in drizzle-orm/src/operations.ts.
Where is OptionalKeyOnly defined?
OptionalKeyOnly is defined in drizzle-orm/src/operations.ts at line 12.

Analyze Your Own Codebase

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

Try Supermodel Free