no-mistakes-postgres-engine 0.109.130

PostgreSQL embedded SQL extraction, schema catalog, and replay-safety analysis for no-mistakes
Documentation
use super::ends_standalone_transaction;

#[test]
fn chaining_ends_the_old_transaction_but_a_savepoint_rollback_does_not() {
    assert!(ends_standalone_transaction("COMMIT AND CHAIN"));
    assert!(ends_standalone_transaction("ROLLBACK AND CHAIN"));
    assert!(!ends_standalone_transaction("ROLLBACK TO SAVEPOINT sample"));
}

#[test]
fn only_prepare_transaction_with_a_literal_ends_standalone_membership() {
    assert!(ends_standalone_transaction(
        "PREPARE /* name follows */ TRANSACTION 'queued';"
    ));
    assert!(!ends_standalone_transaction(
        "PREPARE statement AS SELECT 1"
    ));
    assert!(!ends_standalone_transaction(
        "PREPARE TRANSACTION missing_literal"
    ));
    assert!(!ends_standalone_transaction(
        "PREPARE TRANSACTION 'one'; SELECT 1"
    ));
}