MCPcopy
hub / github.com/drizzle-team/drizzle-orm / prepareAndExportSqlite

Function prepareAndExportSqlite

drizzle-kit/src/cli/commands/migrate.ts:865–895  ·  view source on GitHub ↗
(config: ExportConfig)

Source from the content-addressed store, hash-verified

863};
864
865export const prepareAndExportSqlite = async (config: ExportConfig) => {
866 const schemaPath = config.schema;
867
868 try {
869 const { prev, cur } = await prepareSqliteMigrationSnapshot(
870 [],
871 schemaPath,
872 undefined,
873 );
874
875 const validatedPrev = sqliteSchema.parse(prev);
876 const validatedCur = sqliteSchema.parse(cur);
877
878 const squashedPrev = squashSqliteScheme(validatedPrev);
879 const squashedCur = squashSqliteScheme(validatedCur);
880
881 const { sqlStatements, _meta } = await applySqliteSnapshotsDiff(
882 squashedPrev,
883 squashedCur,
884 tablesResolver,
885 columnsResolver,
886 sqliteViewsResolver,
887 validatedPrev,
888 validatedCur,
889 );
890
891 console.log(sqlStatements.join('\n'));
892 } catch (e) {
893 console.error(e);
894 }
895};
896
897export const prepareAndMigrateLibSQL = async (config: GenerateConfig) => {
898 const outFolder = config.out;

Callers 1

schema.tsFile · 0.85

Calls 3

squashSqliteSchemeFunction · 0.90
applySqliteSnapshotsDiffFunction · 0.90

Tested by

no test coverage detected