-- Generated by Gleam CI helpers. module CI.Component (run, version, generate, migrate, push, pull, check, up, export_sql, 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 Drizzle Kit arguments for additional upstream 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 "drizzlekit" "run" json -- | Print the Drizzle Kit version. -- | @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 "drizzlekit" "version" json -- | Generate SQL migrations; custom creates an empty migration for handwritten SQL. -- | @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 name Name for the generated migration. -- | @param custom Generate an empty custom SQL migration. -- | @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, name :: Maybe String, custom :: 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 "drizzlekit" "generate" json -- | Apply committed SQL migrations using the project database configuration. -- | @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. migrate :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, arguments :: Maybe String } -> Effect Contract.ExecutionResult migrate args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "drizzlekit" "migrate" json -- | Apply schema changes directly; destructive approval is opt-in through force. -- | @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 force Explicitly approve data loss statements; may truncate tables. -- | @param strict Require confirmation for every schema change; avoid unattended pipelines. -- | @param verbose Print SQL statements before applying changes. -- | @param arguments Additional literal CLI tokens as a comma-separated string. Quote a token containing a comma using CSV quotes. push :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, force :: Maybe Boolean, strict :: Maybe Boolean, verbose :: Maybe Boolean, arguments :: Maybe String } -> Effect Contract.ExecutionResult push args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "drizzlekit" "push" json -- | Introspect the configured database into Drizzle schema files. -- | @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. pull :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, arguments :: Maybe String } -> Effect Contract.ExecutionResult pull args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "drizzlekit" "pull" json -- | Check generated migrations for collisions before merging. -- | @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. check :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, arguments :: Maybe String } -> Effect Contract.ExecutionResult check args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "drizzlekit" "check" json -- | Upgrade existing migration snapshots to the installed Kit format. -- | @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. up :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, arguments :: Maybe String } -> Effect Contract.ExecutionResult up args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "drizzlekit" "up" json -- | Print SQL DDL from the configured TypeScript 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 arguments Additional literal CLI tokens as a comma-separated string. Quote a token containing a comma using CSV quotes. export_sql :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, arguments :: Maybe String } -> Effect Contract.ExecutionResult export_sql args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "drizzlekit" "export_sql" json -- | Start the long-running Studio server; use a bounded timeout and 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 host Listening address; bind locally on shared runners. -- | @param port Studio listening port. -- | @param verbose Print Studio SQL statements. -- | @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, host :: Maybe String, port :: Maybe Int, verbose :: Maybe Boolean, arguments :: Maybe String } -> Effect Contract.ExecutionResult studio args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "drizzlekit" "studio" json