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 | |
14 | namespace duckdb { |
15 | class Catalog; |
16 | class ClientContext; |
17 | class DatabaseInstance; |
18 | class Transaction; |
19 | |
20 | struct 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 |