1//===----------------------------------------------------------------------===//
2// DuckDB
3//
4// duckdb/catalog/catalog_transaction.hpp
5//
6//
7//===----------------------------------------------------------------------===//
8
9#pragma once
10
11#include "duckdb/common/common.hpp"
12#include "duckdb/common/optional_ptr.hpp"
13
14namespace duckdb {
15class Catalog;
16class ClientContext;
17class DatabaseInstance;
18class Transaction;
19
20struct CatalogTransaction {
21 CatalogTransaction(Catalog &catalog, ClientContext &context);
22 CatalogTransaction(DatabaseInstance &db, transaction_t transaction_id_p, transaction_t start_time_p);
23
24 optional_ptr<DatabaseInstance> db;
25 optional_ptr<ClientContext> context;
26 optional_ptr<Transaction> transaction;
27 transaction_t transaction_id;
28 transaction_t start_time;
29
30 ClientContext &GetContext();
31
32 static CatalogTransaction GetSystemTransaction(DatabaseInstance &db);
33};
34
35} // namespace duckdb
36