Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::Value Class Reference

#include <duckdb.hpp>

Collaboration diagram for duckdb::Value:

Classes

union  Val
 The value of the object, if it is of a constant size Type. More...
 

Public Member Functions

DUCKDB_API Value (LogicalType type=LogicalType::SQLNULL)
 Create an empty NULL value of the specified type.
 
DUCKDB_API Value (int32_t val)
 Create an INTEGER value.
 
DUCKDB_API Value (bool val)
 Create a BOOLEAN value.
 
DUCKDB_API Value (int64_t val)
 Create a BIGINT value.
 
DUCKDB_API Value (float val)
 Create a FLOAT value.
 
DUCKDB_API Value (double val)
 Create a DOUBLE value.
 
DUCKDB_API Value (const char *val)
 Create a VARCHAR value.
 
DUCKDB_API Value (std::nullptr_t val)
 Create a NULL value.
 
DUCKDB_API Value (string_t val)
 Create a VARCHAR value.
 
DUCKDB_API Value (string val)
 Create a VARCHAR value.
 
DUCKDB_API Value (String val)
 Create a VARCHAR value.
 
DUCKDB_API Value (const Value &other)
 Copy constructor.
 
DUCKDB_API Value (Value &&other) noexcept
 Move constructor.
 
DUCKDB_API ~Value ()
 Destructor.
 
DUCKDB_API Valueoperator= (const Value &other)
 
DUCKDB_API Valueoperator= (Value &&other) noexcept
 
LogicalTypeGetTypeMutable ()
 
const LogicalTypetype () const
 
bool IsNull () const
 
template<class T >
GetValue () const
 
template<class T >
GetValueUnsafe () const
 
Value Copy () const
 Return a copy of this value.
 
DUCKDB_API hash_t Hash () const
 Hashes the Value.
 
DUCKDB_API string ToString () const
 Convert this value to a string.
 
DUCKDB_API string ToSQLString () const
 Convert this value to a SQL-parseable string.
 
DUCKDB_API uintptr_t GetPointer () const
 
DUCKDB_API Value CastAs (CastFunctionSet &set, GetCastFunctionInput &get_input, const LogicalType &target_type, bool strict=false) const
 Cast this value to another type, throws exception if its not possible.
 
DUCKDB_API Value CastAs (ClientContext &context, const LogicalType &target_type, bool strict=false) const
 
DUCKDB_API Value DefaultCastAs (const LogicalType &target_type, bool strict=false) const
 
DUCKDB_API bool TryCastAs (CastFunctionSet &set, GetCastFunctionInput &get_input, const LogicalType &target_type, Value &new_value, string *error_message, bool strict=false) const
 Tries to cast this value to another type, and stores the result in "new_value".
 
DUCKDB_API bool TryCastAs (ClientContext &context, const LogicalType &target_type, Value &new_value, string *error_message, bool strict=false) const
 
DUCKDB_API bool DefaultTryCastAs (const LogicalType &target_type, Value &new_value, string *error_message, bool strict=false) const
 
DUCKDB_API bool TryCastAs (CastFunctionSet &set, GetCastFunctionInput &get_input, const LogicalType &target_type, bool strict=false)
 Tries to cast this value to another type, and stores the result in THIS value again.
 
DUCKDB_API bool TryCastAs (ClientContext &context, const LogicalType &target_type, bool strict=false)
 
DUCKDB_API bool DefaultTryCastAs (const LogicalType &target_type, bool strict=false)
 
DUCKDB_API void Reinterpret (LogicalType new_type)
 
DUCKDB_API void Serialize (Serializer &serializer) const
 Serializes a Value to a stand-alone binary blob.
 
DUCKDB_API bool operator== (const Value &rhs) const
 
DUCKDB_API bool operator!= (const Value &rhs) const
 
DUCKDB_API bool operator< (const Value &rhs) const
 
DUCKDB_API bool operator> (const Value &rhs) const
 
DUCKDB_API bool operator<= (const Value &rhs) const
 
DUCKDB_API bool operator>= (const Value &rhs) const
 
DUCKDB_API bool operator== (const int64_t &rhs) const
 
DUCKDB_API bool operator!= (const int64_t &rhs) const
 
DUCKDB_API bool operator< (const int64_t &rhs) const
 
DUCKDB_API bool operator> (const int64_t &rhs) const
 
DUCKDB_API bool operator<= (const int64_t &rhs) const
 
DUCKDB_API bool operator>= (const int64_t &rhs) const
 
DUCKDB_API void Print () const
 
template<>
Value DUCKDB_API CreateValue (bool value)
 
template<>
Value DUCKDB_API CreateValue (uint8_t value)
 
template<>
Value DUCKDB_API CreateValue (uint16_t value)
 
template<>
Value DUCKDB_API CreateValue (uint32_t value)
 
template<>
Value DUCKDB_API CreateValue (uint64_t value)
 
template<>
Value DUCKDB_API CreateValue (int8_t value)
 
template<>
Value DUCKDB_API CreateValue (int16_t value)
 
template<>
Value DUCKDB_API CreateValue (int32_t value)
 
template<>
Value DUCKDB_API CreateValue (int64_t value)
 
template<>
Value DUCKDB_API CreateValue (hugeint_t value)
 
template<>
Value DUCKDB_API CreateValue (uhugeint_t value)
 
template<>
Value DUCKDB_API CreateValue (date_t value)
 
template<>
Value DUCKDB_API CreateValue (dtime_t value)
 
template<>
Value DUCKDB_API CreateValue (dtime_ns_t value)
 
template<>
Value DUCKDB_API CreateValue (dtime_tz_t value)
 
template<>
Value DUCKDB_API CreateValue (timestamp_t value)
 
template<>
Value DUCKDB_API CreateValue (timestamp_sec_t value)
 
template<>
Value DUCKDB_API CreateValue (timestamp_ms_t value)
 
template<>
Value DUCKDB_API CreateValue (timestamp_ns_t value)
 
template<>
Value DUCKDB_API CreateValue (timestamp_tz_t value)
 
template<>
Value DUCKDB_API CreateValue (const char *value)
 
template<>
Value DUCKDB_API CreateValue (string value)
 
template<>
Value DUCKDB_API CreateValue (string_t value)
 
template<>
Value DUCKDB_API CreateValue (float value)
 
template<>
Value DUCKDB_API CreateValue (double value)
 
template<>
Value DUCKDB_API CreateValue (interval_t value)
 
template<>
Value DUCKDB_API CreateValue (Value value)
 
template<>
DUCKDB_API bool GetValue () const
 
template<>
DUCKDB_API int8_t GetValue () const
 
template<>
DUCKDB_API int16_t GetValue () const
 
template<>
DUCKDB_API int32_t GetValue () const
 
template<>
DUCKDB_API int64_t GetValue () const
 
template<>
DUCKDB_API uint8_t GetValue () const
 
template<>
DUCKDB_API uint16_t GetValue () const
 
template<>
DUCKDB_API uint32_t GetValue () const
 
template<>
DUCKDB_API uint64_t GetValue () const
 
template<>
DUCKDB_API hugeint_t GetValue () const
 
template<>
DUCKDB_API uhugeint_t GetValue () const
 
template<>
DUCKDB_API string GetValue () const
 
template<>
DUCKDB_API float GetValue () const
 
template<>
DUCKDB_API double GetValue () const
 
template<>
DUCKDB_API date_t GetValue () const
 
template<>
DUCKDB_API dtime_t GetValue () const
 
template<>
DUCKDB_API dtime_ns_t GetValue () const
 
template<>
DUCKDB_API dtime_tz_t GetValue () const
 
template<>
DUCKDB_API timestamp_t GetValue () const
 
template<>
DUCKDB_API timestamp_sec_t GetValue () const
 
template<>
DUCKDB_API timestamp_ms_t GetValue () const
 
template<>
DUCKDB_API timestamp_ns_t GetValue () const
 
template<>
DUCKDB_API timestamp_tz_t GetValue () const
 
template<>
DUCKDB_API interval_t GetValue () const
 
template<>
DUCKDB_API Value GetValue () const
 
template<>
DUCKDB_API bool GetValueUnsafe () const
 
template<>
DUCKDB_API int8_t GetValueUnsafe () const
 
template<>
DUCKDB_API int16_t GetValueUnsafe () const
 
template<>
DUCKDB_API int32_t GetValueUnsafe () const
 
template<>
DUCKDB_API int64_t GetValueUnsafe () const
 
template<>
DUCKDB_API hugeint_t GetValueUnsafe () const
 
template<>
DUCKDB_API uhugeint_t GetValueUnsafe () const
 
template<>
DUCKDB_API uint8_t GetValueUnsafe () const
 
template<>
DUCKDB_API uint16_t GetValueUnsafe () const
 
template<>
DUCKDB_API uint32_t GetValueUnsafe () const
 
template<>
DUCKDB_API uint64_t GetValueUnsafe () const
 
template<>
DUCKDB_API string GetValueUnsafe () const
 
template<>
DUCKDB_API string_t GetValueUnsafe () const
 
template<>
DUCKDB_API float GetValueUnsafe () const
 
template<>
DUCKDB_API double GetValueUnsafe () const
 
template<>
DUCKDB_API date_t GetValueUnsafe () const
 
template<>
DUCKDB_API dtime_t GetValueUnsafe () const
 
template<>
DUCKDB_API dtime_ns_t GetValueUnsafe () const
 
template<>
DUCKDB_API dtime_tz_t GetValueUnsafe () const
 
template<>
DUCKDB_API timestamp_t GetValueUnsafe () const
 
template<>
DUCKDB_API timestamp_sec_t GetValueUnsafe () const
 
template<>
DUCKDB_API timestamp_ms_t GetValueUnsafe () const
 
template<>
DUCKDB_API timestamp_ns_t GetValueUnsafe () const
 
template<>
DUCKDB_API timestamp_tz_t GetValueUnsafe () const
 
template<>
DUCKDB_API interval_t GetValueUnsafe () const
 
template<>
DUCKDB_API bool IsNan (float input)
 
template<>
DUCKDB_API bool IsNan (double input)
 
template<>
DUCKDB_API bool IsFinite (float input)
 
template<>
DUCKDB_API bool IsFinite (double input)
 
template<>
DUCKDB_API bool IsFinite (date_t input)
 
template<>
DUCKDB_API bool IsFinite (timestamp_t input)
 
template<>
DUCKDB_API bool IsFinite (timestamp_sec_t input)
 
template<>
DUCKDB_API bool IsFinite (timestamp_ms_t input)
 
template<>
DUCKDB_API bool IsFinite (timestamp_ns_t input)
 
template<>
DUCKDB_API bool IsFinite (timestamp_tz_t input)
 

Static Public Member Functions

static DUCKDB_API Value MinimumValue (const LogicalType &type)
 Create the lowest possible value of a given type (numeric only)
 
static DUCKDB_API Value MaximumValue (const LogicalType &type)
 Create the highest possible value of a given type (numeric only)
 
static DUCKDB_API Value NegativeInfinity (const LogicalType &type)
 Create the negative infinite value of a given type (numeric only)
 
static DUCKDB_API Value Infinity (const LogicalType &type)
 Create the positive infinite value of a given type (numeric only)
 
static DUCKDB_API Value Numeric (const LogicalType &type, int64_t value)
 Create a Numeric value of the specified type with the specified value.
 
static DUCKDB_API Value Numeric (const LogicalType &type, hugeint_t value)
 
static DUCKDB_API Value Numeric (const LogicalType &type, uhugeint_t value)
 
static DUCKDB_API Value BOOLEAN (bool value)
 Create a boolean Value from a specified value.
 
static DUCKDB_API Value TINYINT (int8_t value)
 Create a tinyint Value from a specified value.
 
static DUCKDB_API Value SMALLINT (int16_t value)
 Create a smallint Value from a specified value.
 
static DUCKDB_API Value INTEGER (int32_t value)
 Create an integer Value from a specified value.
 
static DUCKDB_API Value BIGINT (int64_t value)
 Create a bigint Value from a specified value.
 
static DUCKDB_API Value UTINYINT (uint8_t value)
 Create an unsigned tinyint Value from a specified value.
 
static DUCKDB_API Value USMALLINT (uint16_t value)
 Create an unsigned smallint Value from a specified value.
 
static DUCKDB_API Value UINTEGER (uint32_t value)
 Create an unsigned integer Value from a specified value.
 
static DUCKDB_API Value UBIGINT (uint64_t value)
 Create an unsigned bigint Value from a specified value.
 
static DUCKDB_API Value HUGEINT (hugeint_t value)
 Create a hugeint Value from a specified value.
 
static DUCKDB_API Value UHUGEINT (uhugeint_t value)
 Create a uhugeint Value from a specified value.
 
static DUCKDB_API Value UUID (const string &value)
 Create a uuid Value from a specified value.
 
static DUCKDB_API Value UUID (hugeint_t value)
 Create a uuid Value from a specified value.
 
static DUCKDB_API Value HASH (hash_t value)
 Create a hash Value from a specified value.
 
static DUCKDB_API Value POINTER (uintptr_t value)
 Create a pointer Value from a specified value.
 
static DUCKDB_API Value DATE (date_t date)
 Create a date Value from a specified date.
 
static DUCKDB_API Value DATE (int32_t year, int32_t month, int32_t day)
 Create a date Value from a specified date.
 
static DUCKDB_API Value TIME (dtime_t time)
 Create a time Value from a specified time.
 
static DUCKDB_API Value TIME_NS (dtime_ns_t time)
 
static DUCKDB_API Value TIMETZ (dtime_tz_t time)
 
static DUCKDB_API Value TIME (int32_t hour, int32_t min, int32_t sec, int32_t micros)
 Create a time Value from a specified time.
 
static DUCKDB_API Value TIMESTAMP (date_t date, dtime_t time)
 Create a timestamp Value from a specified date/time combination.
 
static DUCKDB_API Value TIMESTAMP (timestamp_t timestamp)
 Create a timestamp Value from a specified value.
 
static DUCKDB_API Value TIMESTAMPSEC (timestamp_sec_t timestamp)
 Create a timestamp_s Value from a specified value.
 
static DUCKDB_API Value TIMESTAMPMS (timestamp_ms_t timestamp)
 Create a timestamp_ms Value from a specified value.
 
static DUCKDB_API Value TIMESTAMPNS (timestamp_ns_t timestamp)
 Create a timestamp_ns Value from a specified value.
 
static DUCKDB_API Value TIMESTAMPTZ (timestamp_tz_t timestamp)
 Create a timestamp_tz Value from a specified value.
 
static DUCKDB_API Value TIMESTAMP (int32_t year, int32_t month, int32_t day, int32_t hour, int32_t min, int32_t sec, int32_t micros)
 Create a timestamp Value from a specified timestamp in separate values.
 
static DUCKDB_API Value INTERVAL (int32_t months, int32_t days, int64_t micros)
 
static DUCKDB_API Value INTERVAL (interval_t interval)
 
static DUCKDB_API Value ENUM (uint64_t value, const LogicalType &original_type)
 
static DUCKDB_API Value DECIMAL (int16_t value, uint8_t width, uint8_t scale)
 
static DUCKDB_API Value DECIMAL (int32_t value, uint8_t width, uint8_t scale)
 
static DUCKDB_API Value DECIMAL (int64_t value, uint8_t width, uint8_t scale)
 
static DUCKDB_API Value DECIMAL (hugeint_t value, uint8_t width, uint8_t scale)
 
static DUCKDB_API Value FLOAT (float value)
 Create a float Value from a specified value.
 
static DUCKDB_API Value DOUBLE (double value)
 Create a double Value from a specified value.
 
static DUCKDB_API Value STRUCT (child_list_t< Value > values)
 Create a struct value with given list of entries.
 
static DUCKDB_API Value STRUCT (const LogicalType &type, vector< Value > struct_values)
 
static DUCKDB_API Value VARIANT (vector< Value > children)
 Create a variant value with given list of internal variant data (keys/children/values/data)
 
static DUCKDB_API Value LIST (const LogicalType &child_type, vector< Value > values)
 Create a list value with the given entries.
 
static DUCKDB_API Value LIST (vector< Value > values)
 
static DUCKDB_API Value ARRAY (const LogicalType &type, vector< Value > values)
 
static DUCKDB_API Value MAP (const LogicalType &child_type, vector< Value > values)
 Create a map value with the given entries.
 
static DUCKDB_API Value MAP (const LogicalType &key_type, const LogicalType &value_type, vector< Value > keys, vector< Value > values)
 Create a map value with the given entries.
 
static DUCKDB_API Value MAP (const InsertionOrderPreservingMap< string > &kv_pairs)
 Create a map value from a set of key-value pairs.
 
static DUCKDB_API Value UNION (child_list_t< LogicalType > members, uint8_t tag, Value value)
 Create a union value from a selected value and a tag from a set of alternatives.
 
static DUCKDB_API Value BLOB (const_data_ptr_t data, idx_t len)
 Create a blob Value from a data pointer and a length: no bytes are interpreted.
 
static Value BLOB_RAW (const string &data)
 
static DUCKDB_API Value BLOB (const string &data)
 Creates a blob by casting a specified string to a blob (i.e. interpreting \x characters)
 
static DUCKDB_API Value BIT (const_data_ptr_t data, idx_t len)
 Creates a bitstring by casting a specified string to a bitstring.
 
static DUCKDB_API Value BIT (const string &data)
 
static DUCKDB_API Value BIGNUM (const_data_ptr_t data, idx_t len)
 
static DUCKDB_API Value BIGNUM (const string &data)
 
static DUCKDB_API Value GEOMETRY (const_data_ptr_t data, idx_t len)
 
static DUCKDB_API Value GEOMETRY (const_data_ptr_t data, idx_t len, const CoordinateReferenceSystem &crs)
 
static DUCKDB_API Value TYPE (const LogicalType &type)
 
static DUCKDB_API Value TYPE (const string_t &serialized_type)
 
static DUCKDB_API Value AGGREGATE_STATE (const LogicalType &type, const_data_ptr_t data, idx_t len)
 Creates an aggregate state.
 
template<class T >
static Value CreateValue (T value)
 
static DUCKDB_API Value Deserialize (Deserializer &deserializer)
 Deserializes a Value from a blob.
 
static DUCKDB_API bool FloatIsFinite (float value)
 
static DUCKDB_API bool DoubleIsFinite (double value)
 
template<class T >
static bool IsNan (T value)
 
template<class T >
static bool IsFinite (T value)
 
static DUCKDB_API bool StringIsValid (const char *str, idx_t length)
 
static bool StringIsValid (const string &str)
 
static DUCKDB_API bool ValuesAreEqual (CastFunctionSet &set, GetCastFunctionInput &get_input, const Value &result_value, const Value &value)
 
static DUCKDB_API bool ValuesAreEqual (ClientContext &context, const Value &result_value, const Value &value)
 
static DUCKDB_API bool DefaultValuesAreEqual (const Value &result_value, const Value &value)
 
static DUCKDB_API bool NotDistinctFrom (const Value &lvalue, const Value &rvalue)
 Returns true if the values are not distinct from each other, following SQL semantics for NOT DISTINCT FROM.
 

Private Member Functions

void SerializeInternal (Serializer &serializer, bool serialize_type) const
 
template<class T >
GetValueInternal () const
 

Static Private Member Functions

static void SerializeChildren (Serializer &serializer, const vector< Value > &children, const LogicalType &parent_type)
 

Private Attributes

LogicalType type_
 The logical of the value.
 
bool is_null
 Whether or not the value is NULL.
 
union duckdb::Value::Val value_
 
shared_ptr< ExtraValueInfovalue_info_
 

Friends

struct StringValue
 
struct StructValue
 
struct ListValue
 
struct UnionValue
 
struct ArrayValue
 
struct MapValue
 
struct TypeValue
 
std::ostream & operator<< (std::ostream &out, const Value &val)
 

Detailed Description

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

Member Function Documentation

◆ GetTypeMutable()

LogicalType & duckdb::Value::GetTypeMutable ( )
inline
5691 {
5692 return type_;
5693 }
LogicalType type_
The logical of the value.
Definition duckdb.hpp:5934

◆ type()

const LogicalType & duckdb::Value::type ( ) const
inline
5694 { // NOLINT
5695 return type_;
5696 }
Here is the caller graph for this function:

◆ IsNull()

bool duckdb::Value::IsNull ( ) const
inline
5697 {
5698 return is_null;
5699 }
bool is_null
Whether or not the value is NULL.
Definition duckdb.hpp:5937

◆ LIST()

static DUCKDB_API Value duckdb::Value::LIST ( vector< Value values)
static

Create a list value with the given entries The type of the first value determines the list type. The list cannot be empty.

◆ BLOB_RAW()

static Value duckdb::Value::BLOB_RAW ( const string &  data)
inlinestatic
5809 { // NOLINT
5810 return Value::BLOB(const_data_ptr_cast(data.c_str()), data.size());
5811 }
static DUCKDB_API Value BLOB(const_data_ptr_t data, idx_t len)
Create a blob Value from a data pointer and a length: no bytes are interpreted.

◆ CreateValue()

template<class T >
static Value duckdb::Value::CreateValue ( value)
inlinestatic
5832 {
5833 static_assert(AlwaysFalse<T>::VALUE, "No specialization exists for this type");
5834 return Value(nullptr);
5835 }
DUCKDB_API Value(LogicalType type=LogicalType::SQLNULL)
Create an empty NULL value of the specified type.

◆ Copy()

Value duckdb::Value::Copy ( ) const
inline

Return a copy of this value.

5842 {
5843 return Value(*this);
5844 }

◆ IsNan()

template<class T >
static bool duckdb::Value::IsNan ( value)
inlinestatic
5900 {
5901 throw InternalException("Unimplemented template type for Value::IsNan");
5902 }

◆ IsFinite()

template<class T >
static bool duckdb::Value::IsFinite ( value)
inlinestatic
5904 {
5905 return true;
5906 }

◆ StringIsValid()

static bool duckdb::Value::StringIsValid ( const string &  str)
inlinestatic
5908 {
5909 return StringIsValid(str.c_str(), str.size());
5910 }

◆ ValuesAreEqual()

static DUCKDB_API bool duckdb::Value::ValuesAreEqual ( CastFunctionSet set,
GetCastFunctionInput get_input,
const Value result_value,
const Value value 
)
static

Returns true if the values are (approximately) equivalent. Note this is NOT the SQL equivalence. For this function, NULL values are equivalent and floating point values that are close are equivalent.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  out,
const Value val 
)
friend
5921 {
5922 out << val.ToString();
5923 return out;
5924 }

The documentation for this class was generated from the following file: