( prev: DrizzleSQLiteSnapshotJSON, cur: DrizzleSQLiteSnapshotJSON, )
| 243 | }; |
| 244 | |
| 245 | export const generateSQLiteMigration = async ( |
| 246 | prev: DrizzleSQLiteSnapshotJSON, |
| 247 | cur: DrizzleSQLiteSnapshotJSON, |
| 248 | ) => { |
| 249 | const { applySqliteSnapshotsDiff } = await import('./snapshotsDiffer'); |
| 250 | |
| 251 | const validatedPrev = sqliteSchema.parse(prev); |
| 252 | const validatedCur = sqliteSchema.parse(cur); |
| 253 | |
| 254 | const squashedPrev = squashSqliteScheme(validatedPrev); |
| 255 | const squashedCur = squashSqliteScheme(validatedCur); |
| 256 | |
| 257 | const { sqlStatements } = await applySqliteSnapshotsDiff( |
| 258 | squashedPrev, |
| 259 | squashedCur, |
| 260 | tablesResolver, |
| 261 | columnsResolver, |
| 262 | sqliteViewsResolver, |
| 263 | validatedPrev, |
| 264 | validatedCur, |
| 265 | ); |
| 266 | |
| 267 | return sqlStatements; |
| 268 | }; |
| 269 | |
| 270 | export const pushSQLiteSchema = async ( |
| 271 | imports: Record<string, unknown>, |
nothing calls this directly
no test coverage detected