---
source: crates/squawk_parser/tests/tests.rs
input_file: crates/squawk_parser/tests/data/ok/transaction.sql
---
SOURCE_FILE
  COMMENT "-- begin_commit_abort_rollback"
  WHITESPACE "\n"
  COMMENT "-- https://www.postgresql.org/docs/17/sql-commit.html"
  WHITESPACE "\n"
  COMMIT
    COMMIT_KW "commit"
  SEMICOLON ";"
  WHITESPACE "\n"
  COMMIT
    COMMIT_KW "commit"
    WHITESPACE " "
    WORK_KW "work"
  SEMICOLON ";"
  WHITESPACE "\n"
  COMMIT
    COMMIT_KW "commit"
    WHITESPACE " "
    TRANSACTION_KW "transaction"
  SEMICOLON ";"
  WHITESPACE "\n"
  COMMIT
    COMMIT_KW "commit"
    WHITESPACE " "
    AND_KW "and"
    WHITESPACE " "
    CHAIN_KW "chain"
  SEMICOLON ";"
  WHITESPACE "\n"
  COMMIT
    COMMIT_KW "commit"
    WHITESPACE " "
    AND_KW "and"
    WHITESPACE " "
    NO_KW "no"
    WHITESPACE " "
    CHAIN_KW "chain"
  SEMICOLON ";"
  WHITESPACE "\n"
  COMMIT
    COMMIT_KW "commit"
    WHITESPACE " "
    PREPARED_KW "prepared"
    WHITESPACE " "
    LITERAL
      STRING "'bar'"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- https://www.postgresql.org/docs/17/sql-begin.html"
  WHITESPACE "\n"
  BEGIN
    BEGIN_KW "begin"
  SEMICOLON ";"
  WHITESPACE "\n"
  BEGIN
    BEGIN_KW "begin"
    WHITESPACE " "
    TRANSACTION_KW "transaction"
  SEMICOLON ";"
  WHITESPACE "\n"
  BEGIN
    BEGIN_KW "begin"
    WHITESPACE " "
    WORK_KW "work"
  SEMICOLON ";"
  WHITESPACE "\n"
  BEGIN
    BEGIN_KW "begin"
    WHITESPACE " \n  "
    TRANSACTION_MODE_LIST
      READ_COMMITTED
        ISOLATION_KW "isolation"
        WHITESPACE " "
        LEVEL_KW "level"
        WHITESPACE " "
        READ_KW "read"
        WHITESPACE " "
        COMMITTED_KW "committed"
      WHITESPACE "\n  "
      READ_ONLY
        READ_KW "read"
        WHITESPACE " "
        ONLY_KW "only"
      WHITESPACE "\n  "
      READ_WRITE
        READ_KW "read"
        WHITESPACE " "
        WRITE_KW "write"
      WHITESPACE "\n  "
      DEFERRABLE
        DEFERRABLE_KW "deferrable"
      WHITESPACE "\n  "
      NOT_DEFERRABLE
        NOT_KW "not"
        WHITESPACE " "
        DEFERRABLE_KW "deferrable"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  BEGIN
    BEGIN_KW "begin"
    WHITESPACE "\n  "
    TRANSACTION_MODE_LIST
      READ_COMMITTED
        ISOLATION_KW "isolation"
        WHITESPACE " "
        LEVEL_KW "level"
        WHITESPACE " "
        READ_KW "read"
        WHITESPACE " "
        COMMITTED_KW "committed"
      COMMA ","
      WHITESPACE "\n  "
      READ_UNCOMMITTED
        ISOLATION_KW "isolation"
        WHITESPACE " "
        LEVEL_KW "level"
        WHITESPACE " "
        READ_KW "read"
        WHITESPACE " "
        UNCOMMITTED_KW "uncommitted"
      COMMA ","
      WHITESPACE "\n  "
      REPEATABLE_READ
        ISOLATION_KW "isolation"
        WHITESPACE " "
        LEVEL_KW "level"
        WHITESPACE " "
        REPEATABLE_KW "repeatable"
        WHITESPACE " "
        READ_KW "read"
      COMMA ","
      WHITESPACE "\n  "
      SERIALIZABLE
        ISOLATION_KW "isolation"
        WHITESPACE " "
        LEVEL_KW "level"
        WHITESPACE " "
        SERIALIZABLE_KW "serializable"
      COMMA ","
      WHITESPACE "\n  "
      READ_ONLY
        READ_KW "read"
        WHITESPACE " "
        ONLY_KW "only"
      COMMA ","
      WHITESPACE "\n  "
      READ_WRITE
        READ_KW "read"
        WHITESPACE " "
        WRITE_KW "write"
      COMMA ","
      WHITESPACE "\n  "
      DEFERRABLE
        DEFERRABLE_KW "deferrable"
      COMMA ","
      WHITESPACE "\n  "
      NOT_DEFERRABLE
        NOT_KW "not"
        WHITESPACE " "
        DEFERRABLE_KW "deferrable"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  BEGIN
    START_KW "start"
    WHITESPACE " "
    TRANSACTION_KW "transaction"
    WHITESPACE "\n  "
    TRANSACTION_MODE_LIST
      READ_COMMITTED
        ISOLATION_KW "isolation"
        WHITESPACE " "
        LEVEL_KW "level"
        WHITESPACE " "
        READ_KW "read"
        WHITESPACE " "
        COMMITTED_KW "committed"
      WHITESPACE "\n  "
      READ_ONLY
        READ_KW "read"
        WHITESPACE " "
        ONLY_KW "only"
      WHITESPACE "\n  "
      READ_WRITE
        READ_KW "read"
        WHITESPACE " "
        WRITE_KW "write"
      WHITESPACE "\n  "
      DEFERRABLE
        DEFERRABLE_KW "deferrable"
      WHITESPACE "\n  "
      NOT_DEFERRABLE
        NOT_KW "not"
        WHITESPACE " "
        DEFERRABLE_KW "deferrable"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  BEGIN
    START_KW "start"
    WHITESPACE " "
    TRANSACTION_KW "transaction"
    WHITESPACE "\n  "
    TRANSACTION_MODE_LIST
      READ_COMMITTED
        ISOLATION_KW "isolation"
        WHITESPACE " "
        LEVEL_KW "level"
        WHITESPACE " "
        READ_KW "read"
        WHITESPACE " "
        COMMITTED_KW "committed"
      COMMA ","
      WHITESPACE "\n  "
      READ_UNCOMMITTED
        ISOLATION_KW "isolation"
        WHITESPACE " "
        LEVEL_KW "level"
        WHITESPACE " "
        READ_KW "read"
        WHITESPACE " "
        UNCOMMITTED_KW "uncommitted"
      COMMA ","
      WHITESPACE "\n  "
      REPEATABLE_READ
        ISOLATION_KW "isolation"
        WHITESPACE " "
        LEVEL_KW "level"
        WHITESPACE " "
        REPEATABLE_KW "repeatable"
        WHITESPACE " "
        READ_KW "read"
      COMMA ","
      WHITESPACE "\n  "
      SERIALIZABLE
        ISOLATION_KW "isolation"
        WHITESPACE " "
        LEVEL_KW "level"
        WHITESPACE " "
        SERIALIZABLE_KW "serializable"
      COMMA ","
      WHITESPACE "\n  "
      READ_ONLY
        READ_KW "read"
        WHITESPACE " "
        ONLY_KW "only"
      COMMA ","
      WHITESPACE "\n  "
      READ_WRITE
        READ_KW "read"
        WHITESPACE " "
        WRITE_KW "write"
      COMMA ","
      WHITESPACE "\n  "
      DEFERRABLE
        DEFERRABLE_KW "deferrable"
      COMMA ","
      WHITESPACE "\n  "
      NOT_DEFERRABLE
        NOT_KW "not"
        WHITESPACE " "
        DEFERRABLE_KW "deferrable"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  PREPARE_TRANSACTION
    PREPARE_KW "prepare"
    WHITESPACE " "
    TRANSACTION_KW "transaction"
    WHITESPACE " "
    LITERAL
      STRING "'f'"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  SAVEPOINT
    SAVEPOINT_KW "savepoint"
    WHITESPACE " "
    NAME
      IDENT "foo"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  RELEASE_SAVEPOINT
    RELEASE_KW "release"
    WHITESPACE " "
    SAVEPOINT_KW "savepoint"
    WHITESPACE " "
    NAME_REF
      IDENT "foo"
  SEMICOLON ";"
  WHITESPACE "\n"
  RELEASE_SAVEPOINT
    RELEASE_KW "release"
    WHITESPACE " "
    NAME_REF
      IDENT "foo"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  ROLLBACK
    ROLLBACK_KW "rollback"
    WHITESPACE " "
    TO_KW "to"
    WHITESPACE " "
    SAVEPOINT_KW "savepoint"
    WHITESPACE " "
    NAME_REF
      IDENT "foo"
  SEMICOLON ";"
  WHITESPACE "\n"
  ROLLBACK
    ROLLBACK_KW "rollback"
    WHITESPACE " "
    WORK_KW "work"
    WHITESPACE " "
    TO_KW "to"
    WHITESPACE " "
    SAVEPOINT_KW "savepoint"
    WHITESPACE " "
    NAME_REF
      IDENT "foo"
  SEMICOLON ";"
  WHITESPACE "\n"
  ROLLBACK
    ROLLBACK_KW "rollback"
    WHITESPACE " "
    TRANSACTION_KW "transaction"
    WHITESPACE " "
    TO_KW "to"
    WHITESPACE " "
    SAVEPOINT_KW "savepoint"
    WHITESPACE " "
    NAME_REF
      IDENT "foo"
  SEMICOLON ";"
  WHITESPACE "\n"
  ROLLBACK
    ROLLBACK_KW "rollback"
    WHITESPACE " "
    TO_KW "to"
    WHITESPACE " "
    NAME_REF
      IDENT "foo"
  SEMICOLON ";"
  WHITESPACE "\n"
  ROLLBACK
    ROLLBACK_KW "rollback"
    WHITESPACE " "
    WORK_KW "work"
    WHITESPACE " "
    TO_KW "to"
    WHITESPACE " "
    NAME_REF
      IDENT "foo"
  SEMICOLON ";"
  WHITESPACE "\n"
  ROLLBACK
    ROLLBACK_KW "rollback"
    WHITESPACE " "
    TRANSACTION_KW "transaction"
    WHITESPACE " "
    TO_KW "to"
    WHITESPACE " "
    NAME_REF
      IDENT "foo"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMIT
    END_KW "end"
  SEMICOLON ";"
  WHITESPACE "\n"
  COMMIT
    END_KW "end"
    WHITESPACE " "
    WORK_KW "work"
  SEMICOLON ";"
  WHITESPACE "\n"
  COMMIT
    END_KW "end"
    WHITESPACE " "
    TRANSACTION_KW "transaction"
  SEMICOLON ";"
  WHITESPACE "\n"
  COMMIT
    END_KW "end"
    WHITESPACE " "
    AND_KW "and"
    WHITESPACE " "
    CHAIN_KW "chain"
  SEMICOLON ";"
  WHITESPACE "\n"
  COMMIT
    END_KW "end"
    WHITESPACE " "
    AND_KW "and"
    WHITESPACE " "
    NO_KW "no"
    WHITESPACE " "
    CHAIN_KW "chain"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  ROLLBACK
    ABORT_KW "abort"
  SEMICOLON ";"
  WHITESPACE "\n"
  ROLLBACK
    ABORT_KW "abort"
    WHITESPACE " "
    WORK_KW "work"
  SEMICOLON ";"
  WHITESPACE "\n"
  ROLLBACK
    ABORT_KW "abort"
    WHITESPACE " "
    TRANSACTION_KW "transaction"
  SEMICOLON ";"
  WHITESPACE "\n"
  ROLLBACK
    ABORT_KW "abort"
    WHITESPACE " "
    AND_KW "and"
    WHITESPACE " "
    CHAIN_KW "chain"
  SEMICOLON ";"
  WHITESPACE "\n"
  ROLLBACK
    ABORT_KW "abort"
    WHITESPACE " "
    AND_KW "and"
    WHITESPACE " "
    NO_KW "no"
    WHITESPACE " "
    CHAIN_KW "chain"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  ROLLBACK
    ROLLBACK_KW "rollback"
  SEMICOLON ";"
  WHITESPACE "\n"
  ROLLBACK
    ROLLBACK_KW "rollback"
    WHITESPACE " "
    WORK_KW "work"
  SEMICOLON ";"
  WHITESPACE "\n"
  ROLLBACK
    ROLLBACK_KW "rollback"
    WHITESPACE " "
    TRANSACTION_KW "transaction"
  SEMICOLON ";"
  WHITESPACE "\n"
  ROLLBACK
    ROLLBACK_KW "rollback"
    WHITESPACE " "
    AND_KW "and"
    WHITESPACE " "
    CHAIN_KW "chain"
  SEMICOLON ";"
  WHITESPACE "\n"
  ROLLBACK
    ROLLBACK_KW "rollback"
    WHITESPACE " "
    AND_KW "and"
    WHITESPACE " "
    NO_KW "no"
    WHITESPACE " "
    CHAIN_KW "chain"
  SEMICOLON ";"
  WHITESPACE "\n"
  ROLLBACK
    ROLLBACK_KW "rollback"
    WHITESPACE " "
    PREPARED_KW "prepared"
    WHITESPACE " "
    LITERAL
      STRING "'foo'"
  SEMICOLON ";"
  WHITESPACE "\n\n"
