duckdb_ast.models

Classes

AggregateHandling

Base

Base model with config

BaseExpression

BaseTableRef

BetweenExpression

CaseCheck

CaseExpression

CastExpression

CatalogEntry

CollateExpression

ColumnRefExpression

CommonTableExpressionInfo

CommonTableExpressionMap

ComparisonExpression

ConjunctionExpression

ConstantExpression

DecimalTypeInfo

DistinctModifier

EmptyTableRef

ErrorResponse

Error shape for when parsing fails

ExpressionType

ExtraTypeInfo

FunctionExpression

JoinRef

LambdaExpression

LimitModifier

LimitPercentModifier

ListTypeInfo

LogicalType

LogicalTypeId

OperatorExpression

OrderByNode

OrderByNullType

OrderModifier

OrderType

OrderedDict

Abstract base class for generic types.

Pair

Usage docs: https://docs.pydantic.dev/2.9/concepts/models/

ParameterExpression

ParsedExpression

ParsedExpressionSubclasses

Union of ParsedExpression subclasses

PositionalReferenceExpression

QueryNode

QueryNodeSubclasses

Union of QueryNode subclasses

RecursiveCTENode

ResultModifier

ResultModifierSubclasses

Union of ResultModifier subclasses

Root

Union of possible responses

SampleMethod

SampleOptions

SelectNode

SelectStatement

SetOperationNode

StandardEntry

StarExpression

StatementType

StructTypeInfo

SubqueryExpression

SubqueryRef

SuccessResponse

Returned when parsing succeeds

TableFunctionRef

TableRef

TableRefSubclasses

Union of TableRef subclasses

TypeCatalogEntry

UserTypeInfo

Value

WindowBoundary

WindowExpression

Module Contents

class AggregateHandling

Bases: enum.Enum

src/include/duckdb/common/enums/aggregate_handling.hpp#L16

FORCE_AGGREGATES = 'FORCE_AGGREGATES'
NO_AGGREGATES_ALLOWED = 'NO_AGGREGATES_ALLOWED'
STANDARD_HANDLING = 'STANDARD_HANDLING'
class Base(/, **data: Any)

Bases: pydantic.BaseModel

Base model with config

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

query_location: int | None = None
class BaseExpression(/, **data: Any)

Bases: Base

src/include/duckdb/parser/base_expression.hpp#L18

alias: str
clazz: str
type: str
class BaseTableRef(/, **data: Any)

Bases: TableRef

Represents a TableReference to a base table in the schema

src/include/duckdb/parser/tableref/basetableref.hpp#L16

catalog_name: str
column_name_alias: list[str] | None = None
schema_name: str
table_name: str
type: Literal['BASE_TABLE']
class BetweenExpression(/, **data: Any)

Bases: ParsedExpression

src/include/duckdb/parser/expression/between_expression.hpp#L15

clazz: Literal['BETWEEN']
input: ParsedExpressionSubclasses
lower: ParsedExpressionSubclasses
type: Literal['COMPARE_BETWEEN']
upper: ParsedExpressionSubclasses
class CaseCheck(/, **data: Any)

Bases: Base

src/include/duckdb/parser/expression/case_expression.hpp#L16

then_expr: ParsedExpressionSubclasses
when_expr: ParsedExpressionSubclasses
class CaseExpression(/, **data: Any)

Bases: ParsedExpression

The CaseExpression represents a CASE expression in the query

src/include/duckdb/parser/expression/case_expression.hpp#L25

case_checks: list[CaseCheck]
clazz: Literal['CASE']
else_expr: ParsedExpressionSubclasses
type: Literal['CASE_EXPR']
class CastExpression(/, **data: Any)

Bases: ParsedExpression

CastExpression represents a type cast from one SQL type to another SQL type

src/include/duckdb/parser/expression/cast_expression.hpp#L17

cast_type: LogicalType
child: ParsedExpressionSubclasses
clazz: Literal['CAST']
try_cast: bool
type: Literal['OPERATOR_CAST']
class CatalogEntry(/, **data: Any)

Bases: Base

src/include/duckdb/catalog/catalog_entry.hpp#L25

class CollateExpression(/, **data: Any)

Bases: ParsedExpression

CollateExpression represents a COLLATE statement

src/include/duckdb/parser/expression/collate_expression.hpp#L16

child: ParsedExpressionSubclasses
clazz: Literal['COLLATE']
collation: str
type: Literal['COLLATE']
class ColumnRefExpression(/, **data: Any)

Bases: ParsedExpression

Represents a reference to a column from either the FROM clause or from an alias

src/include/duckdb/parser/expression/columnref_expression.hpp#L18

clazz: Literal['COLUMN_REF']
column_names: list[str]
type: Literal['COLUMN_REF']
class CommonTableExpressionInfo(/, **data: Any)

Bases: Base

src/include/duckdb/parser/common_table_expression_info.hpp#L18

aliases: list[str]
materialized: Literal['CTE_MATERIALIZE_DEFAULT', 'CTE_MATERIALIZE_ALWAYS', 'CTE_MATERIALIZE_NEVER']
query: SelectStatement
class CommonTableExpressionMap(/, **data: Any)

Bases: Base

src/include/duckdb/parser/query_node.hpp#L32

map: OrderedDict[str, CommonTableExpressionInfo]
class ComparisonExpression(/, **data: Any)

Bases: ParsedExpression

ComparisonExpression represents a boolean comparison (e.g. =, >=, <>). Always returns a boolean and has two children.

src/include/duckdb/parser/expression/comparison_expression.hpp#L16

clazz: Literal['COMPARISON']
left: ParsedExpressionSubclasses
right: ParsedExpressionSubclasses
type: Literal['COMPARE_GREATERTHAN', 'COMPARE_EQUAL', 'COMPARE_EQUAL', 'COMPARE_NOTEQUAL', 'COMPARE_GREATERTHANOREQUALTO', 'COMPARE_NOT_DISTINCT_FROM', 'COMPARE_DISTINCT_FROM', 'COMPARE_LESSTHANOREQUALTO', 'COMPARE_LESSTHAN']
class ConjunctionExpression(/, **data: Any)

Bases: ParsedExpression

Represents a conjunction (AND/OR)

src/include/duckdb/parser/expression/conjunction_expression.hpp#L17

children: list[ParsedExpressionSubclasses]
clazz: Literal['CONJUNCTION']
type: Literal['CONJUNCTION_AND', 'CONJUNCTION_OR']
class ConstantExpression(/, **data: Any)

Bases: ParsedExpression

ConstantExpression represents a constant value in the query

src/include/duckdb/parser/expression/constant_expression.hpp#L17

clazz: Literal['CONSTANT']
type: Literal['VALUE_CONSTANT']
value: Value
class DecimalTypeInfo(/, **data: Any)

Bases: ExtraTypeInfo

src/include/duckdb/common/extra_type_info.hpp#L66

scale: int
type: Literal['DECIMAL_TYPE_INFO']
width: int
class DistinctModifier(/, **data: Any)

Bases: ResultModifier

src/include/duckdb/parser/result_modifier.hpp#L144

distinct_on_targets: list[ParsedExpressionSubclasses]
type: Literal['DISTINCT_MODIFIER']
class EmptyTableRef(/, **data: Any)

Bases: TableRef

src/include/duckdb/parser/tableref/emptytableref.hpp#L15

type: Literal['EMPTY']
class ErrorResponse(/, **data: Any)

Bases: Base

Error shape for when parsing fails

error: Literal[True]
error_message: str
error_subtype: str | None = None
error_type: str
position: int | None = None
class ExpressionType

Bases: enum.Enum

Predicate Expression Operation Types

src/include/duckdb/common/enums/expression_type.hpp#L18

AGGREGATE = 'AGGREGATE'
ARRAY_CONSTRUCTOR = 'ARRAY_CONSTRUCTOR'
ARRAY_EXTRACT = 'ARRAY_EXTRACT'
ARRAY_SLICE = 'ARRAY_SLICE'
ARROW = 'ARROW'
BOUND_AGGREGATE = 'BOUND_AGGREGATE'
BOUND_COLUMN_REF = 'BOUND_COLUMN_REF'
BOUND_FUNCTION = 'BOUND_FUNCTION'
BOUND_LAMBDA_REF = 'BOUND_LAMBDA_REF'
BOUND_REF = 'BOUND_REF'
BOUND_UNNEST = 'BOUND_UNNEST'
CASE_EXPR = 'CASE_EXPR'
CAST = 'CAST'
COLLATE = 'COLLATE'
COLUMN_REF = 'COLUMN_REF'
COMPARE_BETWEEN = 'COMPARE_BETWEEN'
COMPARE_BOUNDARY_END = 'COMPARE_BOUNDARY_END'
COMPARE_BOUNDARY_START = 'COMPARE_BOUNDARY_START'
COMPARE_DISTINCT_FROM = 'COMPARE_DISTINCT_FROM'
COMPARE_EQUAL = 'COMPARE_EQUAL'
COMPARE_GREATERTHAN = 'COMPARE_GREATERTHAN'
COMPARE_GREATERTHANOREQUALTO = 'COMPARE_GREATERTHANOREQUALTO'
COMPARE_IN = 'COMPARE_IN'
COMPARE_LESSTHAN = 'COMPARE_LESSTHAN'
COMPARE_LESSTHANOREQUALTO = 'COMPARE_LESSTHANOREQUALTO'
COMPARE_NOTEQUAL = 'COMPARE_NOTEQUAL'
COMPARE_NOT_BETWEEN = 'COMPARE_NOT_BETWEEN'
COMPARE_NOT_DISTINCT_FROM = 'COMPARE_NOT_DISTINCT_FROM'
COMPARE_NOT_IN = 'COMPARE_NOT_IN'
CONJUNCTION_AND = 'CONJUNCTION_AND'
CONJUNCTION_OR = 'CONJUNCTION_OR'
FUNCTION = 'FUNCTION'
FUNCTION_REF = 'FUNCTION_REF'
GROUPING_FUNCTION = 'GROUPING_FUNCTION'
INVALID = 'INVALID'
LAMBDA = 'LAMBDA'
OPERATOR_CAST = 'OPERATOR_CAST'
OPERATOR_COALESCE = 'OPERATOR_COALESCE'
OPERATOR_IS_NOT_NULL = 'OPERATOR_IS_NOT_NULL'
OPERATOR_IS_NULL = 'OPERATOR_IS_NULL'
OPERATOR_NOT = 'OPERATOR_NOT'
OPERATOR_NULLIF = 'OPERATOR_NULLIF'
PLACEHOLDER = 'PLACEHOLDER'
POSITIONAL_REFERENCE = 'POSITIONAL_REFERENCE'
STAR = 'STAR'
STRUCT_EXTRACT = 'STRUCT_EXTRACT'
SUBQUERY = 'SUBQUERY'
TABLE_REF = 'TABLE_REF'
TABLE_STAR = 'TABLE_STAR'
VALUE_CONSTANT = 'VALUE_CONSTANT'
VALUE_DEFAULT = 'VALUE_DEFAULT'
VALUE_NULL = 'VALUE_NULL'
VALUE_PARAMETER = 'VALUE_PARAMETER'
VALUE_SCALAR = 'VALUE_SCALAR'
VALUE_TUPLE = 'VALUE_TUPLE'
VALUE_TUPLE_ADDRESS = 'VALUE_TUPLE_ADDRESS'
VALUE_VECTOR = 'VALUE_VECTOR'
WINDOW_AGGREGATE = 'WINDOW_AGGREGATE'
WINDOW_CUME_DIST = 'WINDOW_CUME_DIST'
WINDOW_FIRST_VALUE = 'WINDOW_FIRST_VALUE'
WINDOW_LAG = 'WINDOW_LAG'
WINDOW_LAST_VALUE = 'WINDOW_LAST_VALUE'
WINDOW_LEAD = 'WINDOW_LEAD'
WINDOW_NTH_VALUE = 'WINDOW_NTH_VALUE'
WINDOW_NTILE = 'WINDOW_NTILE'
WINDOW_PERCENT_RANK = 'WINDOW_PERCENT_RANK'
WINDOW_RANK = 'WINDOW_RANK'
WINDOW_RANK_DENSE = 'WINDOW_RANK_DENSE'
WINDOW_ROW_NUMBER = 'WINDOW_ROW_NUMBER'
class ExtraTypeInfo(/, **data: Any)

Bases: Base

src/include/duckdb/common/extra_type_info.hpp#L31

alias: str
catalog_entry: TypeCatalogEntry | None = None
modifiers: list[Value]
type: str
class FunctionExpression(/, **data: Any)

Bases: ParsedExpression

Represents a function call

src/include/duckdb/parser/expression/function_expression.hpp#L17

catalog: str
children: list[ParsedExpressionSubclasses]
clazz: Literal['FUNCTION']
distinct: bool
export_state: bool
filter: ParsedExpressionSubclasses | None = None
function_name: str
is_operator: bool
order_bys: OrderModifier
schema_name: str
type: Literal['FUNCTION']
class JoinRef(/, **data: Any)

Bases: TableRef

Represents a JOIN between two expressions

src/include/duckdb/parser/tableref/joinref.hpp#L21

condition: ParsedExpressionSubclasses | None = None
delim_flipped: bool
duplicate_eliminated_columns: list[str]
join_type: Literal['INVALID', 'LEFT', 'RIGHT', 'INNER', 'OUTER', 'SEMI', 'ANTI', 'MARK', 'SINGLE']
left: TableRefSubclasses
ref_type: Literal['CROSS', 'ASOF', 'NATURAL', 'REGULAR', 'DEPENDENT', 'POSITIONAL']
right: TableRefSubclasses
type: Literal['JOIN']
using_columns: list[str]
class LambdaExpression(/, **data: Any)

Bases: ParsedExpression

LambdaExpression represents either: 1. A lambda function that can be used for, e.g., mapping an expression to a list 2. An OperatorExpression with the "->" operator (JSON)

src/include/duckdb/parser/expression/lambda_expression.hpp#L20

clazz: Literal['LAMBDA']
expr: ParsedExpressionSubclasses
lhs: ParsedExpressionSubclasses
type: Literal['LAMBDA']
class LimitModifier(/, **data: Any)

Bases: ResultModifier

src/include/duckdb/parser/result_modifier.hpp#L98

limit: ParsedExpressionSubclasses
offset: ParsedExpressionSubclasses
type: Literal['LIMIT_MODIFIER']
class LimitPercentModifier(/, **data: Any)

Bases: ResultModifier

src/include/duckdb/parser/result_modifier.hpp#L165

limit: ParsedExpressionSubclasses
offset: ParsedExpressionSubclasses
type: Literal['LIMIT_PERCENT_MODIFIER']
class ListTypeInfo(/, **data: Any)

Bases: ExtraTypeInfo

src/include/duckdb/common/extra_type_info.hpp#L105

child_type: LogicalType
type: Literal['LIST_TYPE_INFO']
class LogicalType(/, **data: Any)

Bases: Base

src/include/duckdb/common/types.hpp#L238

id: LogicalTypeId
type_info: ListTypeInfo | DecimalTypeInfo | UserTypeInfo | StructTypeInfo | None
class LogicalTypeId

Bases: enum.Enum

SQL Types

src/include/duckdb/common/types.hpp#L185

AGGREGATE_STATE = 'AGGREGATE_STATE'
ANY = 'ANY'
BIGINT = 'BIGINT'
BIT = 'BIT'
BLOB = 'BLOB'
BOOLEAN = 'BOOLEAN'
CHAR = 'CHAR'
DATE = 'DATE'
DECIMAL = 'DECIMAL'
DOUBLE = 'DOUBLE'
ENUM = 'ENUM'
FLOAT = 'FLOAT'
HUGEINT = 'HUGEINT'
INTEGER = 'INTEGER'
INTERVAL = 'INTERVAL'
INVALID = 'INVALID'
LAMBDA = 'LAMBDA'
LIST = 'LIST'
MAP = 'MAP'
NULL = 'NULL'
POINTER = 'POINTER'
SMALLINT = 'SMALLINT'
STRUCT = 'STRUCT'
TABLE = 'TABLE'
TIME = 'TIME'
TIMESTAMP = 'TIMESTAMP'
TIMESTAMP_MS = 'TIMESTAMP_MS'
TIMESTAMP_NS = 'TIMESTAMP_NS'
TIMESTAMP_SEC = 'TIMESTAMP_SEC'
TIMESTAMP_TZ = 'TIMESTAMP WITH TIME ZONE'
TIME_TZ = 'TIME_TZ'
TINYINT = 'TINYINT'
UBIGINT = 'UBIGINT'
UINTEGER = 'UINTEGER'
UNION = 'UNION'
UNKNOWN = 'UNKNOWN'
USER = 'USER'
USMALLINT = 'USMALLINT'
UTINYINT = 'UTINYINT'
UUID = 'UUID'
VALIDITY = 'VALIDITY'
VARCHAR = 'VARCHAR'
class OperatorExpression(/, **data: Any)

Bases: ParsedExpression

Represents a built-in operator expression

src/include/duckdb/parser/expression/operator_expression.hpp#L19

children: list[ParsedExpressionSubclasses]
clazz: Literal['OPERATOR']
type: Literal['OPERATOR_IS_NULL', 'OPERATOR_IN', 'OPERATOR_NOT', 'OPERATOR_IS_NOT_NULL', 'COMPARE_NOT_IN', 'COMPARE_IN', 'ARRAY_EXTRACT', 'ARRAY_SLICE', 'STRUCT_EXTRACT']
class OrderByNode(/, **data: Any)

Bases: Base

Single node in ORDER BY statement

src/include/duckdb/parser/result_modifier.hpp#L69

expression: ParsedExpressionSubclasses
null_order: OrderByNullType
type: OrderType
class OrderByNullType

Bases: enum.Enum

src/include/duckdb/common/enums/order_type.hpp#L18

INVALID = 'INVALID'
NULLS_FIRST = 'NULLS_FIRST'
NULLS_LAST = 'NULLS_LAST'
ORDER_DEFAULT = 'ORDER_DEFAULT'
class OrderModifier(/, **data: Any)

Bases: Base

src/include/duckdb/parser/result_modifier.hpp#L121

orders: list[OrderByNode]
type: Literal['ORDER_MODIFIER']
class OrderType

Bases: enum.Enum

src/include/duckdb/common/enums/order_type.hpp#L16

ASCENDING = 'ASCENDING'
DESCENDING = 'DESCENDING'
INVALID = 'INVALID'
ORDER_DEFAULT = 'ORDER_DEFAULT'
class OrderedDict

Bases: pydantic.RootModel[list[Pair[K, V]]], Generic[K, V]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
class Pair(/, **data: Any)

Bases: pydantic.BaseModel, Generic[K, V]

Usage docs: https://docs.pydantic.dev/2.9/concepts/models/

A base class for creating Pydantic models.

Attributes:

__class_vars__: The names of the class variables defined on the model. __private_attributes__: Metadata about the private attributes of the model. __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.

__pydantic_complete__: Whether model building is completed, or if there are still undefined fields. __pydantic_core_schema__: The core schema of the model. __pydantic_custom_init__: Whether the model has a custom __init__ function. __pydantic_decorators__: Metadata containing the decorators defined on the model.

This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.

__pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to

__args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these.

__pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. __pydantic_post_init__: The name of the post-init method for the model, if defined. __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel]. __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model. __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.

__pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra]

is set to ‘allow’.

__pydantic_fields_set__: The names of fields explicitly set during instantiation. __pydantic_private__: Values of private attributes set on the model instance.

key: K
value: V
class ParameterExpression(/, **data: Any)

Bases: ParsedExpression

src/include/duckdb/parser/expression/parameter_expression.hpp#L30

clazz: Literal['PARAMETER']
identifier: str
type: Literal['VALUE_PARAMETER']
class ParsedExpression(/, **data: Any)

Bases: BaseExpression

src/include/duckdb/parser/parsed_expression.hpp#L34

class ParsedExpressionSubclasses

Bases: pydantic.RootModel[Annotated[Union[FunctionExpression, ColumnRefExpression, StarExpression, ConstantExpression, CastExpression, ComparisonExpression, ConjunctionExpression, LambdaExpression, ParameterExpression, PositionalReferenceExpression, SubqueryExpression, OperatorExpression, CaseExpression, CollateExpression, BetweenExpression, WindowExpression], Field(discriminator='type')]]

Union of ParsedExpression subclasses

class PositionalReferenceExpression(/, **data: Any)

Bases: ParsedExpression

src/include/duckdb/parser/expression/positional_reference_expression.hpp#L14

clazz: Literal['POSITIONAL_REFERENCE']
index: int
type: Literal['POSITIONAL_REFERENCE']
class QueryNode(/, **data: Any)

Bases: Base

src/include/duckdb/parser/query_node.hpp#L47

cte_map: CommonTableExpressionMap
modifiers: list[ResultModifierSubclasses]
type: str
class QueryNodeSubclasses

Bases: pydantic.RootModel[Annotated[Union[SelectNode, SetOperationNode, CTENode, RecursiveCTENode], Field(discriminator='type')]]

Union of QueryNode subclasses

class RecursiveCTENode(/, **data: Any)

Bases: QueryNode

src/include/duckdb/parser/query_node/recursive_cte_node.hpp#L17

aliases: list[str]
cte_name: str
left: QueryNodeSubclasses
right: QueryNodeSubclasses
type: Literal['RECURSIVE_CTE_NODE']
union_all: bool
class ResultModifier(/, **data: Any)

Bases: Base

src/include/duckdb/parser/result_modifier.hpp#L33

type: str
class ResultModifierSubclasses

Bases: pydantic.RootModel[Annotated[Union[LimitPercentModifier, DistinctModifier, LimitModifier, OrderModifier], Field(discriminator='type')]]

Union of ResultModifier subclasses

class Root

Bases: pydantic.RootModel[Annotated[Union[ErrorResponse, SuccessResponse], Field(discriminator='error')]]

Union of possible responses

class SampleMethod

Bases: enum.Enum

src/include/duckdb/parser/parsed_data/sample_options.hpp#L18

BERNOULLI_SAMPLE = 'Bernoulli'
RESERVOIR_SAMPLE = 'Reservoir'
SYSTEM_SAMPLE = 'System'
class SampleOptions(/, **data: Any)

Bases: Base

src/include/duckdb/parser/parsed_data/sample_options.hpp#L23

is_percentage: bool
method: SampleMethod
sample_size: Value
seed: int = -1
class SelectNode(/, **data: Any)

Bases: QueryNode

SelectNode represents a standard SELECT statement

src/include/duckdb/parser/query_node/select_node.hpp#L22

aggregate_handling: AggregateHandling | None = None
from_table: TableRefSubclasses
group_expressions: list[ParsedExpressionSubclasses] | None = None
group_sets: list[GroupingSet] | None = None
having: ParsedExpressionSubclasses | None = None
qualify: ParsedExpressionSubclasses | None = None
sample: SampleOptions | None = None
select_list: list[ParsedExpressionSubclasses]
type: Literal['SELECT_NODE']
where_clause: ParsedExpressionSubclasses | None = None
class SelectStatement(/, **data: Any)

Bases: Base

SelectStatement is a typical SELECT clause

src/include/duckdb/parser/statement/select_statement.hpp#L24

node: QueryNodeSubclasses
class SetOperationNode(/, **data: Any)

Bases: QueryNode

src/include/duckdb/parser/query_node/set_operation_node.hpp#L18

left: QueryNodeSubclasses
right: QueryNodeSubclasses
setop_all: bool = True
setop_type: Literal['NONE', 'UNION', 'EXCEPT', 'INTERSECT', 'UNION_BY_NAME']
type: Literal['SET_OPERATION_NODE']
class StandardEntry(/, **data: Any)

Bases: CatalogEntry

src/include/duckdb/catalog/standard_entry.hpp#L17

class StarExpression(/, **data: Any)

Bases: ParsedExpression

Represents a * expression in the SELECT clause

src/include/duckdb/parser/expression/star_expression.hpp#L17

clazz: Literal['STAR']
columns: bool
exclude_list: list[str]
expr: ParsedExpressionSubclasses | None = None
relation_name: str
replace_list: OrderedDict[str, ParsedExpressionSubclasses]
type: Literal['STAR']
unpacked: bool
class StatementType

Bases: enum.Enum

Statement Types

src/include/duckdb/common/enums/statement_type.hpp#L19

ALTER_STATEMENT = 'ALTER_STATEMENT'
ANALYZE_STATEMENT = 'ANALYZE_STATEMENT'
ATTACH_STATEMENT = 'ATTACH_STATEMENT'
CALL_STATEMENT = 'CALL_STATEMENT'
COPY_STATEMENT = 'COPY_STATEMENT'
CREATE_FUNC_STATEMENT = 'CREATE_FUNC_STATEMENT'
CREATE_STATEMENT = 'CREATE_STATEMENT'
DELETE_STATEMENT = 'DELETE_STATEMENT'
DETACH_STATEMENT = 'DETACH_STATEMENT'
DROP_STATEMENT = 'DROP_STATEMENT'
EXECUTE_STATEMENT = 'EXECUTE_STATEMENT'
EXPLAIN_STATEMENT = 'EXPLAIN_STATEMENT'
EXPORT_STATEMENT = 'EXPORT_STATEMENT'
EXTENSION_STATEMENT = 'EXTENSION_STATEMENT'
INSERT_STATEMENT = 'INSERT_STATEMENT'
INVALID_STATEMENT = 'INVALID_STATEMENT'
LOAD_STATEMENT = 'LOAD_STATEMENT'
LOGICAL_PLAN_STATEMENT = 'LOGICAL_PLAN_STATEMENT'
MULTI_STATEMENT = 'MULTI_STATEMENT'
PRAGMA_STATEMENT = 'PRAGMA_STATEMENT'
PREPARE_STATEMENT = 'PREPARE_STATEMENT'
RELATION_STATEMENT = 'RELATION_STATEMENT'
SELECT = 'SELECT'
SELECT_STATEMENT = 'SELECT_STATEMENT'
SET_STATEMENT = 'SET_STATEMENT'
SHOW_STATEMENT = 'SHOW_STATEMENT'
TRANSACTION_STATEMENT = 'TRANSACTION_STATEMENT'
UPDATE_STATEMENT = 'UPDATE_STATEMENT'
VACUUM_STATEMENT = 'VACUUM_STATEMENT'
VARIABLE_SET_STATEMENT = 'VARIABLE_SET_STATEMENT'
class StructTypeInfo(/, **data: Any)

Bases: ExtraTypeInfo

src/include/duckdb/common/extra_type_info.hpp#L124

child_types: list[FirstSecond[str, LogicalType]]
type: Literal['STRUCT_TYPE_INFO']
class SubqueryExpression(/, **data: Any)

Bases: ParsedExpression

Represents a subquery

src/include/duckdb/parser/expression/subquery_expression.hpp#L18

child: ParsedExpressionSubclasses | None = None
clazz: Literal['SUBQUERY']
comparison_type: Literal['INVALID', 'COMPARE_EQUAL']
subquery: SelectStatement
subquery_type: Literal['SCALAR', 'ANY', 'EXISTS', 'INVALID', 'NOT_EXISTS']
type: Literal['SUBQUERY']
class SubqueryRef(/, **data: Any)

Bases: TableRef

Represents a subquery

src/include/duckdb/parser/tableref/subqueryref.hpp#L16

column_name_alias: list[str]
subquery: SelectStatement
type: Literal['SUBQUERY']
class SuccessResponse(/, **data: Any)

Bases: Base

Returned when parsing succeeds

error: Literal[False]
statements: list[SelectStatement]
class TableFunctionRef(/, **data: Any)

Bases: TableRef

Represents a Table producing function

src/include/duckdb/parser/tableref/table_function_ref.hpp#L18

column_name_alias: list[str] | None = None
function: FunctionExpression
type: Literal['TABLE_FUNCTION']
class TableRef(/, **data: Any)

Bases: Base

Represents a generic expression that returns a table.

src/include/duckdb/parser/tableref.hpp#L20

alias: str
sample: SampleOptions | None = None
class TableRefSubclasses

Bases: pydantic.RootModel[Annotated[Union[BaseTableRef, EmptyTableRef, TableFunctionRef, SubqueryRef, JoinRef], Field(discriminator='type')]]

Union of TableRef subclasses

class TypeCatalogEntry(/, **data: Any)

Bases: StandardEntry

A type catalog entry

src/include/duckdb/catalog/catalog_entry/type_catalog_entry.hpp#L18

user_type: LogicalType
class UserTypeInfo(/, **data: Any)

Bases: ExtraTypeInfo

src/include/duckdb/common/extra_type_info.hpp#L163

catalog: str
schema_name: str
type: Literal['USER_TYPE_INFO']
user_type_modifiers: list[Value]
user_type_name: str
class Value(/, **data: Any)

Bases: Base, Generic[T]

The Value object holds a single arbitrary value of any type that can be stored in the database.

src/include/duckdb/common/types/value.hpp#L30

is_null: bool
type: LogicalType
value: T | None = None
class WindowBoundary

Bases: enum.Enum

src/include/duckdb/parser/expression/window_expression.hpp#L16

CURRENT_ROW_RANGE = 'CURRENT_ROW_RANGE'
CURRENT_ROW_ROWS = 'CURRENT_ROW_ROWS'
EXPR_FOLLOWING_RANGE = 'EXPR_FOLLOWING_RANGE'
EXPR_FOLLOWING_ROWS = 'EXPR_FOLLOWING_ROWS'
EXPR_PRECEDING_RANGE = 'EXPR_PRECEDING_RANGE'
EXPR_PRECEDING_ROWS = 'EXPR_PRECEDING_ROWS'
INVALID = 'INVALID'
UNBOUNDED_FOLLOWING = 'UNBOUNDED_FOLLOWING'
UNBOUNDED_PRECEDING = 'UNBOUNDED_PRECEDING'
class WindowExpression(/, **data: Any)

Bases: ParsedExpression

The WindowExpression represents a window function in the query. They are a special case of aggregates which is why they inherit from them.

src/include/duckdb/parser/expression/window_expression.hpp#L35

catalog: str
children: list[ParsedExpressionSubclasses]
clazz: Literal['WINDOW']
default_expr: ParsedExpressionSubclasses | None = None
distinct: bool
end: WindowBoundary
end_expr: ParsedExpressionSubclasses | None = None
exclude_clause: WindowExcludeMode
filter_expr: ParsedExpressionSubclasses | None = None
function_name: str
ignore_nulls: bool
offset_expr: ParsedExpressionSubclasses | None = None
orders: list[OrderByNode]
partitions: list[ParsedExpressionSubclasses]
schema_name: str
start: WindowBoundary
start_expr: ParsedExpressionSubclasses | None = None
type: Literal['WINDOW_AGGREGATE', 'WINDOW_ROW_NUMBER', 'WINDOW_FIRST_VALUE', 'WINDOW_LAST_VALUE', 'WINDOW_NTH_VALUE', 'WINDOW_RANK', 'WINDOW_RANK_DENSE', 'WINDOW_PERCENT_RANK', 'WINDOW_CUME_DIST', 'WINDOW_LEAD', 'WINDOW_LAG', 'WINDOW_NTILE']