locksmith 0.2.1

Extract Postgres locks from a given SQL statement
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Locksmith

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](https://crates.io/crates/locksmith-cli).

## Detecting the impact of a statement

```rust
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);
}
```