Home / File/ singlestoreIntrospect.ts — drizzle-orm Source File

singlestoreIntrospect.ts — drizzle-orm Source File

Architecture documentation for singlestoreIntrospect.ts, a typescript file in the drizzle-orm codebase. 9 imports, 0 dependents.

File typescript DrizzleKit CLIWorkflow 9 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  5ace557c_1d0c_8b30_588f_2973fb2830b3["singlestoreIntrospect.ts"]
  8f03c4cf_4fdf_b056_3b24_d493cab0cc81["global.ts"]
  5ace557c_1d0c_8b30_588f_2973fb2830b3 --> 8f03c4cf_4fdf_b056_3b24_d493cab0cc81
  d63c81a6_6779_4926_bffe_7351e12a4301["singlestoreSchema.ts"]
  5ace557c_1d0c_8b30_588f_2973fb2830b3 --> d63c81a6_6779_4926_bffe_7351e12a4301
  67437259_0670_dcef_f238_9264f0f16394["singlestoreSerializer.ts"]
  5ace557c_1d0c_8b30_588f_2973fb2830b3 --> 67437259_0670_dcef_f238_9264f0f16394
  cb6874bf_41d2_b505_ecf8_e9397a97e640["fromDatabase"]
  5ace557c_1d0c_8b30_588f_2973fb2830b3 --> cb6874bf_41d2_b505_ecf8_e9397a97e640
  5847e5ae_7b4a_4b02_b68f_883ef88b3c1a["utils.ts"]
  5ace557c_1d0c_8b30_588f_2973fb2830b3 --> 5847e5ae_7b4a_4b02_b68f_883ef88b3c1a
  217e2cbd_4fb7_ceab_251c_5733ece08a8f["views.ts"]
  5ace557c_1d0c_8b30_588f_2973fb2830b3 --> 217e2cbd_4fb7_ceab_251c_5733ece08a8f
  946a5474_7e86_7977_562a_290de1fdc827["ProgressView"]
  5ace557c_1d0c_8b30_588f_2973fb2830b3 --> 946a5474_7e86_7977_562a_290de1fdc827
  a506b568_7d24_7568_35df_af935066e9fd["hanji"]
  5ace557c_1d0c_8b30_588f_2973fb2830b3 --> a506b568_7d24_7568_35df_af935066e9fd
  bcba9db4_12fe_4370_dc2c_c82528eb2bb8["minimatch"]
  5ace557c_1d0c_8b30_588f_2973fb2830b3 --> bcba9db4_12fe_4370_dc2c_c82528eb2bb8
  style 5ace557c_1d0c_8b30_588f_2973fb2830b3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { renderWithTask } from 'hanji';
import { Minimatch } from 'minimatch';
import { originUUID } from '../../global';
import type { SingleStoreSchema } from '../../serializer/singlestoreSchema';
import { fromDatabase } from '../../serializer/singlestoreSerializer';
import type { DB } from '../../utils';
import { ProgressView } from '../views';

export const singlestorePushIntrospect = 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 SingleStoreSchema;
	const { internal, ...schemaWithoutInternals } = schema;
	return { schema: schemaWithoutInternals };
};

Domain

Subdomains

Frequently Asked Questions

What does singlestoreIntrospect.ts do?
singlestoreIntrospect.ts is a source file in the drizzle-orm codebase, written in typescript. It belongs to the DrizzleKit domain, CLIWorkflow subdomain.
What functions are defined in singlestoreIntrospect.ts?
singlestoreIntrospect.ts defines 1 function(s): singlestorePushIntrospect.
What does singlestoreIntrospect.ts depend on?
singlestoreIntrospect.ts imports 9 module(s): ProgressView, fromDatabase, global.ts, hanji, minimatch, singlestoreSchema.ts, singlestoreSerializer.ts, utils.ts, and 1 more.
Where is singlestoreIntrospect.ts in the architecture?
singlestoreIntrospect.ts is located at drizzle-kit/src/cli/commands/singlestoreIntrospect.ts (domain: DrizzleKit, subdomain: CLIWorkflow, directory: drizzle-kit/src/cli/commands).

Analyze Your Own Codebase

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

Try Supermodel Free