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
15namespace duckdb {
16class ClientContext;
17class ClientContextLock;
18class SQLStatement;
19struct PragmaInfo;
20
21//! Pragma handler is responsible for converting certain pragma statements into new queries
22class PragmaHandler {
23public:
24 explicit PragmaHandler(ClientContext &context);
25
26 void HandlePragmaStatements(ClientContextLock &lock, vector<unique_ptr<SQLStatement>> &statements);
27
28private:
29 ClientContext &context;
30
31private:
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