1 | //===----------------------------------------------------------------------===// |
---|---|
2 | // DuckDB |
3 | // |
4 | // duckdb/planner/pragma_handler.hpp |
5 | // |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #pragma once |
10 | |
11 | #include "duckdb/common/common.hpp" |
12 | #include "duckdb/common/vector.hpp" |
13 | #include "duckdb/parser/statement/pragma_statement.hpp" |
14 | |
15 | namespace duckdb { |
16 | class ClientContext; |
17 | class ClientContextLock; |
18 | class SQLStatement; |
19 | struct PragmaInfo; |
20 | |
21 | //! Pragma handler is responsible for converting certain pragma statements into new queries |
22 | class PragmaHandler { |
23 | public: |
24 | explicit PragmaHandler(ClientContext &context); |
25 | |
26 | void HandlePragmaStatements(ClientContextLock &lock, vector<unique_ptr<SQLStatement>> &statements); |
27 | |
28 | private: |
29 | ClientContext &context; |
30 | |
31 | private: |
32 | //! Handles a pragma statement, returns whether the statement was expanded, if it was expanded the 'resulting_query' |
33 | //! contains the statement(s) to replace the current one |
34 | bool HandlePragma(SQLStatement *statement, string &resulting_query); |
35 | |
36 | void HandlePragmaStatementsInternal(vector<unique_ptr<SQLStatement>> &statements); |
37 | }; |
38 | } // namespace duckdb |
39 |