UNPKG

prisma-util

Version:

Prisma Util is an easy to use tool that merges multiple Prisma schema files, allows extending of models, resolves naming conflicts both manually and automatically and provides easy access to Prisma commands and timing reports. It's mostly a plug-and-play

41 lines (40 loc) 1.75 kB
import { ConfigType } from "./parser.js"; import { Command } from "commander"; /**Send commands to prisma. */ export declare function usePrisma(commandString: string): Promise<void>; /**Use the __dirname to create a local path (resides in project root). */ export declare function convertPathToLocal(p: string): string; /** Sub command helper */ export declare function createSubCommand(command: Command, nameAndArgs: string): Command; /** Used to run commands with timings. */ export declare function runPrismaCommand(command: string): Promise<void>; /** * Normalize path according to the project root. * @param path The path to normalize. */ export declare function normalizePath(p: string): string; /** * Get configuration path. */ export declare function getConfigurationPath(configPath: string): Promise<string>; /** * Utility function to Walk a directory. * @param directory The directory to search. * @returns A flattened array of paths. */ export declare function getFiles(directory: string): Promise<string[]>; /** Create or read the config. */ export declare function createConfig(configPath: string): Promise<{ configData: ConfigType; created: boolean; }>; /**Use data from json files inside configuration. */ export declare function matchJSON(s: string): Promise<string>; /**Load a .prisma file from the config. */ export declare function getSchema(path: string): Promise<string>; /** Flatten array of arrays. */ export declare function flatten(array: any[][]): any[]; /** Ends with any string in array. */ export declare function endsWithAny(item: string, array: string[]): string | null; /**Write temp file so prisma can read it. */ export declare function writeTempSchema(content: string, path?: string): Promise<void>;