Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sub-transactions API #912

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open

Commits on Dec 5, 2022

  1. Problem: inability to fine-tune transaction boundaries easily

    Solution: implement an interface for sub-transactions
    
    It's a fairly simplistic interface at this point and it allows choosing
    a mode of release on drop (commit by default).
    
    This is an improved version of the original implementation in
    pgx-contrib-spiext
    (https://github.com/supabase/pgx-contrib-spiext/blob/main/src/subtxn.rs)
    yrashk committed Dec 5, 2022
    Configuration menu
    Copy the full SHA
    f7455b1 View commit details
    Browse the repository at this point in the history

Commits on Dec 13, 2022

  1. Configuration menu
    Copy the full SHA
    a35d24e View commit details
    Browse the repository at this point in the history
  2. Problem: manual implementation of Drop for SubTransaction

    It may be unnecessary.
    
    Solution: simply derive it
    yrashk committed Dec 13, 2022
    Configuration menu
    Copy the full SHA
    aa8ae18 View commit details
    Browse the repository at this point in the history
  3. Problem: SubTransactionExt::T is a non-descriptive name

    Solution: name it Parent as it is what it is
    yrashk committed Dec 13, 2022
    Configuration menu
    Copy the full SHA
    8998091 View commit details
    Browse the repository at this point in the history
  4. Problem: SubTransaction::memory_context() is not used anywhere

    Also, given `PgMemoryContexts` API is still somewhat rough, it may be
    not a great idea to expose it.
    
    Solution: remove it
    yrashk committed Dec 13, 2022
    Configuration menu
    Copy the full SHA
    351d157 View commit details
    Browse the repository at this point in the history
  5. Problem: unclear what a null argument to BeginInternalSubTransaction …

    …is for
    
    Solution: comment it
    yrashk committed Dec 13, 2022
    Configuration menu
    Copy the full SHA
    b38d9d7 View commit details
    Browse the repository at this point in the history
  6. Problem: unclear how ResourceOwner should be managed

    Solution: provide some reference materials on it
    yrashk committed Dec 13, 2022
    Configuration menu
    Copy the full SHA
    df654a1 View commit details
    Browse the repository at this point in the history

Commits on Dec 14, 2022

  1. Problem: use of Option<Parent> in SubTransaction

    It is only there so that we can move it out of manually copied type
    that implements Drop
    
    Solution: extract release logic into a separate trait
    yrashk committed Dec 14, 2022
    Configuration menu
    Copy the full SHA
    d04aea8 View commit details
    Browse the repository at this point in the history
  2. Problem: meaning of fields in SubTransaction is unclear

    Solution: document them
    yrashk committed Dec 14, 2022
    Configuration menu
    Copy the full SHA
    1cc57bc View commit details
    Browse the repository at this point in the history

Commits on Jan 14, 2023

  1. Configuration menu
    Copy the full SHA
    3ed2afe View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    94f7cf8 View commit details
    Browse the repository at this point in the history

Commits on Jan 19, 2023

  1. Problem: prelude exports too much from subxact

    We can do better
    
    Solution: export only most common types
    yrashk committed Jan 19, 2023
    Configuration menu
    Copy the full SHA
    cb812f4 View commit details
    Browse the repository at this point in the history