Home / Function/ $withAuth() — drizzle-orm Function Reference

$withAuth() — drizzle-orm Function Reference

Architecture documentation for the $withAuth() function in driver.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  2db4716b_9688_9922_c6ec_1ea6772d014f["$withAuth()"]
  b6b337f5_bcc2_5e22_edc8_a716053cc396["NeonHttpDatabase"]
  2db4716b_9688_9922_c6ec_1ea6772d014f -->|defined in| b6b337f5_bcc2_5e22_edc8_a716053cc396
  8c4a41bf_c14a_8a42_f07e_9d1dd21acbf9["wrap()"]
  2db4716b_9688_9922_c6ec_1ea6772d014f -->|calls| 8c4a41bf_c14a_8a42_f07e_9d1dd21acbf9
  style 2db4716b_9688_9922_c6ec_1ea6772d014f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/neon-http/driver.ts lines 85–112

	$withAuth(
		token: Exclude<HTTPQueryOptions<true, true>['authToken'], undefined>,
	): Omit<
		this,
		Exclude<
			keyof this,
			| '$count'
			| 'delete'
			| 'select'
			| 'selectDistinct'
			| 'selectDistinctOn'
			| 'update'
			| 'insert'
			| 'with'
			| 'query'
			| 'execute'
			| 'refreshMaterializedView'
		>
	> {
		this.authToken = token;

		return wrap(this, token, (target, p, res) => {
			if (p === 'with') {
				return wrap(res, token, (_, __, res) => res);
			}
			return res;
		});
	}

Domain

Subdomains

Calls

Frequently Asked Questions

What does $withAuth() do?
$withAuth() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/neon-http/driver.ts.
Where is $withAuth() defined?
$withAuth() is defined in drizzle-orm/src/neon-http/driver.ts at line 85.
What does $withAuth() call?
$withAuth() calls 1 function(s): wrap.

Analyze Your Own Codebase

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

Try Supermodel Free