Skip to main content

Crate typedpg_cli

Crate typedpg_cli 

Source
Expand description

The migration commands behind cargo typedpg migrate, shared with the TypeScript CLI (typedpg migrate, in typedpg_ts), which configures them from typedpg.config.json instead of Cargo.toml, and cargo typedpg lint (lint).

Modules§

lint
cargo typedpg lint: the same report as the TypeScript CLI’s typedpg lint, built from the sql! and copy_in! invocations of a Rust crate and the migrations its [package.metadata.typedpg] config names.

Enums§

MigrateAction

Functions§

connect
Connect honoring the URL’s sslmode as libpq does: disable is plain, require is TLS or nothing, and prefer (the default) tries TLS and falls back to a plain connection when that attempt fails — for instance on a server that does not offer TLS, or when the TLS handshake itself fails.
create_migration
Write an empty <timestamp>_<name>.sql and its .down.sql in dir; returns the two paths.
run_migrate_action
Run action (any but Create, which needs no connection) with the runner settings config.
unchanged_from_ref
The files among files whose content is identical to their version at git ref reference (--ignore-migrations-from).