TypeVisitor (common/type_visitor.hpp)

duckdb · src/include/duckdb/common/type_visitor.hpp · cpp · MIT
database, tag:knn-classified

Utility to traverse and modify DuckDB logical types, supporting contains and replace.

// Source: https://github.com/duckdb/duckdb | License: MIT | Copyright 2018-2026 Stichting DuckDB Foundation
// Provided via justclaw.it.com; keep this notice with the code.
//===----------------------------------------------------------------------===//
//                         DuckDB
//
// duckdb/common/type_visitor.hpp
//
//
//===----------------------------------------------------------------------===//

#pragma once

#include "duckdb/common/numeric_utils.hpp"
#include "duckdb/common/optional_idx.hpp"
#include "duckdb/common/types.hpp"

#include <algorithm>

namespace duckdb {

struct TypeVisitor {
	template <class F>
	static bool Contains(const LogicalType &type, F &&predicate);

	static bool Contains(const LogicalType &type, LogicalTypeId type_id);

	template <class F>
	static Logi

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key