duckdb 0.4.1-dev2385.0 → 0.4.1-dev2399.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/package.json +1 -1
- package/src/duckdb.cpp +280 -248
- package/src/duckdb.hpp +35 -31
- package/src/parquet-amalgamation.cpp +28431 -28431
- package/src/statement.cpp +21 -3
- package/test/data_type_support.test.js +27 -0
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 "
|
|
15
|
-
#define DUCKDB_VERSION "v0.4.1-
|
|
14
|
+
#define DUCKDB_SOURCE_ID "d2986595c"
|
|
15
|
+
#define DUCKDB_VERSION "v0.4.1-dev2399"
|
|
16
16
|
//===----------------------------------------------------------------------===//
|
|
17
17
|
// DuckDB
|
|
18
18
|
//
|
|
@@ -8624,8 +8624,8 @@ public:
|
|
|
8624
8624
|
QueryErrorContext error_context = QueryErrorContext());
|
|
8625
8625
|
//! Scans all the schemas in the system one-by-one, invoking the callback for each entry
|
|
8626
8626
|
DUCKDB_API void ScanSchemas(ClientContext &context, std::function<void(CatalogEntry *)> callback);
|
|
8627
|
-
//! Gets the "schema.name" entry of the specified type, if if_exists=true returns nullptr if entry does not
|
|
8628
|
-
//! otherwise an exception is thrown
|
|
8627
|
+
//! Gets the "schema.name" entry of the specified type, if if_exists=true returns nullptr if entry does not
|
|
8628
|
+
//! exist, otherwise an exception is thrown
|
|
8629
8629
|
DUCKDB_API CatalogEntry *GetEntry(ClientContext &context, CatalogType type, const string &schema,
|
|
8630
8630
|
const string &name, bool if_exists = false,
|
|
8631
8631
|
QueryErrorContext error_context = QueryErrorContext());
|
|
@@ -9837,8 +9837,8 @@ public:
|
|
|
9837
9837
|
|
|
9838
9838
|
//! Returns the column index of the specified column name.
|
|
9839
9839
|
//! If the column does not exist:
|
|
9840
|
-
//! If
|
|
9841
|
-
//! If
|
|
9840
|
+
//! If if_column_exists is true, returns DConstants::INVALID_INDEX
|
|
9841
|
+
//! If if_column_exists is false, throws an exception
|
|
9842
9842
|
column_t GetColumnIndex(string &name, bool if_exists = false);
|
|
9843
9843
|
|
|
9844
9844
|
private:
|
|
@@ -13819,7 +13819,7 @@ enum class AlterType : uint8_t {
|
|
|
13819
13819
|
enum AlterForeignKeyType : uint8_t { AFT_ADD = 0, AFT_DELETE = 1 };
|
|
13820
13820
|
|
|
13821
13821
|
struct AlterInfo : public ParseInfo {
|
|
13822
|
-
AlterInfo(AlterType type, string schema, string name);
|
|
13822
|
+
AlterInfo(AlterType type, string schema, string name, bool if_exists);
|
|
13823
13823
|
~AlterInfo() override;
|
|
13824
13824
|
|
|
13825
13825
|
AlterType type;
|
|
@@ -13843,7 +13843,7 @@ public:
|
|
|
13843
13843
|
//===--------------------------------------------------------------------===//
|
|
13844
13844
|
struct ChangeOwnershipInfo : public AlterInfo {
|
|
13845
13845
|
ChangeOwnershipInfo(CatalogType entry_catalog_type, string entry_schema, string entry_name, string owner_schema,
|
|
13846
|
-
string owner_name);
|
|
13846
|
+
string owner_name, bool if_exists);
|
|
13847
13847
|
|
|
13848
13848
|
// Catalog type refers to the entry type, since this struct is usually built from an
|
|
13849
13849
|
// ALTER <TYPE> <schema>.<name> OWNED BY <owner_schema>.<owner_name> statement
|
|
@@ -13876,7 +13876,7 @@ enum class AlterTableType : uint8_t {
|
|
|
13876
13876
|
};
|
|
13877
13877
|
|
|
13878
13878
|
struct AlterTableInfo : public AlterInfo {
|
|
13879
|
-
AlterTableInfo(AlterTableType type, string schema, string table);
|
|
13879
|
+
AlterTableInfo(AlterTableType type, string schema, string table, bool if_exists);
|
|
13880
13880
|
~AlterTableInfo() override;
|
|
13881
13881
|
|
|
13882
13882
|
AlterTableType alter_table_type;
|
|
@@ -13892,7 +13892,7 @@ public:
|
|
|
13892
13892
|
// RenameColumnInfo
|
|
13893
13893
|
//===--------------------------------------------------------------------===//
|
|
13894
13894
|
struct RenameColumnInfo : public AlterTableInfo {
|
|
13895
|
-
RenameColumnInfo(string schema, string table, string old_name_p, string new_name_p);
|
|
13895
|
+
RenameColumnInfo(string schema, string table, bool if_exists, string old_name_p, string new_name_p);
|
|
13896
13896
|
~RenameColumnInfo() override;
|
|
13897
13897
|
|
|
13898
13898
|
//! Column old name
|
|
@@ -13903,14 +13903,14 @@ struct RenameColumnInfo : public AlterTableInfo {
|
|
|
13903
13903
|
public:
|
|
13904
13904
|
unique_ptr<AlterInfo> Copy() const override;
|
|
13905
13905
|
void SerializeAlterTable(FieldWriter &writer) const override;
|
|
13906
|
-
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, string schema, string table);
|
|
13906
|
+
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, string schema, string table, bool if_exists);
|
|
13907
13907
|
};
|
|
13908
13908
|
|
|
13909
13909
|
//===--------------------------------------------------------------------===//
|
|
13910
13910
|
// RenameTableInfo
|
|
13911
13911
|
//===--------------------------------------------------------------------===//
|
|
13912
13912
|
struct RenameTableInfo : public AlterTableInfo {
|
|
13913
|
-
RenameTableInfo(string schema, string table, string new_name);
|
|
13913
|
+
RenameTableInfo(string schema, string table, bool if_exists, string new_name);
|
|
13914
13914
|
~RenameTableInfo() override;
|
|
13915
13915
|
|
|
13916
13916
|
//! Relation new name
|
|
@@ -13919,50 +13919,53 @@ struct RenameTableInfo : public AlterTableInfo {
|
|
|
13919
13919
|
public:
|
|
13920
13920
|
unique_ptr<AlterInfo> Copy() const override;
|
|
13921
13921
|
void SerializeAlterTable(FieldWriter &writer) const override;
|
|
13922
|
-
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, string schema, string table);
|
|
13922
|
+
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, string schema, string table, bool if_exists);
|
|
13923
13923
|
};
|
|
13924
13924
|
|
|
13925
13925
|
//===--------------------------------------------------------------------===//
|
|
13926
13926
|
// AddColumnInfo
|
|
13927
13927
|
//===--------------------------------------------------------------------===//
|
|
13928
13928
|
struct AddColumnInfo : public AlterTableInfo {
|
|
13929
|
-
AddColumnInfo(string schema, string table, ColumnDefinition new_column);
|
|
13929
|
+
AddColumnInfo(string schema, string table, bool if_exists, ColumnDefinition new_column, bool if_column_not_exists);
|
|
13930
13930
|
~AddColumnInfo() override;
|
|
13931
13931
|
|
|
13932
13932
|
//! New column
|
|
13933
13933
|
ColumnDefinition new_column;
|
|
13934
|
+
//! Whether or not an error should be thrown if the column exist
|
|
13935
|
+
bool if_column_not_exists;
|
|
13934
13936
|
|
|
13935
13937
|
public:
|
|
13936
13938
|
unique_ptr<AlterInfo> Copy() const override;
|
|
13937
13939
|
void SerializeAlterTable(FieldWriter &writer) const override;
|
|
13938
|
-
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, string schema, string table);
|
|
13940
|
+
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, string schema, string table, bool if_exists);
|
|
13939
13941
|
};
|
|
13940
13942
|
|
|
13941
13943
|
//===--------------------------------------------------------------------===//
|
|
13942
13944
|
// RemoveColumnInfo
|
|
13943
13945
|
//===--------------------------------------------------------------------===//
|
|
13944
13946
|
struct RemoveColumnInfo : public AlterTableInfo {
|
|
13945
|
-
RemoveColumnInfo(string schema, string table, string removed_column, bool
|
|
13947
|
+
RemoveColumnInfo(string schema, string table, bool if_exists, string removed_column, bool if_column_exists,
|
|
13948
|
+
bool cascade);
|
|
13946
13949
|
~RemoveColumnInfo() override;
|
|
13947
13950
|
|
|
13948
13951
|
//! The column to remove
|
|
13949
13952
|
string removed_column;
|
|
13950
13953
|
//! Whether or not an error should be thrown if the column does not exist
|
|
13951
|
-
bool
|
|
13954
|
+
bool if_column_exists;
|
|
13952
13955
|
//! Whether or not the column should be removed if a dependency conflict arises (used by GENERATED columns)
|
|
13953
13956
|
bool cascade;
|
|
13954
13957
|
|
|
13955
13958
|
public:
|
|
13956
13959
|
unique_ptr<AlterInfo> Copy() const override;
|
|
13957
13960
|
void SerializeAlterTable(FieldWriter &writer) const override;
|
|
13958
|
-
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, string schema, string table);
|
|
13961
|
+
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, string schema, string table, bool if_exists);
|
|
13959
13962
|
};
|
|
13960
13963
|
|
|
13961
13964
|
//===--------------------------------------------------------------------===//
|
|
13962
13965
|
// ChangeColumnTypeInfo
|
|
13963
13966
|
//===--------------------------------------------------------------------===//
|
|
13964
13967
|
struct ChangeColumnTypeInfo : public AlterTableInfo {
|
|
13965
|
-
ChangeColumnTypeInfo(string schema, string table, string column_name, LogicalType target_type,
|
|
13968
|
+
ChangeColumnTypeInfo(string schema, string table, bool if_exists, string column_name, LogicalType target_type,
|
|
13966
13969
|
unique_ptr<ParsedExpression> expression);
|
|
13967
13970
|
~ChangeColumnTypeInfo() override;
|
|
13968
13971
|
|
|
@@ -13976,14 +13979,15 @@ struct ChangeColumnTypeInfo : public AlterTableInfo {
|
|
|
13976
13979
|
public:
|
|
13977
13980
|
unique_ptr<AlterInfo> Copy() const override;
|
|
13978
13981
|
void SerializeAlterTable(FieldWriter &writer) const override;
|
|
13979
|
-
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, string schema, string table);
|
|
13982
|
+
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, string schema, string table, bool if_exists);
|
|
13980
13983
|
};
|
|
13981
13984
|
|
|
13982
13985
|
//===--------------------------------------------------------------------===//
|
|
13983
13986
|
// SetDefaultInfo
|
|
13984
13987
|
//===--------------------------------------------------------------------===//
|
|
13985
13988
|
struct SetDefaultInfo : public AlterTableInfo {
|
|
13986
|
-
SetDefaultInfo(string schema, string table, string column_name,
|
|
13989
|
+
SetDefaultInfo(string schema, string table, bool if_exists, string column_name,
|
|
13990
|
+
unique_ptr<ParsedExpression> new_default);
|
|
13987
13991
|
~SetDefaultInfo() override;
|
|
13988
13992
|
|
|
13989
13993
|
//! The column name to alter
|
|
@@ -13994,14 +13998,14 @@ struct SetDefaultInfo : public AlterTableInfo {
|
|
|
13994
13998
|
public:
|
|
13995
13999
|
unique_ptr<AlterInfo> Copy() const override;
|
|
13996
14000
|
void SerializeAlterTable(FieldWriter &writer) const override;
|
|
13997
|
-
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, string schema, string table);
|
|
14001
|
+
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, string schema, string table, bool if_exists);
|
|
13998
14002
|
};
|
|
13999
14003
|
|
|
14000
14004
|
//===--------------------------------------------------------------------===//
|
|
14001
14005
|
// AlterForeignKeyInfo
|
|
14002
14006
|
//===--------------------------------------------------------------------===//
|
|
14003
14007
|
struct AlterForeignKeyInfo : public AlterTableInfo {
|
|
14004
|
-
AlterForeignKeyInfo(string schema, string table, string fk_table, vector<string> pk_columns,
|
|
14008
|
+
AlterForeignKeyInfo(string schema, string table, bool if_exists, string fk_table, vector<string> pk_columns,
|
|
14005
14009
|
vector<string> fk_columns, vector<idx_t> pk_keys, vector<idx_t> fk_keys,
|
|
14006
14010
|
AlterForeignKeyType type);
|
|
14007
14011
|
~AlterForeignKeyInfo() override;
|
|
@@ -14016,7 +14020,7 @@ struct AlterForeignKeyInfo : public AlterTableInfo {
|
|
|
14016
14020
|
public:
|
|
14017
14021
|
unique_ptr<AlterInfo> Copy() const override;
|
|
14018
14022
|
void SerializeAlterTable(FieldWriter &writer) const override;
|
|
14019
|
-
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, string schema, string table);
|
|
14023
|
+
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, string schema, string table, bool if_exists);
|
|
14020
14024
|
};
|
|
14021
14025
|
|
|
14022
14026
|
//===--------------------------------------------------------------------===//
|
|
@@ -14025,7 +14029,7 @@ public:
|
|
|
14025
14029
|
enum class AlterViewType : uint8_t { INVALID = 0, RENAME_VIEW = 1 };
|
|
14026
14030
|
|
|
14027
14031
|
struct AlterViewInfo : public AlterInfo {
|
|
14028
|
-
AlterViewInfo(AlterViewType type, string schema, string view);
|
|
14032
|
+
AlterViewInfo(AlterViewType type, string schema, string view, bool if_exists);
|
|
14029
14033
|
~AlterViewInfo() override;
|
|
14030
14034
|
|
|
14031
14035
|
AlterViewType alter_view_type;
|
|
@@ -14041,7 +14045,7 @@ public:
|
|
|
14041
14045
|
// RenameViewInfo
|
|
14042
14046
|
//===--------------------------------------------------------------------===//
|
|
14043
14047
|
struct RenameViewInfo : public AlterViewInfo {
|
|
14044
|
-
RenameViewInfo(string schema, string view, string new_name);
|
|
14048
|
+
RenameViewInfo(string schema, string view, bool if_exists, string new_name);
|
|
14045
14049
|
~RenameViewInfo() override;
|
|
14046
14050
|
|
|
14047
14051
|
//! Relation new name
|
|
@@ -14050,14 +14054,14 @@ struct RenameViewInfo : public AlterViewInfo {
|
|
|
14050
14054
|
public:
|
|
14051
14055
|
unique_ptr<AlterInfo> Copy() const override;
|
|
14052
14056
|
void SerializeAlterView(FieldWriter &writer) const override;
|
|
14053
|
-
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, string schema, string
|
|
14057
|
+
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, string schema, string view, bool if_exists);
|
|
14054
14058
|
};
|
|
14055
14059
|
|
|
14056
14060
|
//===--------------------------------------------------------------------===//
|
|
14057
14061
|
// SetNotNullInfo
|
|
14058
14062
|
//===--------------------------------------------------------------------===//
|
|
14059
14063
|
struct SetNotNullInfo : public AlterTableInfo {
|
|
14060
|
-
SetNotNullInfo(string schema, string table, string column_name);
|
|
14064
|
+
SetNotNullInfo(string schema, string table, bool if_exists, string column_name);
|
|
14061
14065
|
~SetNotNullInfo() override;
|
|
14062
14066
|
|
|
14063
14067
|
//! The column name to alter
|
|
@@ -14066,14 +14070,14 @@ struct SetNotNullInfo : public AlterTableInfo {
|
|
|
14066
14070
|
public:
|
|
14067
14071
|
unique_ptr<AlterInfo> Copy() const override;
|
|
14068
14072
|
void SerializeAlterTable(FieldWriter &writer) const override;
|
|
14069
|
-
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, string schema, string table);
|
|
14073
|
+
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, string schema, string table, bool if_exists);
|
|
14070
14074
|
};
|
|
14071
14075
|
|
|
14072
14076
|
//===--------------------------------------------------------------------===//
|
|
14073
14077
|
// DropNotNullInfo
|
|
14074
14078
|
//===--------------------------------------------------------------------===//
|
|
14075
14079
|
struct DropNotNullInfo : public AlterTableInfo {
|
|
14076
|
-
DropNotNullInfo(string schema, string table, string column_name);
|
|
14080
|
+
DropNotNullInfo(string schema, string table, bool if_exists, string column_name);
|
|
14077
14081
|
~DropNotNullInfo() override;
|
|
14078
14082
|
|
|
14079
14083
|
//! The column name to alter
|
|
@@ -14082,7 +14086,7 @@ struct DropNotNullInfo : public AlterTableInfo {
|
|
|
14082
14086
|
public:
|
|
14083
14087
|
unique_ptr<AlterInfo> Copy() const override;
|
|
14084
14088
|
void SerializeAlterTable(FieldWriter &writer) const override;
|
|
14085
|
-
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, string schema, string table);
|
|
14089
|
+
static unique_ptr<AlterInfo> Deserialize(FieldReader &reader, string schema, string table, bool if_exists);
|
|
14086
14090
|
};
|
|
14087
14091
|
|
|
14088
14092
|
} // namespace duckdb
|