Skip to content

Commit c4b648e

Browse files
author
lmangani
committed
WHERE condition parser
1 parent 9818c41 commit c4b648e

File tree

4 files changed

+505
-0
lines changed

4 files changed

+505
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ include_directories(src/include)
1212
set(EXTENSION_SOURCES
1313
src/parser_tools_extension.cpp
1414
src/parse_tables.cpp
15+
src/parse_where.cpp
1516
)
1617

1718
build_static_extension(${TARGET_NAME} ${EXTENSION_SOURCES})

src/include/parse_where.hpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#pragma once
2+
3+
#include "duckdb.hpp"
4+
#include <string>
5+
#include <vector>
6+
7+
namespace duckdb {
8+
9+
// Forward declarations
10+
class DatabaseInstance;
11+
12+
struct WhereConditionResult {
13+
std::string condition;
14+
std::string table_name; // The table this condition applies to (if determinable)
15+
std::string context; // The context where this condition appears (WHERE, HAVING, etc.)
16+
};
17+
18+
struct DetailedWhereConditionResult {
19+
std::string column_name; // The column being compared
20+
std::string operator_type; // The comparison operator (>, <, =, etc.)
21+
std::string value; // The value being compared against
22+
std::string table_name; // The table this condition applies to (if determinable)
23+
std::string context; // The context where this condition appears (WHERE, HAVING, etc.)
24+
};
25+
26+
void RegisterParseWhereFunction(DatabaseInstance &db);
27+
void RegisterParseWhereScalarFunction(DatabaseInstance &db);
28+
void RegisterParseWhereDetailedFunction(DatabaseInstance &db);
29+
30+
} // namespace duckdb

0 commit comments

Comments
 (0)