-- Generated by Gleam CI helpers. module CI.Component (run, version, init, generate, validate, format, db_pull, db_push, db_seed, db_execute, migrate_deploy, migrate_status, migrate_dev, migrate_reset, migrate_resolve, migrate_diff, debug, studio) where import Prelude import CI.Contract as Contract import Data.Maybe (Maybe) import Effect (Effect) import CI.ModuleDependencies as Dependencies import CI.CLI as Native -- | Execute literal Prisma CLI arguments, including version-specific features. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas. -- | @param arguments Additional literal CLI tokens as a comma-separated string. Quote a token containing a comma using CSV quotes. run :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, arguments :: String } -> Effect Contract.ExecutionResult run args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "prisma" "run" json -- | Print the Prisma CLI and engine versions. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas. version :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String } -> Effect Contract.ExecutionResult version args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "prisma" "version" json -- | Initialize a Prisma project; configure the datasource explicitly for unattended jobs. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas. -- | @param datasourceProvider Database provider for the generated schema. Allowed values: postgresql, sqlite, mysql, sqlserver, mongodb, cockroachdb. -- | @param generatorProvider Generator provider for the initial schema. -- | @param output Output path for generated client code. -- | @param arguments Additional literal CLI tokens as a comma-separated string. Quote a token containing a comma using CSV quotes. init :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, datasourceProvider :: Maybe String, generatorProvider :: Maybe String, output :: Maybe String, arguments :: Maybe String } -> Effect Contract.ExecutionResult init args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "prisma" "init" json -- | Generate project clients from the Prisma schema without applying migrations. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas. -- | @param config Path to an existing project configuration file; otherwise use native discovery. -- | @param schema Prisma schema file or schema directory; otherwise use project configuration. -- | @param generators Comma-separated generator names; omitted runs all configured generators. -- | @param noHints Suppress usage hints in CI logs. -- | @param arguments Additional literal CLI tokens as a comma-separated string. Quote a token containing a comma using CSV quotes. generate :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, schema :: Maybe String, generators :: Maybe String, noHints :: Maybe Boolean, arguments :: Maybe String } -> Effect Contract.ExecutionResult generate args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "prisma" "generate" json -- | Validate the project Prisma schema. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas. -- | @param config Path to an existing project configuration file; otherwise use native discovery. -- | @param schema Prisma schema file or schema directory; otherwise use project configuration. -- | @param arguments Additional literal CLI tokens as a comma-separated string. Quote a token containing a comma using CSV quotes. validate :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, schema :: Maybe String, arguments :: Maybe String } -> Effect Contract.ExecutionResult validate args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "prisma" "validate" json -- | Format schemas or fail a formatting check without writing changes. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas. -- | @param config Path to an existing project configuration file; otherwise use native discovery. -- | @param schema Prisma schema file or schema directory; otherwise use project configuration. -- | @param check Fail when schema files need formatting. -- | @param arguments Additional literal CLI tokens as a comma-separated string. Quote a token containing a comma using CSV quotes. format :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, schema :: Maybe String, check :: Maybe Boolean, arguments :: Maybe String } -> Effect Contract.ExecutionResult format args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "prisma" "format" json -- | Introspect the database; print avoids rewriting the project schema. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas. -- | @param config Path to an existing project configuration file; otherwise use native discovery. -- | @param schema Prisma schema file or schema directory; otherwise use project configuration. -- | @param print Print the introspected schema instead of writing it. -- | @param force Explicitly overwrite manual schema changes. -- | @param arguments Additional literal CLI tokens as a comma-separated string. Quote a token containing a comma using CSV quotes. db_pull :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, schema :: Maybe String, print :: Maybe Boolean, force :: Maybe Boolean, arguments :: Maybe String } -> Effect Contract.ExecutionResult db_pull args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "prisma" "db_pull" json -- | Synchronize schema without migrations; data loss and reset flags are explicit. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas. -- | @param config Path to an existing project configuration file; otherwise use native discovery. -- | @param schema Prisma schema file or schema directory; otherwise use project configuration. -- | @param acceptDataLoss Approve potentially destructive changes. -- | @param forceReset Explicitly reset the database before pushing; destroys data. -- | @param arguments Additional literal CLI tokens as a comma-separated string. Quote a token containing a comma using CSV quotes. db_push :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, schema :: Maybe String, acceptDataLoss :: Maybe Boolean, forceReset :: Maybe Boolean, arguments :: Maybe String } -> Effect Contract.ExecutionResult db_push args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "prisma" "db_push" json -- | Run the project seed command configured in Prisma config. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas. -- | @param config Path to an existing project configuration file; otherwise use native discovery. -- | @param arguments Additional literal CLI tokens as a comma-separated string. Quote a token containing a comma using CSV quotes. db_seed :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, arguments :: Maybe String } -> Effect Contract.ExecutionResult db_seed args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "prisma" "db_seed" json -- | Execute an existing SQL script using the configured datasource. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas. -- | @param config Path to an existing project configuration file; otherwise use native discovery. -- | @param file Existing SQL script to execute. -- | @param arguments Additional literal CLI tokens as a comma-separated string. Quote a token containing a comma using CSV quotes. db_execute :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, file :: String, arguments :: Maybe String } -> Effect Contract.ExecutionResult db_execute args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "prisma" "db_execute" json -- | Apply pending committed migrations noninteractively in deployment pipelines. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas. -- | @param config Path to an existing project configuration file; otherwise use native discovery. -- | @param schema Prisma schema file or schema directory; otherwise use project configuration. -- | @param arguments Additional literal CLI tokens as a comma-separated string. Quote a token containing a comma using CSV quotes. migrate_deploy :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, schema :: Maybe String, arguments :: Maybe String } -> Effect Contract.ExecutionResult migrate_deploy args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "prisma" "migrate_deploy" json -- | Report migration status; propagate divergence and pending-migration failures. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas. -- | @param config Path to an existing project configuration file; otherwise use native discovery. -- | @param schema Prisma schema file or schema directory; otherwise use project configuration. -- | @param arguments Additional literal CLI tokens as a comma-separated string. Quote a token containing a comma using CSV quotes. migrate_status :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, schema :: Maybe String, arguments :: Maybe String } -> Effect Contract.ExecutionResult migrate_status args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "prisma" "migrate_status" json -- | Create and apply development migrations; use migrate-deploy for production. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas. -- | @param config Path to an existing project configuration file; otherwise use native discovery. -- | @param schema Prisma schema file or schema directory; otherwise use project configuration. -- | @param name Name for a new migration. -- | @param createOnly Create a migration without applying it. -- | @param arguments Additional literal CLI tokens as a comma-separated string. Quote a token containing a comma using CSV quotes. migrate_dev :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, schema :: Maybe String, name :: Maybe String, createOnly :: Maybe Boolean, arguments :: Maybe String } -> Effect Contract.ExecutionResult migrate_dev args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "prisma" "migrate_dev" json -- | Reset a disposable development database; destructive confirmation is explicit. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas. -- | @param config Path to an existing project configuration file; otherwise use native discovery. -- | @param schema Prisma schema file or schema directory; otherwise use project configuration. -- | @param force Explicitly skip reset confirmation; destroys all database data. -- | @param arguments Additional literal CLI tokens as a comma-separated string. Quote a token containing a comma using CSV quotes. migrate_reset :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, schema :: Maybe String, force :: Maybe Boolean, arguments :: Maybe String } -> Effect Contract.ExecutionResult migrate_reset args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "prisma" "migrate_reset" json -- | Record a migration as applied or rolled back; choose exactly one in Prisma. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas. -- | @param config Path to an existing project configuration file; otherwise use native discovery. -- | @param schema Prisma schema file or schema directory; otherwise use project configuration. -- | @param applied Migration directory name to mark as applied. -- | @param rolledBack Migration directory name to mark as rolled back. -- | @param arguments Additional literal CLI tokens as a comma-separated string. Quote a token containing a comma using CSV quotes. migrate_resolve :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, schema :: Maybe String, applied :: Maybe String, rolledBack :: Maybe String, arguments :: Maybe String } -> Effect Contract.ExecutionResult migrate_resolve args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "prisma" "migrate_resolve" json -- | Compare schema sources; native Prisma requires exactly one from and one to source. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas. -- | @param config Path to an existing project configuration file; otherwise use native discovery. -- | @param fromEmpty Compare from an empty schema. -- | @param fromSchema Existing source Prisma schema file. -- | @param fromMigrations Existing source migrations directory. -- | @param fromConfigDatasource Use the configured database as the source. -- | @param toEmpty Compare to an empty schema. -- | @param toSchema Existing target Prisma schema file. -- | @param toMigrations Existing target migrations directory. -- | @param toConfigDatasource Use the configured database as the target. -- | @param script Print SQL instead of a human-readable summary. -- | @param exitCode Fail on nonempty differences (native exit code 2). -- | @param output Write the diff to this output file. -- | @param arguments Additional literal CLI tokens as a comma-separated string. Quote a token containing a comma using CSV quotes. migrate_diff :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, fromEmpty :: Maybe Boolean, fromSchema :: Maybe String, fromMigrations :: Maybe String, fromConfigDatasource :: Maybe Boolean, toEmpty :: Maybe Boolean, toSchema :: Maybe String, toMigrations :: Maybe String, toConfigDatasource :: Maybe Boolean, script :: Maybe Boolean, exitCode :: Maybe Boolean, output :: Maybe String, arguments :: Maybe String } -> Effect Contract.ExecutionResult migrate_diff args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "prisma" "migrate_diff" json -- | Print Prisma diagnostic information for troubleshooting. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas. -- | @param config Path to an existing project configuration file; otherwise use native discovery. -- | @param schema Prisma schema file or schema directory; otherwise use project configuration. -- | @param arguments Additional literal CLI tokens as a comma-separated string. Quote a token containing a comma using CSV quotes. debug :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, schema :: Maybe String, arguments :: Maybe String } -> Effect Contract.ExecutionResult debug args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "prisma" "debug" json -- | Run the long-lived Studio server within a scoped service lifecycle. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas. -- | @param config Path to an existing project configuration file; otherwise use native discovery. -- | @param port Studio listening port. -- | @param browser Browser to launch; use none on a headless runner. -- | @param arguments Additional literal CLI tokens as a comma-separated string. Quote a token containing a comma using CSV quotes. studio :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, port :: Maybe Int, browser :: Maybe String, arguments :: Maybe String } -> Effect Contract.ExecutionResult studio args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "prisma" "studio" json