duckdb 0.2.10-dev506.0 → 0.3.1-dev5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "duckdb",
3
3
  "main": "./lib/duckdb.js",
4
- "version": "0.2.10-dev506.0",
4
+ "version": "0.3.1-dev5.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -4648,7 +4648,7 @@ namespace duckdb {
4648
4648
  string SimilarCatalogEntry::GetQualifiedName() const {
4649
4649
  D_ASSERT(Found());
4650
4650
 
4651
- return name + "." + schema->name;
4651
+ return schema->name + "." + name;
4652
4652
  }
4653
4653
 
4654
4654
  Catalog::Catalog(DatabaseInstance &db)
@@ -89795,6 +89795,7 @@ void StructPackFun::RegisterFunction(BuiltinFunctions &set) {
89795
89795
 
89796
89796
 
89797
89797
 
89798
+
89798
89799
  namespace duckdb {
89799
89800
 
89800
89801
  // current_query
@@ -89807,6 +89808,11 @@ struct SystemBindData : public FunctionData {
89807
89808
  unique_ptr<FunctionData> Copy() override {
89808
89809
  return make_unique<SystemBindData>(context);
89809
89810
  }
89811
+
89812
+ static SystemBindData &GetFrom(ExpressionState &state) {
89813
+ auto &func_expr = (BoundFunctionExpression &)state.expr;
89814
+ return (SystemBindData &)*func_expr.bind_info;
89815
+ }
89810
89816
  };
89811
89817
 
89812
89818
  unique_ptr<FunctionData> BindSystemFunction(ClientContext &context, ScalarFunction &bound_function,
@@ -89815,8 +89821,7 @@ unique_ptr<FunctionData> BindSystemFunction(ClientContext &context, ScalarFuncti
89815
89821
  }
89816
89822
 
89817
89823
  static void CurrentQueryFunction(DataChunk &input, ExpressionState &state, Vector &result) {
89818
- auto &func_expr = (BoundFunctionExpression &)state.expr;
89819
- auto &info = (SystemBindData &)*func_expr.bind_info;
89824
+ auto &info = SystemBindData::GetFrom(state);
89820
89825
 
89821
89826
  Value val(info.context.query);
89822
89827
  result.Reference(val);
@@ -89824,13 +89829,16 @@ static void CurrentQueryFunction(DataChunk &input, ExpressionState &state, Vecto
89824
89829
 
89825
89830
  // current_schema
89826
89831
  static void CurrentSchemaFunction(DataChunk &input, ExpressionState &state, Vector &result) {
89827
- Value val(DEFAULT_SCHEMA);
89832
+ Value val(SystemBindData::GetFrom(state).context.catalog_search_path->GetDefault());
89828
89833
  result.Reference(val);
89829
89834
  }
89830
89835
 
89831
89836
  // current_schemas
89832
89837
  static void CurrentSchemasFunction(DataChunk &input, ExpressionState &state, Vector &result) {
89833
- vector<Value> schema_list = {Value(DEFAULT_SCHEMA)};
89838
+ vector<Value> schema_list;
89839
+ vector<string> search_path = SystemBindData::GetFrom(state).context.catalog_search_path->Get();
89840
+ std::transform(search_path.begin(), search_path.end(), std::back_inserter(schema_list),
89841
+ [](const string &s) -> Value { return Value(s); });
89834
89842
  auto val = Value::LIST(schema_list);
89835
89843
  result.Reference(val);
89836
89844
  }
@@ -89856,9 +89864,10 @@ void SystemFun::RegisterFunction(BuiltinFunctions &set) {
89856
89864
 
89857
89865
  set.AddFunction(
89858
89866
  ScalarFunction("current_query", {}, LogicalType::VARCHAR, CurrentQueryFunction, false, BindSystemFunction));
89859
- set.AddFunction(ScalarFunction("current_schema", {}, LogicalType::VARCHAR, CurrentSchemaFunction));
89860
89867
  set.AddFunction(
89861
- ScalarFunction("current_schemas", {LogicalType::BOOLEAN}, varchar_list_type, CurrentSchemasFunction));
89868
+ ScalarFunction("current_schema", {}, LogicalType::VARCHAR, CurrentSchemaFunction, false, BindSystemFunction));
89869
+ set.AddFunction(ScalarFunction("current_schemas", {LogicalType::BOOLEAN}, varchar_list_type, CurrentSchemasFunction,
89870
+ false, BindSystemFunction));
89862
89871
  set.AddFunction(
89863
89872
  ScalarFunction("txid_current", {}, LogicalType::BIGINT, TransactionIdCurrent, false, BindSystemFunction));
89864
89873
  set.AddFunction(ScalarFunction("version", {}, LogicalType::VARCHAR, VersionFunction));
package/src/duckdb.hpp CHANGED
@@ -10,8 +10,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
10
10
 
11
11
  #pragma once
12
12
  #define DUCKDB_AMALGAMATION 1
13
- #define DUCKDB_SOURCE_ID "38b90beee"
14
- #define DUCKDB_VERSION "0.2.10-dev506"
13
+ #define DUCKDB_SOURCE_ID "e4f32c8fc"
14
+ #define DUCKDB_VERSION "0.3.1-dev5"
15
15
  //===----------------------------------------------------------------------===//
16
16
  // DuckDB
17
17
  //