duckdb 0.3.5-dev116.0 → 0.3.5-dev154.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/duckdb.hpp CHANGED
@@ -11,8 +11,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
11
11
  #pragma once
12
12
  #define DUCKDB_AMALGAMATION 1
13
13
  #define DUCKDB_AMALGAMATION_EXTENDED 1
14
- #define DUCKDB_SOURCE_ID "4523b1e22"
15
- #define DUCKDB_VERSION "v0.3.5-dev116"
14
+ #define DUCKDB_SOURCE_ID "0d3368c18"
15
+ #define DUCKDB_VERSION "v0.3.5-dev154"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //
@@ -3094,6 +3094,8 @@ template <>
3094
3094
  DUCKDB_API timestamp_t Value::GetValue() const;
3095
3095
  template <>
3096
3096
  DUCKDB_API interval_t Value::GetValue() const;
3097
+ template <>
3098
+ DUCKDB_API Value Value::GetValue() const;
3097
3099
 
3098
3100
  template <>
3099
3101
  DUCKDB_API bool Value::GetValueUnsafe() const;
@@ -6137,7 +6139,7 @@ public:
6137
6139
  static bool RequiresQuotes(const string &text);
6138
6140
 
6139
6141
  //! Writes a string that is optionally quoted + escaped so it can be used as an identifier
6140
- static string WriteOptionallyQuoted(const string &text);
6142
+ static string WriteOptionallyQuoted(const string &text, char quote = '"');
6141
6143
  };
6142
6144
 
6143
6145
  } // namespace duckdb
@@ -13781,6 +13783,7 @@ public:
13781
13783
 
13782
13784
 
13783
13785
  namespace duckdb {
13786
+
13784
13787
  //! SQLStatement is the base class of any type of SQL statement.
13785
13788
  class SQLStatement {
13786
13789
  public:
@@ -13803,6 +13806,9 @@ protected:
13803
13806
  SQLStatement(const SQLStatement &other) = default;
13804
13807
 
13805
13808
  public:
13809
+ virtual string ToString() const {
13810
+ throw InternalException("ToString not supported for this type of SQLStatement");
13811
+ }
13806
13812
  //! Create a copy of this SelectStatement
13807
13813
  virtual unique_ptr<SQLStatement> Copy() const = 0;
13808
13814
  };
@@ -13907,7 +13913,9 @@ public:
13907
13913
 
13908
13914
  public:
13909
13915
  //! Convert the object to a string
13910
- virtual string ToString() const;
13916
+ virtual string ToString() const = 0;
13917
+ string BaseToString(string result) const;
13918
+ string BaseToString(string result, const vector<string> &column_name_alias) const;
13911
13919
  void Print();
13912
13920
 
13913
13921
  virtual bool Equals(const TableRef *other) const;
@@ -13944,6 +13952,8 @@ protected:
13944
13952
  SelectStatement(const SelectStatement &other);
13945
13953
 
13946
13954
  public:
13955
+ //! Convert the SELECT statement to a string
13956
+ string ToString() const override;
13947
13957
  //! Create a copy of this SelectStatement
13948
13958
  unique_ptr<SQLStatement> Copy() const override;
13949
13959
  //! Serializes a SelectStatement to a stand-alone binary blob
@@ -13995,6 +14005,9 @@ public:
13995
14005
  virtual const vector<unique_ptr<ParsedExpression>> &GetSelectList() const = 0;
13996
14006
 
13997
14007
  public:
14008
+ //! Convert the query node to a string
14009
+ virtual string ToString() const = 0;
14010
+
13998
14011
  virtual bool Equals(const QueryNode *other) const;
13999
14012
 
14000
14013
  //! Create a copy of this QueryNode
@@ -14006,6 +14019,9 @@ public:
14006
14019
  //! Deserializes a blob back into a QueryNode
14007
14020
  DUCKDB_API static unique_ptr<QueryNode> Deserialize(Deserializer &source);
14008
14021
 
14022
+ string CTEToString() const;
14023
+ string ResultModifiersToString() const;
14024
+
14009
14025
  protected:
14010
14026
  //! Copy base QueryNode properties from another expression to this one,
14011
14027
  //! used in Copy method
@@ -22714,11 +22730,11 @@ public:
22714
22730
  public:
22715
22731
  template <class T, class BASE>
22716
22732
  static string ToString(const T &entry) {
22717
- string result = entry.children[0]->ToString();
22733
+ string result = "(" + entry.children[0]->ToString();
22718
22734
  for (idx_t i = 1; i < entry.children.size(); i++) {
22719
22735
  result += " " + ExpressionTypeToOperator(entry.type) + " " + entry.children[i]->ToString();
22720
22736
  }
22721
- return result;
22737
+ return result + ")";
22722
22738
  }
22723
22739
  };
22724
22740
  } // namespace duckdb
@@ -22854,7 +22870,7 @@ public:
22854
22870
  template <class T, class BASE>
22855
22871
  static string ToString(const T &entry, const string &schema, const string &function_name, bool is_operator = false,
22856
22872
  bool distinct = false, BASE *filter = nullptr, OrderModifier *order_bys = nullptr,
22857
- bool export_state = false) {
22873
+ bool export_state = false, bool add_alias = false) {
22858
22874
  if (is_operator) {
22859
22875
  // built-in operator
22860
22876
  D_ASSERT(!distinct);
@@ -22876,8 +22892,11 @@ public:
22876
22892
  if (distinct) {
22877
22893
  result += "DISTINCT ";
22878
22894
  }
22879
- result += StringUtil::Join(entry.children, entry.children.size(), ", ",
22880
- [](const unique_ptr<BASE> &child) { return child->ToString(); });
22895
+ result += StringUtil::Join(entry.children, entry.children.size(), ", ", [&](const unique_ptr<BASE> &child) {
22896
+ return child->alias.empty() || !add_alias
22897
+ ? child->ToString()
22898
+ : KeywordHelper::WriteOptionallyQuoted(child->alias) + " := " + child->ToString();
22899
+ });
22881
22900
  // ordered aggregate
22882
22901
  if (order_bys && !order_bys->orders.empty()) {
22883
22902
  if (entry.children.empty()) {
@@ -22995,10 +23014,10 @@ public:
22995
23014
  KeywordHelper::WriteOptionallyQuoted(child_string.substr(1, child_string.size() - 2));
22996
23015
  }
22997
23016
  case ExpressionType::ARRAY_CONSTRUCTOR: {
22998
- string result = "ARRAY[";
23017
+ string result = "(ARRAY[";
22999
23018
  result += StringUtil::Join(entry.children, entry.children.size(), ", ",
23000
23019
  [](const unique_ptr<BASE> &child) { return child->ToString(); });
23001
- result += "]";
23020
+ result += "])";
23002
23021
  return result;
23003
23022
  }
23004
23023
  default:
@@ -23794,6 +23813,7 @@ public:
23794
23813
  vector<string> expected_names;
23795
23814
 
23796
23815
  public:
23816
+ string ToString() const override;
23797
23817
  bool Equals(const TableRef *other_p) const override;
23798
23818
 
23799
23819
  unique_ptr<TableRef> Copy() override;
@@ -23830,6 +23850,7 @@ public:
23830
23850
  unique_ptr<TableRef> right;
23831
23851
 
23832
23852
  public:
23853
+ string ToString() const override;
23833
23854
  bool Equals(const TableRef *other_p) const override;
23834
23855
 
23835
23856
  unique_ptr<TableRef> Copy() override;
@@ -23861,6 +23882,7 @@ public:
23861
23882
  }
23862
23883
 
23863
23884
  public:
23885
+ string ToString() const override;
23864
23886
  bool Equals(const TableRef *other_p) const override;
23865
23887
 
23866
23888
  unique_ptr<TableRef> Copy() override;
@@ -23910,6 +23932,7 @@ public:
23910
23932
  vector<string> using_columns;
23911
23933
 
23912
23934
  public:
23935
+ string ToString() const override;
23913
23936
  bool Equals(const TableRef *other_p) const override;
23914
23937
 
23915
23938
  unique_ptr<TableRef> Copy() override;
@@ -23946,6 +23969,7 @@ public:
23946
23969
  vector<string> column_name_alias;
23947
23970
 
23948
23971
  public:
23972
+ string ToString() const override;
23949
23973
  bool Equals(const TableRef *other_p) const override;
23950
23974
 
23951
23975
  unique_ptr<TableRef> Copy() override;