MCPcopy
hub / github.com/prisma/prisma / handleViewsIO

Function handleViewsIO

packages/migrate/src/views/handleViewsIO.ts:31–40  ·  view source on GitHub ↗
({ views, viewsDirectoryPath }: HandleViewsIOParams)

Source from the content-addressed store, hash-verified

29 * In case of empty folders, these are deleted silently.
30 */
31export async function handleViewsIO({ views, viewsDirectoryPath }: HandleViewsIOParams): Promise<void> {
32 const posixViewsDirectoryPath = pathToPosix(viewsDirectoryPath)
33 if (views.length === 0) {
34 await cleanLeftoversIO(posixViewsDirectoryPath)
35 return
36 }
37
38 const { viewFilesToKeep } = await createViewsIO(posixViewsDirectoryPath, views)
39 await cleanLeftoversIO(posixViewsDirectoryPath, viewFilesToKeep)
40}
41
42async function createViewsIO(
43 viewsDir: string,

Callers 2

introspectMethod · 0.90
introspectMethod · 0.90

Calls 3

pathToPosixFunction · 0.90
cleanLeftoversIOFunction · 0.85
createViewsIOFunction · 0.85

Tested by

no test coverage detected