duckdb 0.3.3-dev1443.0 → 0.3.3-dev1504.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 "5b03e0413"
15
- #define DUCKDB_VERSION "v0.3.3-dev1443"
14
+ #define DUCKDB_SOURCE_ID "31db2bada"
15
+ #define DUCKDB_VERSION "v0.3.3-dev1504"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //
@@ -22324,7 +22324,7 @@ private:
22324
22324
  //===----------------------------------------------------------------------===//
22325
22325
  // DuckDB
22326
22326
  //
22327
- // duckdb/parser/expression/positional_reference_expression.hpp
22327
+ // duckdb/parser/expression/lambda_expression.hpp
22328
22328
  //
22329
22329
  //
22330
22330
  //===----------------------------------------------------------------------===//
@@ -22333,32 +22333,37 @@ private:
22333
22333
 
22334
22334
 
22335
22335
 
22336
+
22336
22337
  namespace duckdb {
22337
- class PositionalReferenceExpression : public ParsedExpression {
22338
+
22339
+ //! LambdaExpression represents either:
22340
+ //! 1. A lambda operator that can be used for e.g. mapping an expression to a list
22341
+ //! 2. An OperatorExpression with the "->" operator
22342
+ //! Lambda expressions are written in the form of "capture -> expr", e.g. "x -> x + 1"
22343
+ class LambdaExpression : public ParsedExpression {
22338
22344
  public:
22339
- DUCKDB_API PositionalReferenceExpression(idx_t index);
22345
+ LambdaExpression(unique_ptr<ParsedExpression> lhs, unique_ptr<ParsedExpression> rhs);
22340
22346
 
22341
- idx_t index;
22347
+ unique_ptr<ParsedExpression> lhs;
22348
+ unique_ptr<ParsedExpression> rhs;
22342
22349
 
22343
22350
  public:
22344
- bool IsScalar() const override {
22345
- return false;
22346
- }
22347
-
22348
22351
  string ToString() const override;
22349
22352
 
22350
- static bool Equals(const PositionalReferenceExpression *a, const PositionalReferenceExpression *b);
22351
- unique_ptr<ParsedExpression> Copy() const override;
22353
+ static bool Equals(const LambdaExpression *a, const LambdaExpression *b);
22352
22354
  hash_t Hash() const override;
22353
22355
 
22356
+ unique_ptr<ParsedExpression> Copy() const override;
22357
+
22354
22358
  void Serialize(FieldWriter &writer) const override;
22355
22359
  static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
22356
22360
  };
22361
+
22357
22362
  } // namespace duckdb
22358
22363
  //===----------------------------------------------------------------------===//
22359
22364
  // DuckDB
22360
22365
  //
22361
- // duckdb/parser/expression/conjunction_expression.hpp
22366
+ // duckdb/parser/expression/collate_expression.hpp
22362
22367
  //
22363
22368
  //
22364
22369
  //===----------------------------------------------------------------------===//
@@ -22367,46 +22372,33 @@ public:
22367
22372
 
22368
22373
 
22369
22374
 
22370
-
22371
22375
  namespace duckdb {
22372
22376
 
22373
- //! Represents a conjunction (AND/OR)
22374
- class ConjunctionExpression : public ParsedExpression {
22377
+ //! CollateExpression represents a COLLATE statement
22378
+ class CollateExpression : public ParsedExpression {
22375
22379
  public:
22376
- DUCKDB_API explicit ConjunctionExpression(ExpressionType type);
22377
- DUCKDB_API ConjunctionExpression(ExpressionType type, vector<unique_ptr<ParsedExpression>> children);
22378
- DUCKDB_API ConjunctionExpression(ExpressionType type, unique_ptr<ParsedExpression> left,
22379
- unique_ptr<ParsedExpression> right);
22380
+ CollateExpression(string collation, unique_ptr<ParsedExpression> child);
22380
22381
 
22381
- vector<unique_ptr<ParsedExpression>> children;
22382
+ //! The child of the cast expression
22383
+ unique_ptr<ParsedExpression> child;
22384
+ //! The collation clause
22385
+ string collation;
22382
22386
 
22383
22387
  public:
22384
- void AddExpression(unique_ptr<ParsedExpression> expr);
22385
-
22386
22388
  string ToString() const override;
22387
22389
 
22388
- static bool Equals(const ConjunctionExpression *a, const ConjunctionExpression *b);
22390
+ static bool Equals(const CollateExpression *a, const CollateExpression *b);
22389
22391
 
22390
22392
  unique_ptr<ParsedExpression> Copy() const override;
22391
22393
 
22392
22394
  void Serialize(FieldWriter &writer) const override;
22393
22395
  static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
22394
-
22395
- public:
22396
- template <class T, class BASE>
22397
- static string ToString(const T &entry) {
22398
- string result = entry.children[0]->ToString();
22399
- for (idx_t i = 1; i < entry.children.size(); i++) {
22400
- result += " " + ExpressionTypeToOperator(entry.type) + " " + entry.children[i]->ToString();
22401
- }
22402
- return result;
22403
- }
22404
22396
  };
22405
22397
  } // namespace duckdb
22406
22398
  //===----------------------------------------------------------------------===//
22407
22399
  // DuckDB
22408
22400
  //
22409
- // duckdb/parser/expression/parameter_expression.hpp
22401
+ // duckdb/parser/expression/between_expression.hpp
22410
22402
  //
22411
22403
  //
22412
22404
  //===----------------------------------------------------------------------===//
@@ -22416,33 +22408,39 @@ public:
22416
22408
 
22417
22409
 
22418
22410
  namespace duckdb {
22419
- class ParameterExpression : public ParsedExpression {
22411
+
22412
+ class BetweenExpression : public ParsedExpression {
22420
22413
  public:
22421
- ParameterExpression();
22414
+ BetweenExpression(unique_ptr<ParsedExpression> input, unique_ptr<ParsedExpression> lower,
22415
+ unique_ptr<ParsedExpression> upper);
22422
22416
 
22423
- idx_t parameter_nr;
22417
+ unique_ptr<ParsedExpression> input;
22418
+ unique_ptr<ParsedExpression> lower;
22419
+ unique_ptr<ParsedExpression> upper;
22424
22420
 
22425
22421
  public:
22426
- bool IsScalar() const override {
22427
- return true;
22428
- }
22429
- bool HasParameter() const override {
22430
- return true;
22431
- }
22432
-
22433
22422
  string ToString() const override;
22434
22423
 
22424
+ static bool Equals(const BetweenExpression *a, const BetweenExpression *b);
22425
+
22435
22426
  unique_ptr<ParsedExpression> Copy() const override;
22436
- hash_t Hash() const override;
22437
22427
 
22438
22428
  void Serialize(FieldWriter &writer) const override;
22439
22429
  static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
22430
+
22431
+ public:
22432
+ template <class T, class BASE>
22433
+ static string ToString(const T &entry) {
22434
+ return entry.input->ToString() + " BETWEEN " + entry.lower->ToString() + " AND " + entry.upper->ToString();
22435
+ }
22440
22436
  };
22441
22437
  } // namespace duckdb
22438
+
22439
+
22442
22440
  //===----------------------------------------------------------------------===//
22443
22441
  // DuckDB
22444
22442
  //
22445
- // duckdb/parser/expression/cast_expression.hpp
22443
+ // duckdb/parser/expression/case_expression.hpp
22446
22444
  //
22447
22445
  //
22448
22446
  //===----------------------------------------------------------------------===//
@@ -22454,22 +22452,23 @@ public:
22454
22452
 
22455
22453
  namespace duckdb {
22456
22454
 
22457
- //! CastExpression represents a type cast from one SQL type to another SQL type
22458
- class CastExpression : public ParsedExpression {
22455
+ struct CaseCheck {
22456
+ unique_ptr<ParsedExpression> when_expr;
22457
+ unique_ptr<ParsedExpression> then_expr;
22458
+ };
22459
+
22460
+ //! The CaseExpression represents a CASE expression in the query
22461
+ class CaseExpression : public ParsedExpression {
22459
22462
  public:
22460
- DUCKDB_API CastExpression(LogicalType target, unique_ptr<ParsedExpression> child, bool try_cast = false);
22463
+ DUCKDB_API CaseExpression();
22461
22464
 
22462
- //! The child of the cast expression
22463
- unique_ptr<ParsedExpression> child;
22464
- //! The type to cast to
22465
- LogicalType cast_type;
22466
- //! Whether or not this is a try_cast expression
22467
- bool try_cast;
22465
+ vector<CaseCheck> case_checks;
22466
+ unique_ptr<ParsedExpression> else_expr;
22468
22467
 
22469
22468
  public:
22470
22469
  string ToString() const override;
22471
22470
 
22472
- static bool Equals(const CastExpression *a, const CastExpression *b);
22471
+ static bool Equals(const CaseExpression *a, const CaseExpression *b);
22473
22472
 
22474
22473
  unique_ptr<ParsedExpression> Copy() const override;
22475
22474
 
@@ -22479,15 +22478,22 @@ public:
22479
22478
  public:
22480
22479
  template <class T, class BASE>
22481
22480
  static string ToString(const T &entry) {
22482
- return (entry.try_cast ? "TRY_CAST(" : "CAST(") + entry.child->ToString() + " AS " +
22483
- entry.cast_type.ToString() + ")";
22481
+ string case_str = "CASE ";
22482
+ for (auto &check : entry.case_checks) {
22483
+ case_str += " WHEN (" + check.when_expr->ToString() + ")";
22484
+ case_str += " THEN (" + check.then_expr->ToString() + ")";
22485
+ }
22486
+ case_str += " ELSE " + entry.else_expr->ToString();
22487
+ case_str += " END";
22488
+ return case_str;
22484
22489
  }
22485
22490
  };
22486
22491
  } // namespace duckdb
22492
+
22487
22493
  //===----------------------------------------------------------------------===//
22488
22494
  // DuckDB
22489
22495
  //
22490
- // duckdb/parser/expression/between_expression.hpp
22496
+ // duckdb/parser/expression/cast_expression.hpp
22491
22497
  //
22492
22498
  //
22493
22499
  //===----------------------------------------------------------------------===//
@@ -22496,21 +22502,25 @@ public:
22496
22502
 
22497
22503
 
22498
22504
 
22505
+
22499
22506
  namespace duckdb {
22500
22507
 
22501
- class BetweenExpression : public ParsedExpression {
22508
+ //! CastExpression represents a type cast from one SQL type to another SQL type
22509
+ class CastExpression : public ParsedExpression {
22502
22510
  public:
22503
- BetweenExpression(unique_ptr<ParsedExpression> input, unique_ptr<ParsedExpression> lower,
22504
- unique_ptr<ParsedExpression> upper);
22511
+ DUCKDB_API CastExpression(LogicalType target, unique_ptr<ParsedExpression> child, bool try_cast = false);
22505
22512
 
22506
- unique_ptr<ParsedExpression> input;
22507
- unique_ptr<ParsedExpression> lower;
22508
- unique_ptr<ParsedExpression> upper;
22513
+ //! The child of the cast expression
22514
+ unique_ptr<ParsedExpression> child;
22515
+ //! The type to cast to
22516
+ LogicalType cast_type;
22517
+ //! Whether or not this is a try_cast expression
22518
+ bool try_cast;
22509
22519
 
22510
22520
  public:
22511
22521
  string ToString() const override;
22512
22522
 
22513
- static bool Equals(const BetweenExpression *a, const BetweenExpression *b);
22523
+ static bool Equals(const CastExpression *a, const CastExpression *b);
22514
22524
 
22515
22525
  unique_ptr<ParsedExpression> Copy() const override;
22516
22526
 
@@ -22520,10 +22530,14 @@ public:
22520
22530
  public:
22521
22531
  template <class T, class BASE>
22522
22532
  static string ToString(const T &entry) {
22523
- return entry.input->ToString() + " BETWEEN " + entry.lower->ToString() + " AND " + entry.upper->ToString();
22533
+ return (entry.try_cast ? "TRY_CAST(" : "CAST(") + entry.child->ToString() + " AS " +
22534
+ entry.cast_type.ToString() + ")";
22524
22535
  }
22525
22536
  };
22526
22537
  } // namespace duckdb
22538
+
22539
+
22540
+
22527
22541
  //===----------------------------------------------------------------------===//
22528
22542
  // DuckDB
22529
22543
  //
@@ -22564,10 +22578,11 @@ public:
22564
22578
  }
22565
22579
  };
22566
22580
  } // namespace duckdb
22581
+
22567
22582
  //===----------------------------------------------------------------------===//
22568
22583
  // DuckDB
22569
22584
  //
22570
- // duckdb/parser/expression/constant_expression.hpp
22585
+ // duckdb/parser/expression/conjunction_expression.hpp
22571
22586
  //
22572
22587
  //
22573
22588
  //===----------------------------------------------------------------------===//
@@ -22579,31 +22594,44 @@ public:
22579
22594
 
22580
22595
  namespace duckdb {
22581
22596
 
22582
- //! ConstantExpression represents a constant value in the query
22583
- class ConstantExpression : public ParsedExpression {
22597
+ //! Represents a conjunction (AND/OR)
22598
+ class ConjunctionExpression : public ParsedExpression {
22584
22599
  public:
22585
- DUCKDB_API explicit ConstantExpression(Value val);
22600
+ DUCKDB_API explicit ConjunctionExpression(ExpressionType type);
22601
+ DUCKDB_API ConjunctionExpression(ExpressionType type, vector<unique_ptr<ParsedExpression>> children);
22602
+ DUCKDB_API ConjunctionExpression(ExpressionType type, unique_ptr<ParsedExpression> left,
22603
+ unique_ptr<ParsedExpression> right);
22586
22604
 
22587
- //! The constant value referenced
22588
- Value value;
22605
+ vector<unique_ptr<ParsedExpression>> children;
22589
22606
 
22590
22607
  public:
22608
+ void AddExpression(unique_ptr<ParsedExpression> expr);
22609
+
22591
22610
  string ToString() const override;
22592
22611
 
22593
- static bool Equals(const ConstantExpression *a, const ConstantExpression *b);
22594
- hash_t Hash() const override;
22612
+ static bool Equals(const ConjunctionExpression *a, const ConjunctionExpression *b);
22595
22613
 
22596
22614
  unique_ptr<ParsedExpression> Copy() const override;
22597
22615
 
22598
22616
  void Serialize(FieldWriter &writer) const override;
22599
22617
  static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
22600
- };
22601
22618
 
22619
+ public:
22620
+ template <class T, class BASE>
22621
+ static string ToString(const T &entry) {
22622
+ string result = entry.children[0]->ToString();
22623
+ for (idx_t i = 1; i < entry.children.size(); i++) {
22624
+ result += " " + ExpressionTypeToOperator(entry.type) + " " + entry.children[i]->ToString();
22625
+ }
22626
+ return result;
22627
+ }
22628
+ };
22602
22629
  } // namespace duckdb
22630
+
22603
22631
  //===----------------------------------------------------------------------===//
22604
22632
  // DuckDB
22605
22633
  //
22606
- // duckdb/parser/expression/collate_expression.hpp
22634
+ // duckdb/parser/expression/constant_expression.hpp
22607
22635
  //
22608
22636
  //
22609
22637
  //===----------------------------------------------------------------------===//
@@ -22612,33 +22640,35 @@ public:
22612
22640
 
22613
22641
 
22614
22642
 
22643
+
22615
22644
  namespace duckdb {
22616
22645
 
22617
- //! CollateExpression represents a COLLATE statement
22618
- class CollateExpression : public ParsedExpression {
22646
+ //! ConstantExpression represents a constant value in the query
22647
+ class ConstantExpression : public ParsedExpression {
22619
22648
  public:
22620
- CollateExpression(string collation, unique_ptr<ParsedExpression> child);
22649
+ DUCKDB_API explicit ConstantExpression(Value val);
22621
22650
 
22622
- //! The child of the cast expression
22623
- unique_ptr<ParsedExpression> child;
22624
- //! The collation clause
22625
- string collation;
22651
+ //! The constant value referenced
22652
+ Value value;
22626
22653
 
22627
22654
  public:
22628
22655
  string ToString() const override;
22629
22656
 
22630
- static bool Equals(const CollateExpression *a, const CollateExpression *b);
22657
+ static bool Equals(const ConstantExpression *a, const ConstantExpression *b);
22658
+ hash_t Hash() const override;
22631
22659
 
22632
22660
  unique_ptr<ParsedExpression> Copy() const override;
22633
22661
 
22634
22662
  void Serialize(FieldWriter &writer) const override;
22635
22663
  static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
22636
22664
  };
22665
+
22637
22666
  } // namespace duckdb
22667
+
22638
22668
  //===----------------------------------------------------------------------===//
22639
22669
  // DuckDB
22640
22670
  //
22641
- // duckdb/parser/expression/star_expression.hpp
22671
+ // duckdb/parser/expression/default_expression.hpp
22642
22672
  //
22643
22673
  //
22644
22674
  //===----------------------------------------------------------------------===//
@@ -22647,25 +22677,18 @@ public:
22647
22677
 
22648
22678
 
22649
22679
 
22650
-
22651
22680
  namespace duckdb {
22652
-
22653
- //! Represents a * expression in the SELECT clause
22654
- class StarExpression : public ParsedExpression {
22681
+ //! Represents the default value of a column
22682
+ class DefaultExpression : public ParsedExpression {
22655
22683
  public:
22656
- StarExpression(string relation_name = string());
22657
-
22658
- //! The relation name in case of tbl.*, or empty if this is a normal *
22659
- string relation_name;
22660
- //! List of columns to exclude from the STAR expression
22661
- case_insensitive_set_t exclude_list;
22662
- //! List of columns to replace with another expression
22663
- case_insensitive_map_t<unique_ptr<ParsedExpression>> replace_list;
22684
+ DefaultExpression();
22664
22685
 
22665
22686
  public:
22666
- string ToString() const override;
22687
+ bool IsScalar() const override {
22688
+ return false;
22689
+ }
22667
22690
 
22668
- static bool Equals(const StarExpression *a, const StarExpression *b);
22691
+ string ToString() const override;
22669
22692
 
22670
22693
  unique_ptr<ParsedExpression> Copy() const override;
22671
22694
 
@@ -22673,10 +22696,11 @@ public:
22673
22696
  static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
22674
22697
  };
22675
22698
  } // namespace duckdb
22699
+
22676
22700
  //===----------------------------------------------------------------------===//
22677
22701
  // DuckDB
22678
22702
  //
22679
- // duckdb/parser/expression/lambda_expression.hpp
22703
+ // duckdb/parser/expression/function_expression.hpp
22680
22704
  //
22681
22705
  //
22682
22706
  //===----------------------------------------------------------------------===//
@@ -22686,201 +22710,20 @@ public:
22686
22710
 
22687
22711
 
22688
22712
 
22689
- namespace duckdb {
22690
-
22691
- //! LambdaExpression represents either:
22692
- //! 1. A lambda operator that can be used for e.g. mapping an expression to a list
22693
- //! 2. An OperatorExpression with the "->" operator
22694
- //! Lambda expressions are written in the form of "capture -> expr", e.g. "x -> x + 1"
22695
- class LambdaExpression : public ParsedExpression {
22696
- public:
22697
- LambdaExpression(unique_ptr<ParsedExpression> lhs, unique_ptr<ParsedExpression> rhs);
22698
-
22699
- unique_ptr<ParsedExpression> lhs;
22700
- unique_ptr<ParsedExpression> rhs;
22701
22713
 
22714
+ namespace duckdb {
22715
+ //! Represents a function call
22716
+ class FunctionExpression : public ParsedExpression {
22702
22717
  public:
22703
- string ToString() const override;
22704
-
22705
- static bool Equals(const LambdaExpression *a, const LambdaExpression *b);
22706
- hash_t Hash() const override;
22707
-
22708
- unique_ptr<ParsedExpression> Copy() const override;
22709
-
22710
- void Serialize(FieldWriter &writer) const override;
22711
- static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
22712
- };
22713
-
22714
- } // namespace duckdb
22715
- //===----------------------------------------------------------------------===//
22716
- // DuckDB
22717
- //
22718
- // duckdb/parser/expression/subquery_expression.hpp
22719
- //
22720
- //
22721
- //===----------------------------------------------------------------------===//
22722
-
22723
-
22724
-
22725
-
22726
-
22727
-
22728
-
22729
- namespace duckdb {
22730
-
22731
- //! Represents a subquery
22732
- class SubqueryExpression : public ParsedExpression {
22733
- public:
22734
- SubqueryExpression();
22735
-
22736
- //! The actual subquery
22737
- unique_ptr<SelectStatement> subquery;
22738
- //! The subquery type
22739
- SubqueryType subquery_type;
22740
- //! the child expression to compare with (in case of IN, ANY, ALL operators, empty for EXISTS queries and scalar
22741
- //! subquery)
22742
- unique_ptr<ParsedExpression> child;
22743
- //! The comparison type of the child expression with the subquery (in case of ANY, ALL operators), empty otherwise
22744
- ExpressionType comparison_type;
22745
-
22746
- public:
22747
- bool HasSubquery() const override {
22748
- return true;
22749
- }
22750
- bool IsScalar() const override {
22751
- return false;
22752
- }
22753
-
22754
- string ToString() const override;
22755
-
22756
- static bool Equals(const SubqueryExpression *a, const SubqueryExpression *b);
22757
-
22758
- unique_ptr<ParsedExpression> Copy() const override;
22759
-
22760
- void Serialize(FieldWriter &writer) const override;
22761
- static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
22762
- };
22763
- } // namespace duckdb
22764
-
22765
-
22766
- //===----------------------------------------------------------------------===//
22767
- // DuckDB
22768
- //
22769
- // duckdb/parser/expression/case_expression.hpp
22770
- //
22771
- //
22772
- //===----------------------------------------------------------------------===//
22773
-
22774
-
22775
-
22776
-
22777
-
22778
-
22779
- namespace duckdb {
22780
-
22781
- struct CaseCheck {
22782
- unique_ptr<ParsedExpression> when_expr;
22783
- unique_ptr<ParsedExpression> then_expr;
22784
- };
22785
-
22786
- //! The CaseExpression represents a CASE expression in the query
22787
- class CaseExpression : public ParsedExpression {
22788
- public:
22789
- DUCKDB_API CaseExpression();
22790
-
22791
- vector<CaseCheck> case_checks;
22792
- unique_ptr<ParsedExpression> else_expr;
22793
-
22794
- public:
22795
- string ToString() const override;
22796
-
22797
- static bool Equals(const CaseExpression *a, const CaseExpression *b);
22798
-
22799
- unique_ptr<ParsedExpression> Copy() const override;
22800
-
22801
- void Serialize(FieldWriter &writer) const override;
22802
- static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
22803
-
22804
- public:
22805
- template <class T, class BASE>
22806
- static string ToString(const T &entry) {
22807
- string case_str = "CASE ";
22808
- for (auto &check : entry.case_checks) {
22809
- case_str += " WHEN (" + check.when_expr->ToString() + ")";
22810
- case_str += " THEN (" + check.then_expr->ToString() + ")";
22811
- }
22812
- case_str += " ELSE " + entry.else_expr->ToString();
22813
- case_str += " END";
22814
- return case_str;
22815
- }
22816
- };
22817
- } // namespace duckdb
22818
-
22819
-
22820
-
22821
-
22822
-
22823
-
22824
-
22825
- //===----------------------------------------------------------------------===//
22826
- // DuckDB
22827
- //
22828
- // duckdb/parser/expression/default_expression.hpp
22829
- //
22830
- //
22831
- //===----------------------------------------------------------------------===//
22832
-
22833
-
22834
-
22835
-
22836
-
22837
- namespace duckdb {
22838
- //! Represents the default value of a column
22839
- class DefaultExpression : public ParsedExpression {
22840
- public:
22841
- DefaultExpression();
22842
-
22843
- public:
22844
- bool IsScalar() const override {
22845
- return false;
22846
- }
22847
-
22848
- string ToString() const override;
22849
-
22850
- unique_ptr<ParsedExpression> Copy() const override;
22851
-
22852
- void Serialize(FieldWriter &writer) const override;
22853
- static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
22854
- };
22855
- } // namespace duckdb
22856
-
22857
- //===----------------------------------------------------------------------===//
22858
- // DuckDB
22859
- //
22860
- // duckdb/parser/expression/function_expression.hpp
22861
- //
22862
- //
22863
- //===----------------------------------------------------------------------===//
22864
-
22865
-
22866
-
22867
-
22868
-
22869
-
22870
-
22871
- namespace duckdb {
22872
- //! Represents a function call
22873
- class FunctionExpression : public ParsedExpression {
22874
- public:
22875
- DUCKDB_API FunctionExpression(string schema_name, const string &function_name,
22876
- vector<unique_ptr<ParsedExpression>> children,
22877
- unique_ptr<ParsedExpression> filter = nullptr,
22878
- unique_ptr<OrderModifier> order_bys = nullptr, bool distinct = false,
22879
- bool is_operator = false, bool export_state = false);
22880
- DUCKDB_API FunctionExpression(const string &function_name, vector<unique_ptr<ParsedExpression>> children,
22881
- unique_ptr<ParsedExpression> filter = nullptr,
22882
- unique_ptr<OrderModifier> order_bys = nullptr, bool distinct = false,
22883
- bool is_operator = false, bool export_state = false);
22718
+ DUCKDB_API FunctionExpression(string schema_name, const string &function_name,
22719
+ vector<unique_ptr<ParsedExpression>> children,
22720
+ unique_ptr<ParsedExpression> filter = nullptr,
22721
+ unique_ptr<OrderModifier> order_bys = nullptr, bool distinct = false,
22722
+ bool is_operator = false, bool export_state = false);
22723
+ DUCKDB_API FunctionExpression(const string &function_name, vector<unique_ptr<ParsedExpression>> children,
22724
+ unique_ptr<ParsedExpression> filter = nullptr,
22725
+ unique_ptr<OrderModifier> order_bys = nullptr, bool distinct = false,
22726
+ bool is_operator = false, bool export_state = false);
22884
22727
 
22885
22728
  //! Schema of the function
22886
22729
  string schema;
@@ -23071,11 +22914,168 @@ public:
23071
22914
 
23072
22915
  } // namespace duckdb
23073
22916
 
22917
+ //===----------------------------------------------------------------------===//
22918
+ // DuckDB
22919
+ //
22920
+ // duckdb/parser/expression/parameter_expression.hpp
22921
+ //
22922
+ //
22923
+ //===----------------------------------------------------------------------===//
22924
+
22925
+
22926
+
22927
+
22928
+
22929
+ namespace duckdb {
22930
+ class ParameterExpression : public ParsedExpression {
22931
+ public:
22932
+ ParameterExpression();
22933
+
22934
+ idx_t parameter_nr;
22935
+
22936
+ public:
22937
+ bool IsScalar() const override {
22938
+ return true;
22939
+ }
22940
+ bool HasParameter() const override {
22941
+ return true;
22942
+ }
22943
+
22944
+ string ToString() const override;
22945
+
22946
+ unique_ptr<ParsedExpression> Copy() const override;
22947
+ hash_t Hash() const override;
22948
+
22949
+ void Serialize(FieldWriter &writer) const override;
22950
+ static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
22951
+ };
22952
+ } // namespace duckdb
22953
+
22954
+ //===----------------------------------------------------------------------===//
22955
+ // DuckDB
22956
+ //
22957
+ // duckdb/parser/expression/positional_reference_expression.hpp
22958
+ //
22959
+ //
22960
+ //===----------------------------------------------------------------------===//
22961
+
22962
+
22963
+
22964
+
22965
+
22966
+ namespace duckdb {
22967
+ class PositionalReferenceExpression : public ParsedExpression {
22968
+ public:
22969
+ DUCKDB_API PositionalReferenceExpression(idx_t index);
22970
+
22971
+ idx_t index;
22972
+
22973
+ public:
22974
+ bool IsScalar() const override {
22975
+ return false;
22976
+ }
22977
+
22978
+ string ToString() const override;
22979
+
22980
+ static bool Equals(const PositionalReferenceExpression *a, const PositionalReferenceExpression *b);
22981
+ unique_ptr<ParsedExpression> Copy() const override;
22982
+ hash_t Hash() const override;
22983
+
22984
+ void Serialize(FieldWriter &writer) const override;
22985
+ static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
22986
+ };
22987
+ } // namespace duckdb
22988
+
22989
+ //===----------------------------------------------------------------------===//
22990
+ // DuckDB
22991
+ //
22992
+ // duckdb/parser/expression/star_expression.hpp
22993
+ //
22994
+ //
22995
+ //===----------------------------------------------------------------------===//
22996
+
22997
+
22998
+
22999
+
23000
+
23001
+
23002
+ namespace duckdb {
23003
+
23004
+ //! Represents a * expression in the SELECT clause
23005
+ class StarExpression : public ParsedExpression {
23006
+ public:
23007
+ StarExpression(string relation_name = string());
23008
+
23009
+ //! The relation name in case of tbl.*, or empty if this is a normal *
23010
+ string relation_name;
23011
+ //! List of columns to exclude from the STAR expression
23012
+ case_insensitive_set_t exclude_list;
23013
+ //! List of columns to replace with another expression
23014
+ case_insensitive_map_t<unique_ptr<ParsedExpression>> replace_list;
23015
+
23016
+ public:
23017
+ string ToString() const override;
23018
+
23019
+ static bool Equals(const StarExpression *a, const StarExpression *b);
23020
+
23021
+ unique_ptr<ParsedExpression> Copy() const override;
23022
+
23023
+ void Serialize(FieldWriter &writer) const override;
23024
+ static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
23025
+ };
23026
+ } // namespace duckdb
23027
+
23028
+ //===----------------------------------------------------------------------===//
23029
+ // DuckDB
23030
+ //
23031
+ // duckdb/parser/expression/subquery_expression.hpp
23032
+ //
23033
+ //
23034
+ //===----------------------------------------------------------------------===//
23035
+
23074
23036
 
23075
23037
 
23076
23038
 
23077
23039
 
23078
23040
 
23041
+
23042
+ namespace duckdb {
23043
+
23044
+ //! Represents a subquery
23045
+ class SubqueryExpression : public ParsedExpression {
23046
+ public:
23047
+ SubqueryExpression();
23048
+
23049
+ //! The actual subquery
23050
+ unique_ptr<SelectStatement> subquery;
23051
+ //! The subquery type
23052
+ SubqueryType subquery_type;
23053
+ //! the child expression to compare with (in case of IN, ANY, ALL operators, empty for EXISTS queries and scalar
23054
+ //! subquery)
23055
+ unique_ptr<ParsedExpression> child;
23056
+ //! The comparison type of the child expression with the subquery (in case of ANY, ALL operators), empty otherwise
23057
+ ExpressionType comparison_type;
23058
+
23059
+ public:
23060
+ bool HasSubquery() const override {
23061
+ return true;
23062
+ }
23063
+ bool IsScalar() const override {
23064
+ return false;
23065
+ }
23066
+
23067
+ string ToString() const override;
23068
+
23069
+ static bool Equals(const SubqueryExpression *a, const SubqueryExpression *b);
23070
+
23071
+ unique_ptr<ParsedExpression> Copy() const override;
23072
+
23073
+ void Serialize(FieldWriter &writer) const override;
23074
+ static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
23075
+ };
23076
+ } // namespace duckdb
23077
+
23078
+
23079
23079
  //===----------------------------------------------------------------------===//
23080
23080
  // DuckDB
23081
23081
  //
@@ -23121,7 +23121,7 @@ public:
23121
23121
  //===----------------------------------------------------------------------===//
23122
23122
  // DuckDB
23123
23123
  //
23124
- // duckdb/parser/parsed_data/vacuum_info.hpp
23124
+ // duckdb/parser/parsed_data/create_schema_info.hpp
23125
23125
  //
23126
23126
  //
23127
23127
  //===----------------------------------------------------------------------===//
@@ -23132,21 +23132,73 @@ public:
23132
23132
 
23133
23133
  namespace duckdb {
23134
23134
 
23135
- enum class LoadType { LOAD, INSTALL, FORCE_INSTALL };
23136
-
23137
- struct LoadInfo : public ParseInfo {
23138
- std::string filename;
23139
- LoadType load_type;
23135
+ struct CreateSchemaInfo : public CreateInfo {
23136
+ CreateSchemaInfo() : CreateInfo(CatalogType::SCHEMA_ENTRY) {
23137
+ }
23140
23138
 
23141
23139
  public:
23142
- unique_ptr<LoadInfo> Copy() const {
23143
- auto result = make_unique<LoadInfo>();
23144
- result->filename = filename;
23145
- result->load_type = load_type;
23140
+ unique_ptr<CreateInfo> Copy() const override {
23141
+ auto result = make_unique<CreateSchemaInfo>();
23142
+ CopyProperties(*result);
23143
+ return move(result);
23144
+ }
23145
+ };
23146
+
23147
+ } // namespace duckdb
23148
+ //===----------------------------------------------------------------------===//
23149
+ // DuckDB
23150
+ //
23151
+ // duckdb/parser/parsed_data/show_select_info.hpp
23152
+ //
23153
+ //
23154
+ //===----------------------------------------------------------------------===//
23155
+
23156
+
23157
+
23158
+
23159
+
23160
+
23161
+ namespace duckdb {
23162
+
23163
+ struct ShowSelectInfo : public ParseInfo {
23164
+ //! Types of projected columns
23165
+ vector<LogicalType> types;
23166
+ //! The QueryNode of select query
23167
+ unique_ptr<QueryNode> query;
23168
+ //! Aliases of projected columns
23169
+ vector<string> aliases;
23170
+ //! Whether or not we are requesting a summary or a describe
23171
+ bool is_summary;
23172
+
23173
+ unique_ptr<ShowSelectInfo> Copy() {
23174
+ auto result = make_unique<ShowSelectInfo>();
23175
+ result->types = types;
23176
+ result->query = query->Copy();
23177
+ result->aliases = aliases;
23178
+ result->is_summary = is_summary;
23146
23179
  return result;
23147
23180
  }
23148
23181
  };
23149
23182
 
23183
+ } // namespace duckdb
23184
+ //===----------------------------------------------------------------------===//
23185
+ // DuckDB
23186
+ //
23187
+ // duckdb/parser/parsed_data/vacuum_info.hpp
23188
+ //
23189
+ //
23190
+ //===----------------------------------------------------------------------===//
23191
+
23192
+
23193
+
23194
+
23195
+
23196
+ namespace duckdb {
23197
+
23198
+ struct VacuumInfo : public ParseInfo {
23199
+ // nothing for now
23200
+ };
23201
+
23150
23202
  } // namespace duckdb
23151
23203
  //===----------------------------------------------------------------------===//
23152
23204
  // DuckDB
@@ -23239,7 +23291,7 @@ public:
23239
23291
  //===----------------------------------------------------------------------===//
23240
23292
  // DuckDB
23241
23293
  //
23242
- // duckdb/parser/parsed_data/create_pragma_function_info.hpp
23294
+ // duckdb/parser/parsed_data/transaction_info.hpp
23243
23295
  //
23244
23296
  //
23245
23297
  //===----------------------------------------------------------------------===//
@@ -23248,38 +23300,23 @@ public:
23248
23300
 
23249
23301
 
23250
23302
 
23251
-
23252
23303
  namespace duckdb {
23253
23304
 
23254
- struct CreatePragmaFunctionInfo : public CreateFunctionInfo {
23255
- explicit CreatePragmaFunctionInfo(PragmaFunction function)
23256
- : CreateFunctionInfo(CatalogType::PRAGMA_FUNCTION_ENTRY) {
23257
- functions.push_back(move(function));
23258
- this->name = function.name;
23259
- }
23260
- CreatePragmaFunctionInfo(string name, vector<PragmaFunction> functions_)
23261
- : CreateFunctionInfo(CatalogType::PRAGMA_FUNCTION_ENTRY), functions(move(functions_)) {
23262
- this->name = name;
23263
- for (auto &function : functions) {
23264
- function.name = name;
23265
- }
23266
- }
23267
-
23268
- vector<PragmaFunction> functions;
23305
+ enum class TransactionType : uint8_t { INVALID, BEGIN_TRANSACTION, COMMIT, ROLLBACK };
23269
23306
 
23270
- public:
23271
- unique_ptr<CreateInfo> Copy() const override {
23272
- auto result = make_unique<CreatePragmaFunctionInfo>(functions[0].name, functions);
23273
- CopyProperties(*result);
23274
- return move(result);
23307
+ struct TransactionInfo : public ParseInfo {
23308
+ explicit TransactionInfo(TransactionType type) : type(type) {
23275
23309
  }
23310
+
23311
+ //! The type of transaction statement
23312
+ TransactionType type;
23276
23313
  };
23277
23314
 
23278
23315
  } // namespace duckdb
23279
23316
  //===----------------------------------------------------------------------===//
23280
23317
  // DuckDB
23281
23318
  //
23282
- // duckdb/parser/parsed_data/export_table_data.hpp
23319
+ // duckdb/parser/parsed_data/create_type_info.hpp
23283
23320
  //
23284
23321
  //
23285
23322
  //===----------------------------------------------------------------------===//
@@ -23289,33 +23326,35 @@ public:
23289
23326
 
23290
23327
 
23291
23328
 
23292
- namespace duckdb {
23293
23329
 
23294
- struct ExportedTableData {
23295
- //! Name of the exported table
23296
- string table_name;
23297
23330
 
23298
- //! Name of the schema
23299
- string schema_name;
23331
+ namespace duckdb {
23300
23332
 
23301
- //! Path to be exported
23302
- string file_path;
23303
- };
23333
+ struct CreateTypeInfo : public CreateInfo {
23304
23334
 
23305
- struct ExportedTableInfo {
23306
- TableCatalogEntry *entry;
23307
- ExportedTableData table_data;
23308
- };
23335
+ CreateTypeInfo() : CreateInfo(CatalogType::TYPE_ENTRY) {
23336
+ }
23309
23337
 
23310
- struct BoundExportData : public ParseInfo {
23311
- std::vector<ExportedTableInfo> data;
23338
+ //! Name of the Type
23339
+ string name;
23340
+ //! Logical Type
23341
+ LogicalType type;
23342
+
23343
+ public:
23344
+ unique_ptr<CreateInfo> Copy() const override {
23345
+ auto result = make_unique<CreateTypeInfo>();
23346
+ CopyProperties(*result);
23347
+ result->name = name;
23348
+ result->type = type;
23349
+ return move(result);
23350
+ }
23312
23351
  };
23313
23352
 
23314
23353
  } // namespace duckdb
23315
23354
  //===----------------------------------------------------------------------===//
23316
23355
  // DuckDB
23317
23356
  //
23318
- // duckdb/parser/parsed_data/create_type_info.hpp
23357
+ // duckdb/parser/parsed_data/create_view_info.hpp
23319
23358
  //
23320
23359
  //
23321
23360
  //===----------------------------------------------------------------------===//
@@ -23325,26 +23364,31 @@ struct BoundExportData : public ParseInfo {
23325
23364
 
23326
23365
 
23327
23366
 
23328
-
23329
-
23330
23367
  namespace duckdb {
23331
23368
 
23332
- struct CreateTypeInfo : public CreateInfo {
23333
-
23334
- CreateTypeInfo() : CreateInfo(CatalogType::TYPE_ENTRY) {
23369
+ struct CreateViewInfo : public CreateInfo {
23370
+ CreateViewInfo() : CreateInfo(CatalogType::VIEW_ENTRY, INVALID_SCHEMA) {
23371
+ }
23372
+ CreateViewInfo(string schema, string view_name)
23373
+ : CreateInfo(CatalogType::VIEW_ENTRY, schema), view_name(view_name) {
23335
23374
  }
23336
23375
 
23337
- //! Name of the Type
23338
- string name;
23339
- //! Logical Type
23340
- LogicalType type;
23376
+ //! Table name to insert to
23377
+ string view_name;
23378
+ //! Aliases of the view
23379
+ vector<string> aliases;
23380
+ //! Return types
23381
+ vector<LogicalType> types;
23382
+ //! The SelectStatement of the view
23383
+ unique_ptr<SelectStatement> query;
23341
23384
 
23342
23385
  public:
23343
23386
  unique_ptr<CreateInfo> Copy() const override {
23344
- auto result = make_unique<CreateTypeInfo>();
23387
+ auto result = make_unique<CreateViewInfo>(schema, view_name);
23345
23388
  CopyProperties(*result);
23346
- result->name = name;
23347
- result->type = type;
23389
+ result->aliases = aliases;
23390
+ result->types = types;
23391
+ result->query = unique_ptr_cast<SQLStatement, SelectStatement>(query->Copy());
23348
23392
  return move(result);
23349
23393
  }
23350
23394
  };
@@ -23437,7 +23481,7 @@ public:
23437
23481
  //===----------------------------------------------------------------------===//
23438
23482
  // DuckDB
23439
23483
  //
23440
- // duckdb/parser/parsed_data/create_schema_info.hpp
23484
+ // duckdb/parser/parsed_data/export_table_data.hpp
23441
23485
  //
23442
23486
  //
23443
23487
  //===----------------------------------------------------------------------===//
@@ -23446,25 +23490,34 @@ public:
23446
23490
 
23447
23491
 
23448
23492
 
23493
+
23449
23494
  namespace duckdb {
23450
23495
 
23451
- struct CreateSchemaInfo : public CreateInfo {
23452
- CreateSchemaInfo() : CreateInfo(CatalogType::SCHEMA_ENTRY) {
23453
- }
23496
+ struct ExportedTableData {
23497
+ //! Name of the exported table
23498
+ string table_name;
23454
23499
 
23455
- public:
23456
- unique_ptr<CreateInfo> Copy() const override {
23457
- auto result = make_unique<CreateSchemaInfo>();
23458
- CopyProperties(*result);
23459
- return move(result);
23460
- }
23500
+ //! Name of the schema
23501
+ string schema_name;
23502
+
23503
+ //! Path to be exported
23504
+ string file_path;
23505
+ };
23506
+
23507
+ struct ExportedTableInfo {
23508
+ TableCatalogEntry *entry;
23509
+ ExportedTableData table_data;
23510
+ };
23511
+
23512
+ struct BoundExportData : public ParseInfo {
23513
+ std::vector<ExportedTableInfo> data;
23461
23514
  };
23462
23515
 
23463
23516
  } // namespace duckdb
23464
23517
  //===----------------------------------------------------------------------===//
23465
23518
  // DuckDB
23466
23519
  //
23467
- // duckdb/parser/parsed_data/show_select_info.hpp
23520
+ // duckdb/parser/parsed_data/vacuum_info.hpp
23468
23521
  //
23469
23522
  //
23470
23523
  //===----------------------------------------------------------------------===//
@@ -23473,25 +23526,19 @@ public:
23473
23526
 
23474
23527
 
23475
23528
 
23476
-
23477
23529
  namespace duckdb {
23478
23530
 
23479
- struct ShowSelectInfo : public ParseInfo {
23480
- //! Types of projected columns
23481
- vector<LogicalType> types;
23482
- //! The QueryNode of select query
23483
- unique_ptr<QueryNode> query;
23484
- //! Aliases of projected columns
23485
- vector<string> aliases;
23486
- //! Whether or not we are requesting a summary or a describe
23487
- bool is_summary;
23531
+ enum class LoadType { LOAD, INSTALL, FORCE_INSTALL };
23488
23532
 
23489
- unique_ptr<ShowSelectInfo> Copy() {
23490
- auto result = make_unique<ShowSelectInfo>();
23491
- result->types = types;
23492
- result->query = query->Copy();
23493
- result->aliases = aliases;
23494
- result->is_summary = is_summary;
23533
+ struct LoadInfo : public ParseInfo {
23534
+ std::string filename;
23535
+ LoadType load_type;
23536
+
23537
+ public:
23538
+ unique_ptr<LoadInfo> Copy() const {
23539
+ auto result = make_unique<LoadInfo>();
23540
+ result->filename = filename;
23541
+ result->load_type = load_type;
23495
23542
  return result;
23496
23543
  }
23497
23544
  };
@@ -23537,25 +23584,6 @@ public:
23537
23584
  }
23538
23585
  };
23539
23586
 
23540
- } // namespace duckdb
23541
- //===----------------------------------------------------------------------===//
23542
- // DuckDB
23543
- //
23544
- // duckdb/parser/parsed_data/vacuum_info.hpp
23545
- //
23546
- //
23547
- //===----------------------------------------------------------------------===//
23548
-
23549
-
23550
-
23551
-
23552
-
23553
- namespace duckdb {
23554
-
23555
- struct VacuumInfo : public ParseInfo {
23556
- // nothing for now
23557
- };
23558
-
23559
23587
  } // namespace duckdb
23560
23588
  //===----------------------------------------------------------------------===//
23561
23589
  // DuckDB
@@ -23604,7 +23632,7 @@ public:
23604
23632
  //===----------------------------------------------------------------------===//
23605
23633
  // DuckDB
23606
23634
  //
23607
- // duckdb/parser/parsed_data/create_view_info.hpp
23635
+ // duckdb/parser/parsed_data/create_pragma_function_info.hpp
23608
23636
  //
23609
23637
  //
23610
23638
  //===----------------------------------------------------------------------===//
@@ -23616,29 +23644,26 @@ public:
23616
23644
 
23617
23645
  namespace duckdb {
23618
23646
 
23619
- struct CreateViewInfo : public CreateInfo {
23620
- CreateViewInfo() : CreateInfo(CatalogType::VIEW_ENTRY, INVALID_SCHEMA) {
23647
+ struct CreatePragmaFunctionInfo : public CreateFunctionInfo {
23648
+ explicit CreatePragmaFunctionInfo(PragmaFunction function)
23649
+ : CreateFunctionInfo(CatalogType::PRAGMA_FUNCTION_ENTRY) {
23650
+ functions.push_back(move(function));
23651
+ this->name = function.name;
23621
23652
  }
23622
- CreateViewInfo(string schema, string view_name)
23623
- : CreateInfo(CatalogType::VIEW_ENTRY, schema), view_name(view_name) {
23653
+ CreatePragmaFunctionInfo(string name, vector<PragmaFunction> functions_)
23654
+ : CreateFunctionInfo(CatalogType::PRAGMA_FUNCTION_ENTRY), functions(move(functions_)) {
23655
+ this->name = name;
23656
+ for (auto &function : functions) {
23657
+ function.name = name;
23658
+ }
23624
23659
  }
23625
23660
 
23626
- //! Table name to insert to
23627
- string view_name;
23628
- //! Aliases of the view
23629
- vector<string> aliases;
23630
- //! Return types
23631
- vector<LogicalType> types;
23632
- //! The SelectStatement of the view
23633
- unique_ptr<SelectStatement> query;
23661
+ vector<PragmaFunction> functions;
23634
23662
 
23635
23663
  public:
23636
23664
  unique_ptr<CreateInfo> Copy() const override {
23637
- auto result = make_unique<CreateViewInfo>(schema, view_name);
23665
+ auto result = make_unique<CreatePragmaFunctionInfo>(functions[0].name, functions);
23638
23666
  CopyProperties(*result);
23639
- result->aliases = aliases;
23640
- result->types = types;
23641
- result->query = unique_ptr_cast<SQLStatement, SelectStatement>(query->Copy());
23642
23667
  return move(result);
23643
23668
  }
23644
23669
  };
@@ -23647,7 +23672,7 @@ public:
23647
23672
  //===----------------------------------------------------------------------===//
23648
23673
  // DuckDB
23649
23674
  //
23650
- // duckdb/parser/parsed_data/transaction_info.hpp
23675
+ // duckdb/parser/tableref/expressionlistref.hpp
23651
23676
  //
23652
23677
  //
23653
23678
  //===----------------------------------------------------------------------===//
@@ -23656,23 +23681,39 @@ public:
23656
23681
 
23657
23682
 
23658
23683
 
23659
- namespace duckdb {
23660
23684
 
23661
- enum class TransactionType : uint8_t { INVALID, BEGIN_TRANSACTION, COMMIT, ROLLBACK };
23662
23685
 
23663
- struct TransactionInfo : public ParseInfo {
23664
- explicit TransactionInfo(TransactionType type) : type(type) {
23686
+
23687
+ namespace duckdb {
23688
+ //! Represents an expression list as generated by a VALUES statement
23689
+ class ExpressionListRef : public TableRef {
23690
+ public:
23691
+ ExpressionListRef() : TableRef(TableReferenceType::EXPRESSION_LIST) {
23665
23692
  }
23666
23693
 
23667
- //! The type of transaction statement
23668
- TransactionType type;
23669
- };
23694
+ //! Value list, only used for VALUES statement
23695
+ vector<vector<unique_ptr<ParsedExpression>>> values;
23696
+ //! Expected SQL types
23697
+ vector<LogicalType> expected_types;
23698
+ //! The set of expected names
23699
+ vector<string> expected_names;
23700
+
23701
+ public:
23702
+ bool Equals(const TableRef *other_p) const override;
23703
+
23704
+ unique_ptr<TableRef> Copy() override;
23670
23705
 
23706
+ //! Serializes a blob into a ExpressionListRef
23707
+ void Serialize(FieldWriter &serializer) const override;
23708
+ //! Deserializes a blob back into a ExpressionListRef
23709
+ static unique_ptr<TableRef> Deserialize(FieldReader &source);
23710
+ };
23671
23711
  } // namespace duckdb
23712
+
23672
23713
  //===----------------------------------------------------------------------===//
23673
23714
  // DuckDB
23674
23715
  //
23675
- // duckdb/parser/tableref/joinref.hpp
23716
+ // duckdb/parser/tableref/crossproductref.hpp
23676
23717
  //
23677
23718
  //
23678
23719
  //===----------------------------------------------------------------------===//
@@ -23681,41 +23722,30 @@ struct TransactionInfo : public ParseInfo {
23681
23722
 
23682
23723
 
23683
23724
 
23684
-
23685
-
23686
-
23687
-
23688
23725
  namespace duckdb {
23689
- //! Represents a JOIN between two expressions
23690
- class JoinRef : public TableRef {
23726
+ //! Represents a cross product
23727
+ class CrossProductRef : public TableRef {
23691
23728
  public:
23692
- JoinRef() : TableRef(TableReferenceType::JOIN), is_natural(false) {
23729
+ CrossProductRef() : TableRef(TableReferenceType::CROSS_PRODUCT) {
23693
23730
  }
23694
23731
 
23695
- //! The left hand side of the join
23732
+ //! The left hand side of the cross product
23696
23733
  unique_ptr<TableRef> left;
23697
- //! The right hand side of the join
23734
+ //! The right hand side of the cross product
23698
23735
  unique_ptr<TableRef> right;
23699
- //! The join condition
23700
- unique_ptr<ParsedExpression> condition;
23701
- //! The join type
23702
- JoinType type;
23703
- //! Natural join
23704
- bool is_natural;
23705
- //! The set of USING columns (if any)
23706
- vector<string> using_columns;
23707
23736
 
23708
23737
  public:
23709
23738
  bool Equals(const TableRef *other_p) const override;
23710
23739
 
23711
23740
  unique_ptr<TableRef> Copy() override;
23712
23741
 
23713
- //! Serializes a blob into a JoinRef
23742
+ //! Serializes a blob into a CrossProductRef
23714
23743
  void Serialize(FieldWriter &serializer) const override;
23715
- //! Deserializes a blob back into a JoinRef
23744
+ //! Deserializes a blob back into a CrossProductRef
23716
23745
  static unique_ptr<TableRef> Deserialize(FieldReader &source);
23717
23746
  };
23718
23747
  } // namespace duckdb
23748
+
23719
23749
  //===----------------------------------------------------------------------===//
23720
23750
  // DuckDB
23721
23751
  //
@@ -23746,10 +23776,12 @@ public:
23746
23776
  static unique_ptr<TableRef> Deserialize(FieldReader &source);
23747
23777
  };
23748
23778
  } // namespace duckdb
23779
+
23780
+
23749
23781
  //===----------------------------------------------------------------------===//
23750
23782
  // DuckDB
23751
23783
  //
23752
- // duckdb/parser/tableref/expressionlistref.hpp
23784
+ // duckdb/parser/tableref/joinref.hpp
23753
23785
  //
23754
23786
  //
23755
23787
  //===----------------------------------------------------------------------===//
@@ -23761,31 +23793,39 @@ public:
23761
23793
 
23762
23794
 
23763
23795
 
23796
+
23764
23797
  namespace duckdb {
23765
- //! Represents an expression list as generated by a VALUES statement
23766
- class ExpressionListRef : public TableRef {
23798
+ //! Represents a JOIN between two expressions
23799
+ class JoinRef : public TableRef {
23767
23800
  public:
23768
- ExpressionListRef() : TableRef(TableReferenceType::EXPRESSION_LIST) {
23801
+ JoinRef() : TableRef(TableReferenceType::JOIN), is_natural(false) {
23769
23802
  }
23770
23803
 
23771
- //! Value list, only used for VALUES statement
23772
- vector<vector<unique_ptr<ParsedExpression>>> values;
23773
- //! Expected SQL types
23774
- vector<LogicalType> expected_types;
23775
- //! The set of expected names
23776
- vector<string> expected_names;
23804
+ //! The left hand side of the join
23805
+ unique_ptr<TableRef> left;
23806
+ //! The right hand side of the join
23807
+ unique_ptr<TableRef> right;
23808
+ //! The join condition
23809
+ unique_ptr<ParsedExpression> condition;
23810
+ //! The join type
23811
+ JoinType type;
23812
+ //! Natural join
23813
+ bool is_natural;
23814
+ //! The set of USING columns (if any)
23815
+ vector<string> using_columns;
23777
23816
 
23778
23817
  public:
23779
23818
  bool Equals(const TableRef *other_p) const override;
23780
23819
 
23781
23820
  unique_ptr<TableRef> Copy() override;
23782
23821
 
23783
- //! Serializes a blob into a ExpressionListRef
23822
+ //! Serializes a blob into a JoinRef
23784
23823
  void Serialize(FieldWriter &serializer) const override;
23785
- //! Deserializes a blob back into a ExpressionListRef
23824
+ //! Deserializes a blob back into a JoinRef
23786
23825
  static unique_ptr<TableRef> Deserialize(FieldReader &source);
23787
23826
  };
23788
23827
  } // namespace duckdb
23828
+
23789
23829
  //===----------------------------------------------------------------------===//
23790
23830
  // DuckDB
23791
23831
  //
@@ -23821,6 +23861,7 @@ public:
23821
23861
  static unique_ptr<TableRef> Deserialize(FieldReader &source);
23822
23862
  };
23823
23863
  } // namespace duckdb
23864
+
23824
23865
  //===----------------------------------------------------------------------===//
23825
23866
  // DuckDB
23826
23867
  //
@@ -23863,44 +23904,3 @@ public:
23863
23904
  };
23864
23905
  } // namespace duckdb
23865
23906
 
23866
- //===----------------------------------------------------------------------===//
23867
- // DuckDB
23868
- //
23869
- // duckdb/parser/tableref/crossproductref.hpp
23870
- //
23871
- //
23872
- //===----------------------------------------------------------------------===//
23873
-
23874
-
23875
-
23876
-
23877
-
23878
- namespace duckdb {
23879
- //! Represents a cross product
23880
- class CrossProductRef : public TableRef {
23881
- public:
23882
- CrossProductRef() : TableRef(TableReferenceType::CROSS_PRODUCT) {
23883
- }
23884
-
23885
- //! The left hand side of the cross product
23886
- unique_ptr<TableRef> left;
23887
- //! The right hand side of the cross product
23888
- unique_ptr<TableRef> right;
23889
-
23890
- public:
23891
- bool Equals(const TableRef *other_p) const override;
23892
-
23893
- unique_ptr<TableRef> Copy() override;
23894
-
23895
- //! Serializes a blob into a CrossProductRef
23896
- void Serialize(FieldWriter &serializer) const override;
23897
- //! Deserializes a blob back into a CrossProductRef
23898
- static unique_ptr<TableRef> Deserialize(FieldReader &source);
23899
- };
23900
- } // namespace duckdb
23901
-
23902
-
23903
-
23904
-
23905
-
23906
-