duckdb 0.3.2-dev68.0 → 0.3.2-dev683.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/src/statement.cpp CHANGED
@@ -171,6 +171,9 @@ static Napi::Value convert_chunk(Napi::Env &env, std::vector<std::string> names,
171
171
  case duckdb::LogicalTypeId::VARCHAR: {
172
172
  value = Napi::String::New(env, dval.str_value);
173
173
  } break;
174
+ case duckdb::LogicalTypeId::BOOLEAN: {
175
+ value = Napi::Boolean::New(env, dval.value_.boolean);
176
+ } break;
174
177
  case duckdb::LogicalTypeId::BLOB: {
175
178
  value = Napi::Buffer<char>::Copy(env, dval.str_value.c_str(), dval.str_value.length());
176
179
  } break;
@@ -0,0 +1,23 @@
1
+ var sqlite3 = require("..");
2
+ var assert = require("assert");
3
+
4
+ describe("data type support", function () {
5
+ let db;
6
+ before(function (done) {
7
+ db = new sqlite3.Database(":memory:", done);
8
+ });
9
+
10
+ it("supports BOOLEAN values", function (done) {
11
+ db.run("CREATE TABLE boolean_table (i BOOLEAN)");
12
+ const stmt = db.prepare("INSERT INTO boolean_table VALUES (?)");
13
+ const values = [true, false];
14
+ values.forEach((bool) => {
15
+ stmt.run(bool);
16
+ });
17
+ db.prepare("SELECT i from boolean_table;").all((err, res) => {
18
+ assert(err === null);
19
+ assert(res.every((v, i) => v.i === values[i]));
20
+ done();
21
+ });
22
+ });
23
+ });