duckdb 0.3.5-dev1357.0 → 0.3.5-dev1360.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.3.5-dev1357.0",
4
+ "version": "0.3.5-dev1360.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -156969,7 +156969,28 @@ unique_ptr<Constraint> Transformer::TransformConstraint(duckdb_libpgquery::PGLis
156969
156969
  "dictionary, pfor, bitpacking or fsst");
156970
156970
  }
156971
156971
  return nullptr;
156972
- case duckdb_libpgquery::PG_CONSTR_FOREIGN:
156972
+ case duckdb_libpgquery::PG_CONSTR_FOREIGN: {
156973
+ ForeignKeyInfo fk_info;
156974
+ fk_info.type = ForeignKeyType::FK_TYPE_FOREIGN_KEY_TABLE;
156975
+ if (constraint->pktable->schemaname) {
156976
+ fk_info.schema = constraint->pktable->schemaname;
156977
+ } else {
156978
+ fk_info.schema = "";
156979
+ }
156980
+ fk_info.table = constraint->pktable->relname;
156981
+ vector<string> pk_columns, fk_columns;
156982
+
156983
+ fk_columns.emplace_back(column.Name().c_str());
156984
+ if (constraint->pk_attrs) {
156985
+ for (auto kc = constraint->pk_attrs->head; kc; kc = kc->next) {
156986
+ pk_columns.emplace_back(reinterpret_cast<duckdb_libpgquery::PGValue *>(kc->data.ptr_value)->val.str);
156987
+ }
156988
+ }
156989
+ if (pk_columns.size() != fk_columns.size()) {
156990
+ throw ParserException("The number of referencing and referenced columns for foreign keys must be the same");
156991
+ }
156992
+ return make_unique<ForeignKeyConstraint>(pk_columns, fk_columns, move(fk_info));
156993
+ }
156973
156994
  default:
156974
156995
  throw NotImplementedException("Constraint not implemented!");
156975
156996
  }
@@ -160280,6 +160301,11 @@ unique_ptr<CreateStatement> Transformer::TransformCreateTable(duckdb_libpgquery:
160280
160301
  throw NotImplementedException("ColumnDef type not handled yet");
160281
160302
  }
160282
160303
  }
160304
+
160305
+ if (!column_count) {
160306
+ throw ParserException("Table must have at least one column!");
160307
+ }
160308
+
160283
160309
  result->info = move(info);
160284
160310
  return result;
160285
160311
  }
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 "d48e5c34d"
15
- #define DUCKDB_VERSION "v0.3.5-dev1357"
14
+ #define DUCKDB_SOURCE_ID "dc74756a0"
15
+ #define DUCKDB_VERSION "v0.3.5-dev1360"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //