Skip to main content

Crate eugene

Crate eugene 

Source
Expand description

This is the crate documentation for eugene.

This crate provides a library and a binary for tracing locks taken by SQL statements in a PostgreSQL database. It can be used to analyze the locking behavior of SQL scripts and to review migration scripts that could potentially interfere with other operations, such as concurrent queries by application code.

THe library also provides syntax tree analysis for SQL scripts, so it can be used to analyze migration scripts for potential issues before running them.

Modules§

error
git
Utilities for invoking git
hint_data
Static data for hints and lints, used to identify them in output or input.
hints
Hints that can help avoid dangerous migrations, by minimizing time spent holding dangerous locks.
lints
Hints that can be trigged only by looking at the SQL script, without running it.
output
Generate output structures for lock traces and static data like lock modes. This module is used by the binary to generate output in various formats is currently the best documentation of output format, and can be considered a public api for the library.
parse_scripts
Utilities for converting a single SQL file with multiple scripts into a list of scripts.
pg_types
Types that directly translate to postgres concepts like lock modes and relkinds.
pgpass
Parse the postgres PGPASS file format.
script_discovery
Walk the file system and list migration scripts in sorted order
sqltext
Read and parse simple SQL scripts, resolve placeholders and break down into statements.
tempserver
This module is for creating and destroying postgres database instances for eugene to trace.
tracing
Trace locks taken by SQL statements. Structures and data from here should be considered internal to the crate, their fields are not part of the public API.
utils

Structs§

ClientSource
Connection settings for connecting to a PostgreSQL database.
SqlScript

Traits§

WithClient

Functions§

parse_placeholders
Parse placeholders in the form of name=value into a map.
perform_trace
Perform a lock trace of a SQL script and optionally commit the transaction, depending on trace_settings.
read_script
Read a SQL script from a source and resolve placeholders.

Type Aliases§

Result