duckdb 0.5.2-dev650.0 → 0.5.2-dev656.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.5.2-dev650.0",
4
+ "version": "0.5.2-dev656.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -66815,6 +66815,8 @@ public:
66815
66815
  DUCKDB_API void Bind(vector<Value> values);
66816
66816
  //! Get the expected SQL Type of the bound parameter
66817
66817
  DUCKDB_API LogicalType GetType(idx_t param_index);
66818
+ //! Try to get the expected SQL Type of the bound parameter
66819
+ DUCKDB_API bool TryGetType(idx_t param_idx, LogicalType &result);
66818
66820
  };
66819
66821
 
66820
66822
  } // namespace duckdb
@@ -77451,6 +77453,9 @@ bool BufferedCSVReader::AddRow(DataChunk &insert_chunk, idx_t &column) {
77451
77453
  if (row_empty) {
77452
77454
  row_empty = false;
77453
77455
  if (sql_types.size() != 1) {
77456
+ if (mode == ParserMode::PARSING) {
77457
+ FlatVector::SetNull(parse_chunk.data[0], parse_chunk.size(), false);
77458
+ }
77454
77459
  column = 0;
77455
77460
  return false;
77456
77461
  }
@@ -126192,6 +126197,7 @@ using duckdb::Connection;
126192
126197
  using duckdb::date_t;
126193
126198
  using duckdb::dtime_t;
126194
126199
  using duckdb::hugeint_t;
126200
+ using duckdb::LogicalType;
126195
126201
  using duckdb::MaterializedQueryResult;
126196
126202
  using duckdb::PreparedStatementWrapper;
126197
126203
  using duckdb::QueryResultType;
@@ -126231,11 +126237,11 @@ duckdb_type duckdb_param_type(duckdb_prepared_statement prepared_statement, idx_
126231
126237
  if (!wrapper || !wrapper->statement || wrapper->statement->HasError()) {
126232
126238
  return DUCKDB_TYPE_INVALID;
126233
126239
  }
126234
- auto entry = wrapper->statement->data->value_map.find(param_idx);
126235
- if (entry == wrapper->statement->data->value_map.end()) {
126240
+ LogicalType param_type;
126241
+ if (!wrapper->statement->data->TryGetType(param_idx, param_type)) {
126236
126242
  return DUCKDB_TYPE_INVALID;
126237
126243
  }
126238
- return ConvertCPPTypeToC(entry->second->return_type);
126244
+ return ConvertCPPTypeToC(param_type);
126239
126245
  }
126240
126246
 
126241
126247
  duckdb_state duckdb_clear_bindings(duckdb_prepared_statement prepared_statement) {
@@ -140402,12 +140408,25 @@ void PreparedStatementData::Bind(vector<Value> values) {
140402
140408
  }
140403
140409
  }
140404
140410
 
140405
- LogicalType PreparedStatementData::GetType(idx_t param_idx) {
140411
+ bool PreparedStatementData::TryGetType(idx_t param_idx, LogicalType &result) {
140406
140412
  auto it = value_map.find(param_idx);
140407
140413
  if (it == value_map.end()) {
140414
+ return false;
140415
+ }
140416
+ if (it->second->return_type.id() != LogicalTypeId::INVALID) {
140417
+ result = it->second->return_type;
140418
+ } else {
140419
+ result = it->second->value.type();
140420
+ }
140421
+ return true;
140422
+ }
140423
+
140424
+ LogicalType PreparedStatementData::GetType(idx_t param_idx) {
140425
+ LogicalType result;
140426
+ if (!TryGetType(param_idx, result)) {
140408
140427
  throw BinderException("Could not find parameter with index %llu", param_idx);
140409
140428
  }
140410
- return it->second->return_type;
140429
+ return result;
140411
140430
  }
140412
140431
 
140413
140432
  } // namespace duckdb
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 "9b1e6ec64"
15
- #define DUCKDB_VERSION "v0.5.2-dev650"
14
+ #define DUCKDB_SOURCE_ID "673868e0d"
15
+ #define DUCKDB_VERSION "v0.5.2-dev656"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //