| Crates.io | locksmith |
| lib.rs | locksmith |
| version | 0.2.1 |
| created_at | 2023-11-13 11:19:52.434337+00 |
| updated_at | 2025-02-08 23:54:52.089853+00 |
| description | Extract Postgres locks from a given SQL statement |
| homepage | |
| repository | https://github.com/orf/locksmith |
| max_upload_size | |
| id | 1033509 |
| size | 127,638 |
This crate provides the logic for detecting the impact of a given SQL statement on a Postgres database.
It is the brains behind locksmith-cli.
use locksmith::QueryOracle;
async fn inspect_statement() {
let mut oracle = QueryOracle::new("postgres://localhost:5432/mydb");
let inspection = oracle.inspect_statement("alter table customers alter column id type bigint;").await.unwrap();
println!("{:?}", inspection.locks);
}