sqliteImports.ts — drizzle-orm Source File
Architecture documentation for sqliteImports.ts, a typescript file in the drizzle-orm codebase. 4 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 2c0df7ba_1c22_c7cc_ecbc_4a9f7013f84a["sqliteImports.ts"] 09e5bcf1_0f03_3dbd_fbdb_762440f28855["utils.ts"] 2c0df7ba_1c22_c7cc_ecbc_4a9f7013f84a --> 09e5bcf1_0f03_3dbd_fbdb_762440f28855 54221957_c725_0bfe_4345_4f3837d39296["safeRegister"] 2c0df7ba_1c22_c7cc_ecbc_4a9f7013f84a --> 54221957_c725_0bfe_4345_4f3837d39296 690f7dfc_0aea_9ee8_d6e7_26bbb3689031["drizzle-orm"] 2c0df7ba_1c22_c7cc_ecbc_4a9f7013f84a --> 690f7dfc_0aea_9ee8_d6e7_26bbb3689031 25248a9d_ba06_2b33_4421_8575da2f9c34["sqlite-core"] 2c0df7ba_1c22_c7cc_ecbc_4a9f7013f84a --> 25248a9d_ba06_2b33_4421_8575da2f9c34 style 2c0df7ba_1c22_c7cc_ecbc_4a9f7013f84a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { is } from 'drizzle-orm';
import { AnySQLiteTable, SQLiteTable, SQLiteView } from 'drizzle-orm/sqlite-core';
import { safeRegister } from '../cli/commands/utils';
export const prepareFromExports = (exports: Record<string, unknown>) => {
const tables: AnySQLiteTable[] = [];
const views: SQLiteView[] = [];
const i0values = Object.values(exports);
i0values.forEach((t) => {
if (is(t, SQLiteTable)) {
tables.push(t);
}
if (is(t, SQLiteView)) {
views.push(t);
}
});
return { tables, views };
};
export const prepareFromSqliteImports = async (imports: string[]) => {
const tables: AnySQLiteTable[] = [];
const views: SQLiteView[] = [];
const { unregister } = await safeRegister();
for (let i = 0; i < imports.length; i++) {
const it = imports[i];
const i0: Record<string, unknown> = require(`${it}`);
const prepared = prepareFromExports(i0);
tables.push(...prepared.tables);
views.push(...prepared.views);
}
unregister();
return { tables: Array.from(new Set(tables)), views };
};
Domain
Subdomains
Dependencies
- drizzle-orm
- safeRegister
- sqlite-core
- utils.ts
Source
Frequently Asked Questions
What does sqliteImports.ts do?
sqliteImports.ts is a source file in the drizzle-orm codebase, written in typescript. It belongs to the DrizzleKit domain, SnapshotSerializer subdomain.
What functions are defined in sqliteImports.ts?
sqliteImports.ts defines 2 function(s): prepareFromExports, prepareFromSqliteImports.
What does sqliteImports.ts depend on?
sqliteImports.ts imports 4 module(s): drizzle-orm, safeRegister, sqlite-core, utils.ts.
Where is sqliteImports.ts in the architecture?
sqliteImports.ts is located at drizzle-kit/src/serializer/sqliteImports.ts (domain: DrizzleKit, subdomain: SnapshotSerializer, directory: drizzle-kit/src/serializer).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free