duckdb 0.8.2-dev1968.0 → 0.8.2-dev2068.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/configure.py +7 -2
- package/package.json +1 -1
- package/src/duckdb/src/catalog/catalog.cpp +1 -1
- package/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +17 -41
- package/src/duckdb/src/catalog/catalog_entry/macro_catalog_entry.cpp +2 -10
- package/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp +4 -14
- package/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp +11 -28
- package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +11 -38
- package/src/duckdb/src/catalog/catalog_entry/view_catalog_entry.cpp +11 -27
- package/src/duckdb/src/catalog/catalog_entry.cpp +25 -1
- package/src/duckdb/src/common/adbc/adbc.cpp +18 -4
- package/src/duckdb/src/common/enum_util.cpp +159 -0
- package/src/duckdb/src/common/extra_type_info.cpp +1 -2
- package/src/duckdb/src/common/serializer/binary_deserializer.cpp +3 -0
- package/src/duckdb/src/common/serializer/binary_serializer.cpp +4 -4
- package/src/duckdb/src/common/types/column/column_data_collection.cpp +43 -0
- package/src/duckdb/src/common/types/vector.cpp +1 -1
- package/src/duckdb/src/common/types.cpp +0 -12
- package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +1 -1
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/index_catalog_entry.hpp +1 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/macro_catalog_entry.hpp +1 -4
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp +2 -5
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp +1 -6
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +2 -11
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/view_catalog_entry.hpp +2 -5
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp +14 -0
- package/src/duckdb/src/include/duckdb/common/assert.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/constants.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/enum_util.hpp +32 -0
- package/src/duckdb/src/include/duckdb/common/enums/index_type.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/index_vector.hpp +12 -0
- package/src/duckdb/src/include/duckdb/common/serializer/binary_deserializer.hpp +28 -4
- package/src/duckdb/src/include/duckdb/common/serializer/binary_serializer.hpp +12 -5
- package/src/duckdb/src/include/duckdb/common/serializer/deserialization_data.hpp +110 -0
- package/src/duckdb/src/include/duckdb/common/serializer/format_deserializer.hpp +46 -1
- package/src/duckdb/src/include/duckdb/common/serializer/format_serializer.hpp +23 -21
- package/src/duckdb/src/include/duckdb/common/serializer/serialization_traits.hpp +12 -4
- package/src/duckdb/src/include/duckdb/common/types/column/column_data_collection.hpp +3 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/math_functions.hpp +3 -3
- package/src/duckdb/src/include/duckdb/function/macro_function.hpp +3 -0
- package/src/duckdb/src/include/duckdb/function/scalar_macro_function.hpp +3 -0
- package/src/duckdb/src/include/duckdb/function/table_macro_function.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/column_definition.hpp +6 -5
- package/src/duckdb/src/include/duckdb/parser/column_list.hpp +4 -0
- package/src/duckdb/src/include/duckdb/parser/constraint.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/constraints/check_constraint.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/constraints/foreign_key_constraint.hpp +6 -0
- package/src/duckdb/src/include/duckdb/parser/constraints/not_null_constraint.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/constraints/unique_constraint.hpp +6 -0
- package/src/duckdb/src/include/duckdb/parser/expression/between_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/case_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/cast_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/collate_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/columnref_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/comparison_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/conjunction_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/constant_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/default_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/function_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/lambda_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/operator_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/parameter_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/positional_reference_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/star_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/subquery_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/window_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_info.hpp +12 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +66 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/attach_info.hpp +8 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/copy_info.hpp +8 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_index_info.hpp +4 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_info.hpp +9 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_macro_info.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_schema_info.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_sequence_info.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_table_info.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_type_info.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_view_info.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/detach_info.hpp +7 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp +7 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/exported_table_data.hpp +7 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/load_info.hpp +13 -3
- package/src/duckdb/src/include/duckdb/parser/parsed_data/parse_info.hpp +22 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/pragma_info.hpp +10 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/show_select_info.hpp +7 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/transaction_info.hpp +10 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/vacuum_info.hpp +10 -0
- package/src/duckdb/src/include/duckdb/planner/bound_constraint.hpp +0 -8
- package/src/duckdb/src/include/duckdb/planner/bound_result_modifier.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/column_binding.hpp +5 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_between_expression.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_case_expression.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_cast_expression.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_columnref_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_comparison_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_conjunction_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_constant_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_default_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_lambda_expression.hpp +3 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_lambdaref_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_operator_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_data.hpp +5 -2
- package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_expression.hpp +7 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_reference_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_unnest_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/list.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/joinside.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/logical_operator.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_aggregate.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_any_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_column_data_get.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_comparison_join.hpp +9 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create.hpp +9 -6
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create_index.hpp +2 -16
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create_table.hpp +10 -6
- package/src/duckdb/src/include/duckdb/planner/operator/logical_cross_product.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_cteref.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delete.hpp +7 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delim_get.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_distinct.hpp +6 -10
- package/src/duckdb/src/include/duckdb/planner/operator/logical_dummy_scan.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_empty_result.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_explain.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_expression_get.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_filter.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_insert.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_limit.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_limit_percent.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_materialized_cte.hpp +5 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_order.hpp +7 -35
- package/src/duckdb/src/include/duckdb/planner/operator/logical_pivot.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_positional_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_projection.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_recursive_cte.hpp +5 -3
- package/src/duckdb/src/include/duckdb/planner/operator/logical_reset.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_sample.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_set.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_set_operation.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_show.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_simple.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_top_n.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_unnest.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_update.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_window.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_pivotref.hpp +3 -0
- package/src/duckdb/src/optimizer/deliminator.cpp +5 -3
- package/src/duckdb/src/parser/column_definition.cpp +20 -32
- package/src/duckdb/src/parser/column_list.cpp +8 -0
- package/src/duckdb/src/parser/constraints/foreign_key_constraint.cpp +3 -0
- package/src/duckdb/src/parser/constraints/unique_constraint.cpp +3 -0
- package/src/duckdb/src/parser/expression/case_expression.cpp +0 -12
- package/src/duckdb/src/parser/parsed_data/alter_info.cpp +5 -2
- package/src/duckdb/src/parser/parsed_data/alter_table_info.cpp +38 -0
- package/src/duckdb/src/parser/parsed_data/create_index_info.cpp +3 -1
- package/src/duckdb/src/parser/parsed_data/create_sequence_info.cpp +2 -0
- package/src/duckdb/src/parser/parsed_data/detach_info.cpp +1 -1
- package/src/duckdb/src/parser/parsed_data/drop_info.cpp +1 -1
- package/src/duckdb/src/parser/parsed_data/sample_options.cpp +0 -18
- package/src/duckdb/src/parser/parsed_data/transaction_info.cpp +4 -1
- package/src/duckdb/src/parser/parsed_data/vacuum_info.cpp +1 -1
- package/src/duckdb/src/parser/query_node.cpp +0 -10
- package/src/duckdb/src/parser/result_modifier.cpp +0 -13
- package/src/duckdb/src/parser/statement/select_statement.cpp +0 -10
- package/src/duckdb/src/parser/tableref/pivotref.cpp +0 -16
- package/src/duckdb/src/parser/transform/statement/transform_create_index.cpp +5 -4
- package/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +6 -1
- package/src/duckdb/src/planner/expression/bound_between_expression.cpp +4 -0
- package/src/duckdb/src/planner/expression/bound_cast_expression.cpp +13 -6
- package/src/duckdb/src/planner/expression/bound_parameter_expression.cpp +20 -12
- package/src/duckdb/src/planner/expression/bound_window_expression.cpp +1 -4
- package/src/duckdb/src/planner/logical_operator.cpp +13 -1
- package/src/duckdb/src/planner/operator/logical_comparison_join.cpp +16 -2
- package/src/duckdb/src/planner/operator/logical_create.cpp +14 -0
- package/src/duckdb/src/planner/operator/logical_create_index.cpp +20 -0
- package/src/duckdb/src/planner/operator/logical_create_table.cpp +16 -0
- package/src/duckdb/src/planner/operator/logical_delete.cpp +9 -2
- package/src/duckdb/src/planner/operator/logical_delim_join.cpp +2 -4
- package/src/duckdb/src/planner/operator/logical_distinct.cpp +13 -0
- package/src/duckdb/src/planner/operator/logical_explain.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_insert.cpp +8 -2
- package/src/duckdb/src/planner/operator/logical_materialized_cte.cpp +3 -2
- package/src/duckdb/src/planner/operator/logical_order.cpp +39 -0
- package/src/duckdb/src/planner/operator/logical_pivot.cpp +3 -0
- package/src/duckdb/src/planner/operator/logical_recursive_cte.cpp +5 -5
- package/src/duckdb/src/planner/operator/logical_sample.cpp +3 -0
- package/src/duckdb/src/planner/operator/logical_update.cpp +8 -2
- package/src/duckdb/src/planner/parsed_data/bound_create_table_info.cpp +4 -2
- package/src/duckdb/src/planner/planner.cpp +11 -0
- package/src/duckdb/src/storage/checkpoint_manager.cpp +23 -23
- package/src/duckdb/src/storage/serialization/serialize_constraint.cpp +98 -0
- package/src/duckdb/src/storage/serialization/serialize_create_info.cpp +188 -0
- package/src/duckdb/src/storage/serialization/serialize_expression.cpp +274 -0
- package/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp +729 -0
- package/src/duckdb/src/storage/serialization/serialize_macro_function.cpp +62 -0
- package/src/duckdb/src/storage/serialization/serialize_nodes.cpp +242 -0
- package/src/duckdb/src/storage/serialization/serialize_parse_info.cpp +419 -0
- package/src/duckdb/src/storage/serialization/serialize_parsed_expression.cpp +40 -38
- package/src/duckdb/src/storage/serialization/serialize_query_node.cpp +36 -36
- package/src/duckdb/src/storage/serialization/serialize_result_modifier.cpp +25 -14
- package/src/duckdb/src/storage/serialization/serialize_statement.cpp +22 -0
- package/src/duckdb/src/storage/serialization/serialize_tableref.cpp +47 -47
- package/src/duckdb/src/storage/serialization/serialize_types.cpp +25 -25
- package/src/duckdb/src/storage/storage_info.cpp +3 -2
- package/src/duckdb/src/storage/wal_replay.cpp +20 -19
- package/src/duckdb/third_party/concurrentqueue/lightweightsemaphore.h +3 -76
- package/src/duckdb/third_party/libpg_query/pg_functions.cpp +13 -0
- package/src/duckdb/third_party/libpg_query/src_backend_parser_scansup.cpp +9 -0
- package/src/duckdb/ub_src_parser.cpp +0 -2
- package/src/duckdb/ub_src_storage_serialization.cpp +16 -0
- package/src/duckdb/src/parser/common_table_expression_info.cpp +0 -21
package/configure.py
CHANGED
@@ -31,6 +31,7 @@ if os.environ.get('DUCKDB_NODE_BUILD_CACHE') == '1' and os.path.isfile(cache_fil
|
|
31
31
|
windows_options = cache['windows_options']
|
32
32
|
cflags = cache['cflags']
|
33
33
|
elif 'DUCKDB_NODE_BINDIR' in os.environ:
|
34
|
+
|
34
35
|
def find_library_path(libdir, libname):
|
35
36
|
flist = os.listdir(libdir)
|
36
37
|
for fname in flist:
|
@@ -38,6 +39,7 @@ elif 'DUCKDB_NODE_BINDIR' in os.environ:
|
|
38
39
|
if os.path.isfile(fpath) and package_build.file_is_lib(fname, libname):
|
39
40
|
return fpath
|
40
41
|
raise Exception(f"Failed to find library {libname} in {libdir}")
|
42
|
+
|
41
43
|
# existing build
|
42
44
|
existing_duckdb_dir = os.environ['DUCKDB_NODE_BINDIR']
|
43
45
|
cflags = os.environ['DUCKDB_NODE_CFLAGS']
|
@@ -48,7 +50,7 @@ elif 'DUCKDB_NODE_BINDIR' in os.environ:
|
|
48
50
|
|
49
51
|
result_libraries = package_build.get_libraries(existing_duckdb_dir, libraries, extensions)
|
50
52
|
libraries = []
|
51
|
-
for
|
53
|
+
for libdir, libname in result_libraries:
|
52
54
|
if libdir is None:
|
53
55
|
continue
|
54
56
|
libraries.append(find_library_path(libdir, libname))
|
@@ -72,7 +74,7 @@ elif 'DUCKDB_NODE_BINDIR' in os.environ:
|
|
72
74
|
'include_list': include_list,
|
73
75
|
'libraries': libraries,
|
74
76
|
'cflags': cflags,
|
75
|
-
'windows_options': windows_options
|
77
|
+
'windows_options': windows_options,
|
76
78
|
}
|
77
79
|
with open(cache_file, 'wb+') as f:
|
78
80
|
pickle.dump(cache, f)
|
@@ -90,9 +92,11 @@ else:
|
|
90
92
|
windows_options = ['/GR']
|
91
93
|
cflags = ['-frtti']
|
92
94
|
|
95
|
+
|
93
96
|
def sanitize_path(x):
|
94
97
|
return x.replace('\\', '/')
|
95
98
|
|
99
|
+
|
96
100
|
source_list = [sanitize_path(x) for x in source_list]
|
97
101
|
include_list = [sanitize_path(x) for x in include_list]
|
98
102
|
libraries = [sanitize_path(x) for x in libraries]
|
@@ -100,6 +104,7 @@ libraries = [sanitize_path(x) for x in libraries]
|
|
100
104
|
with open(gyp_in, 'r') as f:
|
101
105
|
input_json = json.load(f)
|
102
106
|
|
107
|
+
|
103
108
|
def replace_entries(node, replacement_map):
|
104
109
|
if type(node) == type([]):
|
105
110
|
for key in replacement_map.keys():
|
package/package.json
CHANGED
@@ -278,7 +278,7 @@ optional_ptr<CatalogEntry> Catalog::CreateIndex(CatalogTransaction transaction,
|
|
278
278
|
|
279
279
|
optional_ptr<CatalogEntry> Catalog::CreateIndex(ClientContext &context, CreateIndexInfo &info) {
|
280
280
|
auto &schema = GetSchema(context, info.schema);
|
281
|
-
auto &table = GetEntry<TableCatalogEntry>(context, schema.name, info.table
|
281
|
+
auto &table = GetEntry<TableCatalogEntry>(context, schema.name, info.table);
|
282
282
|
return schema.CreateIndex(context, info, table);
|
283
283
|
}
|
284
284
|
|
@@ -19,47 +19,23 @@ string IndexCatalogEntry::ToSQL() const {
|
|
19
19
|
return sql;
|
20
20
|
}
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
unique_ptr<CreateIndexInfo> IndexCatalogEntry::Deserialize(Deserializer &source, ClientContext &context) {
|
41
|
-
// here we deserialize the index metadata in the following order:
|
42
|
-
// schema name, table schema name, table name, index name, sql, index type, index constraint type, expression list,
|
43
|
-
// parsed expression list, column IDs
|
44
|
-
|
45
|
-
auto create_index_info = make_uniq<CreateIndexInfo>();
|
46
|
-
|
47
|
-
FieldReader reader(source);
|
48
|
-
|
49
|
-
create_index_info->schema = reader.ReadRequired<string>();
|
50
|
-
create_index_info->table = make_uniq<BaseTableRef>();
|
51
|
-
create_index_info->table->schema_name = create_index_info->schema;
|
52
|
-
create_index_info->table->table_name = reader.ReadRequired<string>();
|
53
|
-
create_index_info->index_name = reader.ReadRequired<string>();
|
54
|
-
create_index_info->sql = reader.ReadRequired<string>();
|
55
|
-
create_index_info->index_type = IndexType(reader.ReadRequired<uint8_t>());
|
56
|
-
create_index_info->constraint_type = IndexConstraintType(reader.ReadRequired<uint8_t>());
|
57
|
-
create_index_info->expressions = reader.ReadRequiredSerializableList<ParsedExpression>();
|
58
|
-
create_index_info->parsed_expressions = reader.ReadRequiredSerializableList<ParsedExpression>();
|
59
|
-
|
60
|
-
create_index_info->column_ids = reader.ReadRequiredList<idx_t>();
|
61
|
-
reader.Finalize();
|
62
|
-
return create_index_info;
|
22
|
+
unique_ptr<CreateInfo> IndexCatalogEntry::GetInfo() const {
|
23
|
+
auto result = make_uniq<CreateIndexInfo>();
|
24
|
+
result->schema = GetSchemaName();
|
25
|
+
result->table = GetTableName();
|
26
|
+
result->index_name = name;
|
27
|
+
result->sql = sql;
|
28
|
+
result->index_type = index->type;
|
29
|
+
result->constraint_type = index->constraint_type;
|
30
|
+
for (auto &expr : expressions) {
|
31
|
+
result->expressions.push_back(expr->Copy());
|
32
|
+
}
|
33
|
+
for (auto &expr : parsed_expressions) {
|
34
|
+
result->parsed_expressions.push_back(expr->Copy());
|
35
|
+
}
|
36
|
+
result->column_ids = index->column_ids;
|
37
|
+
result->temporary = temporary;
|
38
|
+
return std::move(result);
|
63
39
|
}
|
64
40
|
|
65
41
|
} // namespace duckdb
|
@@ -22,21 +22,13 @@ TableMacroCatalogEntry::TableMacroCatalogEntry(Catalog &catalog, SchemaCatalogEn
|
|
22
22
|
: MacroCatalogEntry(catalog, schema, info) {
|
23
23
|
}
|
24
24
|
|
25
|
-
unique_ptr<
|
25
|
+
unique_ptr<CreateInfo> MacroCatalogEntry::GetInfo() const {
|
26
26
|
auto info = make_uniq<CreateMacroInfo>(type);
|
27
27
|
info->catalog = catalog.GetName();
|
28
28
|
info->schema = schema.name;
|
29
29
|
info->name = name;
|
30
30
|
info->function = function->Copy();
|
31
|
-
return info;
|
32
|
-
}
|
33
|
-
void MacroCatalogEntry::Serialize(Serializer &serializer) const {
|
34
|
-
auto info = GetInfoForSerialization();
|
35
|
-
info->Serialize(serializer);
|
36
|
-
}
|
37
|
-
|
38
|
-
unique_ptr<CreateMacroInfo> MacroCatalogEntry::Deserialize(Deserializer &main_source, ClientContext &context) {
|
39
|
-
return unique_ptr_cast<CreateInfo, CreateMacroInfo>(CreateInfo::Deserialize(main_source));
|
31
|
+
return std::move(info);
|
40
32
|
}
|
41
33
|
|
42
34
|
} // namespace duckdb
|
@@ -33,20 +33,10 @@ SimilarCatalogEntry SchemaCatalogEntry::GetSimilarEntry(CatalogTransaction trans
|
|
33
33
|
return result;
|
34
34
|
}
|
35
35
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
}
|
41
|
-
|
42
|
-
unique_ptr<CreateSchemaInfo> SchemaCatalogEntry::Deserialize(Deserializer &source) {
|
43
|
-
auto info = make_uniq<CreateSchemaInfo>();
|
44
|
-
|
45
|
-
FieldReader reader(source);
|
46
|
-
info->schema = reader.ReadRequired<string>();
|
47
|
-
reader.Finalize();
|
48
|
-
|
49
|
-
return info;
|
36
|
+
unique_ptr<CreateInfo> SchemaCatalogEntry::GetInfo() const {
|
37
|
+
auto result = make_uniq<CreateSchemaInfo>();
|
38
|
+
result->schema = name;
|
39
|
+
return std::move(result);
|
50
40
|
}
|
51
41
|
|
52
42
|
string SchemaCatalogEntry::ToSQL() const {
|
@@ -18,34 +18,17 @@ SequenceCatalogEntry::SequenceCatalogEntry(Catalog &catalog, SchemaCatalogEntry
|
|
18
18
|
this->temporary = info.temporary;
|
19
19
|
}
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
}
|
33
|
-
|
34
|
-
unique_ptr<CreateSequenceInfo> SequenceCatalogEntry::Deserialize(Deserializer &source) {
|
35
|
-
auto info = make_uniq<CreateSequenceInfo>();
|
36
|
-
|
37
|
-
FieldReader reader(source);
|
38
|
-
info->schema = reader.ReadRequired<string>();
|
39
|
-
info->name = reader.ReadRequired<string>();
|
40
|
-
info->usage_count = reader.ReadRequired<uint64_t>();
|
41
|
-
info->increment = reader.ReadRequired<int64_t>();
|
42
|
-
info->min_value = reader.ReadRequired<int64_t>();
|
43
|
-
info->max_value = reader.ReadRequired<int64_t>();
|
44
|
-
info->start_value = reader.ReadRequired<int64_t>();
|
45
|
-
info->cycle = reader.ReadRequired<bool>();
|
46
|
-
reader.Finalize();
|
47
|
-
|
48
|
-
return info;
|
21
|
+
unique_ptr<CreateInfo> SequenceCatalogEntry::GetInfo() const {
|
22
|
+
auto result = make_uniq<CreateSequenceInfo>();
|
23
|
+
result->schema = schema.name;
|
24
|
+
result->name = name;
|
25
|
+
result->usage_count = usage_count;
|
26
|
+
result->increment = increment;
|
27
|
+
result->min_value = min_value;
|
28
|
+
result->max_value = max_value;
|
29
|
+
result->start_value = counter;
|
30
|
+
result->cycle = cycle;
|
31
|
+
return std::move(result);
|
49
32
|
}
|
50
33
|
|
51
34
|
string SequenceCatalogEntry::ToSQL() const {
|
@@ -56,42 +56,16 @@ vector<LogicalType> TableCatalogEntry::GetTypes() {
|
|
56
56
|
return types;
|
57
57
|
}
|
58
58
|
|
59
|
-
|
60
|
-
|
61
|
-
result
|
62
|
-
result
|
63
|
-
result
|
64
|
-
result
|
65
|
-
result
|
59
|
+
unique_ptr<CreateInfo> TableCatalogEntry::GetInfo() const {
|
60
|
+
auto result = make_uniq<CreateTableInfo>();
|
61
|
+
result->catalog = catalog.GetName();
|
62
|
+
result->schema = schema.name;
|
63
|
+
result->table = name;
|
64
|
+
result->columns = columns.Copy();
|
65
|
+
result->constraints.reserve(constraints.size());
|
66
66
|
std::for_each(constraints.begin(), constraints.end(),
|
67
|
-
[&result](const unique_ptr<Constraint> &c) { result
|
68
|
-
return result;
|
69
|
-
}
|
70
|
-
|
71
|
-
void TableCatalogEntry::Serialize(Serializer &serializer) const {
|
72
|
-
D_ASSERT(!internal);
|
73
|
-
const auto info = GetTableInfoForSerialization();
|
74
|
-
FieldWriter writer(serializer);
|
75
|
-
writer.WriteString(info.catalog);
|
76
|
-
writer.WriteString(info.schema);
|
77
|
-
writer.WriteString(info.table);
|
78
|
-
info.columns.Serialize(writer);
|
79
|
-
writer.WriteSerializableList(info.constraints);
|
80
|
-
writer.Finalize();
|
81
|
-
}
|
82
|
-
|
83
|
-
unique_ptr<CreateTableInfo> TableCatalogEntry::Deserialize(Deserializer &source, ClientContext &context) {
|
84
|
-
auto info = make_uniq<CreateTableInfo>();
|
85
|
-
|
86
|
-
FieldReader reader(source);
|
87
|
-
info->catalog = reader.ReadRequired<string>();
|
88
|
-
info->schema = reader.ReadRequired<string>();
|
89
|
-
info->table = reader.ReadRequired<string>();
|
90
|
-
info->columns = ColumnList::Deserialize(reader);
|
91
|
-
info->constraints = reader.ReadRequiredSerializableList<Constraint>();
|
92
|
-
reader.Finalize();
|
93
|
-
|
94
|
-
return info;
|
67
|
+
[&result](const unique_ptr<Constraint> &c) { result->constraints.emplace_back(c->Copy()); });
|
68
|
+
return std::move(result);
|
95
69
|
}
|
96
70
|
|
97
71
|
string TableCatalogEntry::ColumnsToSQL(const ColumnList &columns, const vector<unique_ptr<Constraint>> &constraints) {
|
@@ -162,11 +136,10 @@ string TableCatalogEntry::ColumnsToSQL(const ColumnList &columns, const vector<u
|
|
162
136
|
// single column unique: insert constraint here
|
163
137
|
ss << " UNIQUE";
|
164
138
|
}
|
165
|
-
if (column.DefaultValue()) {
|
166
|
-
ss << " DEFAULT(" << column.DefaultValue()->ToString() << ")";
|
167
|
-
}
|
168
139
|
if (column.Generated()) {
|
169
140
|
ss << " GENERATED ALWAYS AS(" << column.GeneratedExpression().ToString() << ")";
|
141
|
+
} else if (column.DefaultValue()) {
|
142
|
+
ss << " DEFAULT(" << column.DefaultValue()->ToString() << ")";
|
170
143
|
}
|
171
144
|
}
|
172
145
|
// print any extra constraints that still need to be printed
|
@@ -25,6 +25,17 @@ ViewCatalogEntry::ViewCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema,
|
|
25
25
|
Initialize(info);
|
26
26
|
}
|
27
27
|
|
28
|
+
unique_ptr<CreateInfo> ViewCatalogEntry::GetInfo() const {
|
29
|
+
auto result = make_uniq<CreateViewInfo>();
|
30
|
+
result->schema = schema.name;
|
31
|
+
result->view_name = name;
|
32
|
+
result->sql = sql;
|
33
|
+
result->query = unique_ptr_cast<SQLStatement, SelectStatement>(query->Copy());
|
34
|
+
result->aliases = aliases;
|
35
|
+
result->types = types;
|
36
|
+
return std::move(result);
|
37
|
+
}
|
38
|
+
|
28
39
|
unique_ptr<CatalogEntry> ViewCatalogEntry::AlterEntry(ClientContext &context, AlterInfo &info) {
|
29
40
|
D_ASSERT(!internal);
|
30
41
|
if (info.type != AlterType::ALTER_VIEW) {
|
@@ -43,33 +54,6 @@ unique_ptr<CatalogEntry> ViewCatalogEntry::AlterEntry(ClientContext &context, Al
|
|
43
54
|
}
|
44
55
|
}
|
45
56
|
|
46
|
-
void ViewCatalogEntry::Serialize(Serializer &serializer) const {
|
47
|
-
D_ASSERT(!internal);
|
48
|
-
FieldWriter writer(serializer);
|
49
|
-
writer.WriteString(schema.name);
|
50
|
-
writer.WriteString(name);
|
51
|
-
writer.WriteString(sql);
|
52
|
-
writer.WriteSerializable(*query);
|
53
|
-
writer.WriteList<string>(aliases);
|
54
|
-
writer.WriteRegularSerializableList<LogicalType>(types);
|
55
|
-
writer.Finalize();
|
56
|
-
}
|
57
|
-
|
58
|
-
unique_ptr<CreateViewInfo> ViewCatalogEntry::Deserialize(Deserializer &source, ClientContext &context) {
|
59
|
-
auto info = make_uniq<CreateViewInfo>();
|
60
|
-
|
61
|
-
FieldReader reader(source);
|
62
|
-
info->schema = reader.ReadRequired<string>();
|
63
|
-
info->view_name = reader.ReadRequired<string>();
|
64
|
-
info->sql = reader.ReadRequired<string>();
|
65
|
-
info->query = reader.ReadRequiredSerializable<SelectStatement>();
|
66
|
-
info->aliases = reader.ReadRequiredList<string>();
|
67
|
-
info->types = reader.ReadRequiredSerializableList<LogicalType, LogicalType>();
|
68
|
-
reader.Finalize();
|
69
|
-
|
70
|
-
return info;
|
71
|
-
}
|
72
|
-
|
73
57
|
string ViewCatalogEntry::ToSQL() const {
|
74
58
|
if (sql.empty()) {
|
75
59
|
//! Return empty sql with view name so pragma view_tables don't complain
|
@@ -1,6 +1,8 @@
|
|
1
1
|
#include "duckdb/catalog/catalog_entry.hpp"
|
2
|
-
|
2
|
+
#include "duckdb/parser/parsed_data/create_info.hpp"
|
3
3
|
#include "duckdb/catalog/catalog.hpp"
|
4
|
+
#include "duckdb/common/serializer/binary_serializer.hpp"
|
5
|
+
#include "duckdb/common/serializer/binary_deserializer.hpp"
|
4
6
|
|
5
7
|
namespace duckdb {
|
6
8
|
|
@@ -31,6 +33,10 @@ unique_ptr<CatalogEntry> CatalogEntry::Copy(ClientContext &context) const {
|
|
31
33
|
throw InternalException("Unsupported copy type for catalog entry!");
|
32
34
|
}
|
33
35
|
|
36
|
+
unique_ptr<CreateInfo> CatalogEntry::GetInfo() const {
|
37
|
+
throw InternalException("Unsupported type for CatalogEntry::GetInfo!");
|
38
|
+
}
|
39
|
+
|
34
40
|
string CatalogEntry::ToSQL() const {
|
35
41
|
throw InternalException("Unsupported catalog type for ToSQL()");
|
36
42
|
}
|
@@ -44,6 +50,24 @@ SchemaCatalogEntry &CatalogEntry::ParentSchema() {
|
|
44
50
|
}
|
45
51
|
// LCOV_EXCL_STOP
|
46
52
|
|
53
|
+
void CatalogEntry::Serialize(Serializer &serializer) const {
|
54
|
+
const auto info = GetInfo();
|
55
|
+
info->Serialize(serializer);
|
56
|
+
}
|
57
|
+
|
58
|
+
unique_ptr<CreateInfo> CatalogEntry::Deserialize(Deserializer &source) {
|
59
|
+
return CreateInfo::Deserialize(source);
|
60
|
+
}
|
61
|
+
|
62
|
+
void CatalogEntry::FormatSerialize(FormatSerializer &serializer) const {
|
63
|
+
const auto info = GetInfo();
|
64
|
+
info->FormatSerialize(serializer);
|
65
|
+
}
|
66
|
+
|
67
|
+
unique_ptr<CreateInfo> CatalogEntry::FormatDeserialize(FormatDeserializer &deserializer) {
|
68
|
+
return CreateInfo::FormatDeserialize(deserializer);
|
69
|
+
}
|
70
|
+
|
47
71
|
void CatalogEntry::Verify(Catalog &catalog_p) {
|
48
72
|
}
|
49
73
|
|
@@ -52,12 +52,14 @@ duckdb_adbc::AdbcStatusCode duckdb_adbc_init(size_t count, struct duckdb_adbc::A
|
|
52
52
|
|
53
53
|
namespace duckdb_adbc {
|
54
54
|
|
55
|
+
enum class IngestionMode { CREATE = 0, APPEND = 1 };
|
55
56
|
struct DuckDBAdbcStatementWrapper {
|
56
57
|
::duckdb_connection connection;
|
57
58
|
::duckdb_arrow result;
|
58
59
|
::duckdb_prepared_statement statement;
|
59
60
|
char *ingestion_table_name;
|
60
61
|
ArrowArrayStream *ingestion_stream;
|
62
|
+
IngestionMode ingestion_mode = IngestionMode::CREATE;
|
61
63
|
};
|
62
64
|
static AdbcStatusCode QueryInternal(struct AdbcConnection *connection, struct ArrowArrayStream *out, const char *query,
|
63
65
|
struct AdbcError *error);
|
@@ -428,7 +430,7 @@ void stream_schema(uintptr_t factory_ptr, duckdb::ArrowSchemaWrapper &schema) {
|
|
428
430
|
}
|
429
431
|
|
430
432
|
AdbcStatusCode Ingest(duckdb_connection connection, const char *table_name, struct ArrowArrayStream *input,
|
431
|
-
struct AdbcError *error) {
|
433
|
+
struct AdbcError *error, IngestionMode ingestion_mode) {
|
432
434
|
|
433
435
|
auto status = SetErrorMaybe(connection, error, "Invalid connection");
|
434
436
|
if (status != ADBC_STATUS_OK) {
|
@@ -446,12 +448,11 @@ AdbcStatusCode Ingest(duckdb_connection connection, const char *table_name, stru
|
|
446
448
|
}
|
447
449
|
auto cconn = (duckdb::Connection *)connection;
|
448
450
|
|
449
|
-
auto has_table = cconn->TableInfo(table_name);
|
450
451
|
auto arrow_scan = cconn->TableFunction("arrow_scan", {duckdb::Value::POINTER((uintptr_t)input),
|
451
452
|
duckdb::Value::POINTER((uintptr_t)stream_produce),
|
452
453
|
duckdb::Value::POINTER((uintptr_t)get_schema)});
|
453
454
|
try {
|
454
|
-
if (
|
455
|
+
if (ingestion_mode == IngestionMode::CREATE) {
|
455
456
|
// We create the table based on an Arrow Scanner
|
456
457
|
arrow_scan->Create(table_name);
|
457
458
|
} else {
|
@@ -505,6 +506,7 @@ AdbcStatusCode StatementNew(struct AdbcConnection *connection, struct AdbcStatem
|
|
505
506
|
statement_wrapper->result = nullptr;
|
506
507
|
statement_wrapper->ingestion_stream = nullptr;
|
507
508
|
statement_wrapper->ingestion_table_name = nullptr;
|
509
|
+
statement_wrapper->ingestion_mode = IngestionMode::CREATE;
|
508
510
|
return ADBC_STATUS_OK;
|
509
511
|
}
|
510
512
|
|
@@ -557,7 +559,7 @@ AdbcStatusCode StatementExecuteQuery(struct AdbcStatement *statement, struct Arr
|
|
557
559
|
if (wrapper->ingestion_stream && wrapper->ingestion_table_name) {
|
558
560
|
auto stream = wrapper->ingestion_stream;
|
559
561
|
wrapper->ingestion_stream = nullptr;
|
560
|
-
return Ingest(wrapper->connection, wrapper->ingestion_table_name, stream, error);
|
562
|
+
return Ingest(wrapper->connection, wrapper->ingestion_table_name, stream, error, wrapper->ingestion_mode);
|
561
563
|
}
|
562
564
|
|
563
565
|
auto res = duckdb_execute_prepared_arrow(wrapper->statement, &wrapper->result);
|
@@ -643,6 +645,18 @@ AdbcStatusCode StatementSetOption(struct AdbcStatement *statement, const char *k
|
|
643
645
|
wrapper->ingestion_table_name = strdup(value);
|
644
646
|
return ADBC_STATUS_OK;
|
645
647
|
}
|
648
|
+
if (strcmp(key, ADBC_INGEST_OPTION_MODE) == 0) {
|
649
|
+
if (strcmp(value, ADBC_INGEST_OPTION_MODE_CREATE) == 0) {
|
650
|
+
wrapper->ingestion_mode = IngestionMode::CREATE;
|
651
|
+
return ADBC_STATUS_OK;
|
652
|
+
} else if (strcmp(value, ADBC_INGEST_OPTION_MODE_APPEND) == 0) {
|
653
|
+
wrapper->ingestion_mode = IngestionMode::APPEND;
|
654
|
+
return ADBC_STATUS_OK;
|
655
|
+
} else {
|
656
|
+
SetError(error, "Invalid ingestion mode");
|
657
|
+
return ADBC_STATUS_INVALID_ARGUMENT;
|
658
|
+
}
|
659
|
+
}
|
646
660
|
return ADBC_STATUS_INVALID_ARGUMENT;
|
647
661
|
}
|
648
662
|
|
@@ -88,6 +88,8 @@
|
|
88
88
|
#include "duckdb/parser/parsed_data/alter_table_info.hpp"
|
89
89
|
#include "duckdb/parser/parsed_data/create_info.hpp"
|
90
90
|
#include "duckdb/parser/parsed_data/create_sequence_info.hpp"
|
91
|
+
#include "duckdb/parser/parsed_data/load_info.hpp"
|
92
|
+
#include "duckdb/parser/parsed_data/parse_info.hpp"
|
91
93
|
#include "duckdb/parser/parsed_data/pragma_info.hpp"
|
92
94
|
#include "duckdb/parser/parsed_data/sample_options.hpp"
|
93
95
|
#include "duckdb/parser/parsed_data/transaction_info.hpp"
|
@@ -217,6 +219,29 @@ AggregateType EnumUtil::FromString<AggregateType>(const char *value) {
|
|
217
219
|
throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value));
|
218
220
|
}
|
219
221
|
|
222
|
+
template<>
|
223
|
+
const char* EnumUtil::ToChars<AlterForeignKeyType>(AlterForeignKeyType value) {
|
224
|
+
switch(value) {
|
225
|
+
case AlterForeignKeyType::AFT_ADD:
|
226
|
+
return "AFT_ADD";
|
227
|
+
case AlterForeignKeyType::AFT_DELETE:
|
228
|
+
return "AFT_DELETE";
|
229
|
+
default:
|
230
|
+
throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value));
|
231
|
+
}
|
232
|
+
}
|
233
|
+
|
234
|
+
template<>
|
235
|
+
AlterForeignKeyType EnumUtil::FromString<AlterForeignKeyType>(const char *value) {
|
236
|
+
if (StringUtil::Equals(value, "AFT_ADD")) {
|
237
|
+
return AlterForeignKeyType::AFT_ADD;
|
238
|
+
}
|
239
|
+
if (StringUtil::Equals(value, "AFT_DELETE")) {
|
240
|
+
return AlterForeignKeyType::AFT_DELETE;
|
241
|
+
}
|
242
|
+
throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value));
|
243
|
+
}
|
244
|
+
|
220
245
|
template<>
|
221
246
|
const char* EnumUtil::ToChars<AlterScalarFunctionType>(AlterScalarFunctionType value) {
|
222
247
|
switch(value) {
|
@@ -2274,6 +2299,39 @@ FunctionSideEffects EnumUtil::FromString<FunctionSideEffects>(const char *value)
|
|
2274
2299
|
throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value));
|
2275
2300
|
}
|
2276
2301
|
|
2302
|
+
template<>
|
2303
|
+
const char* EnumUtil::ToChars<IndexConstraintType>(IndexConstraintType value) {
|
2304
|
+
switch(value) {
|
2305
|
+
case IndexConstraintType::NONE:
|
2306
|
+
return "NONE";
|
2307
|
+
case IndexConstraintType::UNIQUE:
|
2308
|
+
return "UNIQUE";
|
2309
|
+
case IndexConstraintType::PRIMARY:
|
2310
|
+
return "PRIMARY";
|
2311
|
+
case IndexConstraintType::FOREIGN:
|
2312
|
+
return "FOREIGN";
|
2313
|
+
default:
|
2314
|
+
throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value));
|
2315
|
+
}
|
2316
|
+
}
|
2317
|
+
|
2318
|
+
template<>
|
2319
|
+
IndexConstraintType EnumUtil::FromString<IndexConstraintType>(const char *value) {
|
2320
|
+
if (StringUtil::Equals(value, "NONE")) {
|
2321
|
+
return IndexConstraintType::NONE;
|
2322
|
+
}
|
2323
|
+
if (StringUtil::Equals(value, "UNIQUE")) {
|
2324
|
+
return IndexConstraintType::UNIQUE;
|
2325
|
+
}
|
2326
|
+
if (StringUtil::Equals(value, "PRIMARY")) {
|
2327
|
+
return IndexConstraintType::PRIMARY;
|
2328
|
+
}
|
2329
|
+
if (StringUtil::Equals(value, "FOREIGN")) {
|
2330
|
+
return IndexConstraintType::FOREIGN;
|
2331
|
+
}
|
2332
|
+
throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value));
|
2333
|
+
}
|
2334
|
+
|
2277
2335
|
template<>
|
2278
2336
|
const char* EnumUtil::ToChars<IndexType>(IndexType value) {
|
2279
2337
|
switch(value) {
|
@@ -2482,6 +2540,34 @@ KeywordCategory EnumUtil::FromString<KeywordCategory>(const char *value) {
|
|
2482
2540
|
throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value));
|
2483
2541
|
}
|
2484
2542
|
|
2543
|
+
template<>
|
2544
|
+
const char* EnumUtil::ToChars<LoadType>(LoadType value) {
|
2545
|
+
switch(value) {
|
2546
|
+
case LoadType::LOAD:
|
2547
|
+
return "LOAD";
|
2548
|
+
case LoadType::INSTALL:
|
2549
|
+
return "INSTALL";
|
2550
|
+
case LoadType::FORCE_INSTALL:
|
2551
|
+
return "FORCE_INSTALL";
|
2552
|
+
default:
|
2553
|
+
throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value));
|
2554
|
+
}
|
2555
|
+
}
|
2556
|
+
|
2557
|
+
template<>
|
2558
|
+
LoadType EnumUtil::FromString<LoadType>(const char *value) {
|
2559
|
+
if (StringUtil::Equals(value, "LOAD")) {
|
2560
|
+
return LoadType::LOAD;
|
2561
|
+
}
|
2562
|
+
if (StringUtil::Equals(value, "INSTALL")) {
|
2563
|
+
return LoadType::INSTALL;
|
2564
|
+
}
|
2565
|
+
if (StringUtil::Equals(value, "FORCE_INSTALL")) {
|
2566
|
+
return LoadType::FORCE_INSTALL;
|
2567
|
+
}
|
2568
|
+
throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value));
|
2569
|
+
}
|
2570
|
+
|
2485
2571
|
template<>
|
2486
2572
|
const char* EnumUtil::ToChars<LogicalOperatorType>(LogicalOperatorType value) {
|
2487
2573
|
switch(value) {
|
@@ -3558,6 +3644,79 @@ OutputStream EnumUtil::FromString<OutputStream>(const char *value) {
|
|
3558
3644
|
throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value));
|
3559
3645
|
}
|
3560
3646
|
|
3647
|
+
template<>
|
3648
|
+
const char* EnumUtil::ToChars<ParseInfoType>(ParseInfoType value) {
|
3649
|
+
switch(value) {
|
3650
|
+
case ParseInfoType::ALTER_INFO:
|
3651
|
+
return "ALTER_INFO";
|
3652
|
+
case ParseInfoType::ATTACH_INFO:
|
3653
|
+
return "ATTACH_INFO";
|
3654
|
+
case ParseInfoType::COPY_INFO:
|
3655
|
+
return "COPY_INFO";
|
3656
|
+
case ParseInfoType::CREATE_INFO:
|
3657
|
+
return "CREATE_INFO";
|
3658
|
+
case ParseInfoType::DETACH_INFO:
|
3659
|
+
return "DETACH_INFO";
|
3660
|
+
case ParseInfoType::DROP_INFO:
|
3661
|
+
return "DROP_INFO";
|
3662
|
+
case ParseInfoType::BOUND_EXPORT_DATA:
|
3663
|
+
return "BOUND_EXPORT_DATA";
|
3664
|
+
case ParseInfoType::LOAD_INFO:
|
3665
|
+
return "LOAD_INFO";
|
3666
|
+
case ParseInfoType::PRAGMA_INFO:
|
3667
|
+
return "PRAGMA_INFO";
|
3668
|
+
case ParseInfoType::SHOW_SELECT_INFO:
|
3669
|
+
return "SHOW_SELECT_INFO";
|
3670
|
+
case ParseInfoType::TRANSACTION_INFO:
|
3671
|
+
return "TRANSACTION_INFO";
|
3672
|
+
case ParseInfoType::VACUUM_INFO:
|
3673
|
+
return "VACUUM_INFO";
|
3674
|
+
default:
|
3675
|
+
throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value));
|
3676
|
+
}
|
3677
|
+
}
|
3678
|
+
|
3679
|
+
template<>
|
3680
|
+
ParseInfoType EnumUtil::FromString<ParseInfoType>(const char *value) {
|
3681
|
+
if (StringUtil::Equals(value, "ALTER_INFO")) {
|
3682
|
+
return ParseInfoType::ALTER_INFO;
|
3683
|
+
}
|
3684
|
+
if (StringUtil::Equals(value, "ATTACH_INFO")) {
|
3685
|
+
return ParseInfoType::ATTACH_INFO;
|
3686
|
+
}
|
3687
|
+
if (StringUtil::Equals(value, "COPY_INFO")) {
|
3688
|
+
return ParseInfoType::COPY_INFO;
|
3689
|
+
}
|
3690
|
+
if (StringUtil::Equals(value, "CREATE_INFO")) {
|
3691
|
+
return ParseInfoType::CREATE_INFO;
|
3692
|
+
}
|
3693
|
+
if (StringUtil::Equals(value, "DETACH_INFO")) {
|
3694
|
+
return ParseInfoType::DETACH_INFO;
|
3695
|
+
}
|
3696
|
+
if (StringUtil::Equals(value, "DROP_INFO")) {
|
3697
|
+
return ParseInfoType::DROP_INFO;
|
3698
|
+
}
|
3699
|
+
if (StringUtil::Equals(value, "BOUND_EXPORT_DATA")) {
|
3700
|
+
return ParseInfoType::BOUND_EXPORT_DATA;
|
3701
|
+
}
|
3702
|
+
if (StringUtil::Equals(value, "LOAD_INFO")) {
|
3703
|
+
return ParseInfoType::LOAD_INFO;
|
3704
|
+
}
|
3705
|
+
if (StringUtil::Equals(value, "PRAGMA_INFO")) {
|
3706
|
+
return ParseInfoType::PRAGMA_INFO;
|
3707
|
+
}
|
3708
|
+
if (StringUtil::Equals(value, "SHOW_SELECT_INFO")) {
|
3709
|
+
return ParseInfoType::SHOW_SELECT_INFO;
|
3710
|
+
}
|
3711
|
+
if (StringUtil::Equals(value, "TRANSACTION_INFO")) {
|
3712
|
+
return ParseInfoType::TRANSACTION_INFO;
|
3713
|
+
}
|
3714
|
+
if (StringUtil::Equals(value, "VACUUM_INFO")) {
|
3715
|
+
return ParseInfoType::VACUUM_INFO;
|
3716
|
+
}
|
3717
|
+
throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value));
|
3718
|
+
}
|
3719
|
+
|
3561
3720
|
template<>
|
3562
3721
|
const char* EnumUtil::ToChars<ParserExtensionResultType>(ParserExtensionResultType value) {
|
3563
3722
|
switch(value) {
|