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

mysqlPushIntrospect() — drizzle-orm Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  e301d4cf_9417_da89_bf52_34424366b957["mysqlPushIntrospect()"]
  f816063a_7e7e_84b8_d556_2fad92ba1294["mysqlIntrospect.ts"]
  e301d4cf_9417_da89_bf52_34424366b957 -->|defined in| f816063a_7e7e_84b8_d556_2fad92ba1294
  5ac9c01c_6690_a9da_65af_5a848a7f5362["fromDatabase()"]
  e301d4cf_9417_da89_bf52_34424366b957 -->|calls| 5ac9c01c_6690_a9da_65af_5a848a7f5362
  style e301d4cf_9417_da89_bf52_34424366b957 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-kit/src/cli/commands/mysqlIntrospect.ts lines 9–53

export const mysqlPushIntrospect = async (
	db: DB,
	databaseName: string,
	filters: string[],
) => {
	const matchers = filters.map((it) => {
		return new Minimatch(it);
	});

	const filter = (tableName: string) => {
		if (matchers.length === 0) return true;

		let flags: boolean[] = [];

		for (let matcher of matchers) {
			if (matcher.negate) {
				if (!matcher.match(tableName)) {
					flags.push(false);
				}
			}

			if (matcher.match(tableName)) {
				flags.push(true);
			}
		}

		if (flags.length > 0) {
			return flags.every(Boolean);
		}
		return false;
	};

	const progress = new ProgressView(
		'Pulling schema from database...',
		'Pulling schema from database...',
	);
	const res = await renderWithTask(
		progress,
		fromDatabase(db, databaseName, filter),
	);

	const schema = { id: originUUID, prevId: '', ...res } as MySqlSchema;
	const { internal, ...schemaWithoutInternals } = schema;
	return { schema: schemaWithoutInternals };
};

Domain

Subdomains

Frequently Asked Questions

What does mysqlPushIntrospect() do?
mysqlPushIntrospect() is a function in the drizzle-orm codebase, defined in drizzle-kit/src/cli/commands/mysqlIntrospect.ts.
Where is mysqlPushIntrospect() defined?
mysqlPushIntrospect() is defined in drizzle-kit/src/cli/commands/mysqlIntrospect.ts at line 9.
What does mysqlPushIntrospect() call?
mysqlPushIntrospect() calls 1 function(s): fromDatabase.

Analyze Your Own Codebase

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

Try Supermodel Free