Skip to content

Commit

Permalink
Merge pull request #96 from deepcrawl/upgrade
Browse files Browse the repository at this point in the history
feat: bleeding edge upgrade
  • Loading branch information
rprovodenko authored May 20, 2021
2 parents 28dd953 + 19f9934 commit 304e62e
Show file tree
Hide file tree
Showing 11 changed files with 1,310 additions and 86 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
run: |
yarn install --frozen-lockfile
yarn lint:check
yarn audit
yarn test
env:
NODE_AUTH_TOKEN: ${{secrets.GIT_REGISTRY_TOKEN}}
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [0.0.68](https://github.com/deepcrawl/node-duckdb/compare/v0.0.67...v0.0.68) (2021-05-19)

### [0.0.67](https://github.com/deepcrawl/node-duckdb/compare/v0.0.66...v0.0.67) (2021-04-07)


Expand Down
5 changes: 0 additions & 5 deletions addon/duckdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ Napi::Object DuckDB::Init(Napi::Env env, Napi::Object exports) {
InstanceAccessor<&DuckDB::GetCollation>("collation"),
InstanceAccessor<&DuckDB::GetDefaultOrderType>("defaultOrderType"),
InstanceAccessor<&DuckDB::GetDefaultNullOrder>("defaultNullOrder"),
InstanceAccessor<&DuckDB::GetEnableCopy>("enableCopy"),
});
constructor = Napi::Persistent(func);
constructor.SuppressDestruct();
Expand Down Expand Up @@ -127,8 +126,4 @@ Napi::Value DuckDB::GetDefaultNullOrder(const Napi::CallbackInfo &info) {
return Napi::Number::New(
env, static_cast<double>(database->instance->config.default_null_order));
}
Napi::Value DuckDB::GetEnableCopy(const Napi::CallbackInfo &info) {
Napi::Env env = info.Env();
return Napi::Boolean::New(env, database->instance->config.enable_copy);
}
} // namespace NodeDuckDB
1 change: 0 additions & 1 deletion addon/duckdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class DuckDB : public Napi::ObjectWrap<DuckDB> {
Napi::Value GetCollation(const Napi::CallbackInfo &info);
Napi::Value GetDefaultOrderType(const Napi::CallbackInfo &info);
Napi::Value GetDefaultNullOrder(const Napi::CallbackInfo &info);
Napi::Value GetEnableCopy(const Napi::CallbackInfo &info);
};
} // namespace NodeDuckDB

Expand Down
4 changes: 0 additions & 4 deletions addon/type-converters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,4 @@ void NodeDuckDB::TypeConverters::setDBConfig(const Napi::Env &env,
static_cast<int>(duckdb::OrderByNullType::INVALID),
static_cast<int>(duckdb::OrderByNullType::NULLS_LAST)));
}

if (!optionsObject.Get("enableCopy").IsUndefined()) {
nativeConfig.enable_copy = convertBoolean(env, optionsObject, "enableCopy");
}
}
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-duckdb",
"version": "0.0.67",
"version": "0.0.69",
"private": false,
"description": "DuckDB for Node.JS",
"keywords": [
Expand Down Expand Up @@ -31,6 +31,7 @@
]
},
"scripts": {
"audit:fix": "yarn-audit-fix",
"build": "yarn build:duckdb && yarn build:addon && yarn build:ts",
"build:addon": "rimraf build && cmake-js compile --CDnapi_build_version=6",
"build:duckdb": "cd duckdb && make && cd -",
Expand All @@ -39,11 +40,10 @@
"clang:check": "yarn clang-format --dry-run --Werror addon/**",
"clang:fix": "yarn clang-format -i addon/**",
"cleanup:binaries": "rm -rf build prebuilds duckdb",
"download-duckdb": "rm -rf duckdb && curl -L https://github.com/cwida/duckdb/archive/d5030f666e4685a1df0bb76cb4073bec828dd8fa.tar.gz > duckdb.tar.gz && tar xf duckdb.tar.gz && mv duckdb-d5030f666e4685a1df0bb76cb4073bec828dd8fa duckdb && rm duckdb.tar.gz",
"download-duckdb": "rm -rf duckdb && curl -L https://github.com/cwida/duckdb/archive/7c1a2f2867dfe5b02717e7bd7cf7ed46fbe08a34.tar.gz > duckdb.tar.gz && tar xf duckdb.tar.gz && mv duckdb-7c1a2f2867dfe5b02717e7bd7cf7ed46fbe08a34 duckdb && rm duckdb.tar.gz",
"eslint:check": "eslint --ext .js,.json,.ts ./",
"eslint:fix": "eslint --fix --ext .js,.json,.ts ./",
"generate-doc": "yarn build:ts && rm -rf temp etc && mkdir etc && yarn api-extractor run --local --verbose && yarn api-documenter markdown -i temp -o docs/api && ./docs/replace.sh",
"preinstall": "yarn audit",
"install": "prebuild-install --verbose -d -r napi || (yarn download-duckdb && yarn build:duckdb && yarn prebuild:current-target)",
"lint:check": "yarn prettier:check && yarn eslint:check && yarn clang:check",
"lint:fix": "yarn prettier:fix && yarn eslint:fix && yarn clang:fix",
Expand Down Expand Up @@ -98,7 +98,8 @@
"rimraf": "^3.0.2",
"standard-version": "^9.1.1",
"ttypescript": "^1.5.12",
"typescript": "^4.0.3"
"typescript": "^4.0.3",
"yarn-audit-fix": "^5.0.0"
},
"engines": {
"node": ">= 12.17.0"
Expand Down
1 change: 0 additions & 1 deletion src/addon-bindings/duckdb-binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export declare class DuckDBClass {
public collation: string;
public defaultOrderType: OrderType;
public defaultNullOrder: OrderByNullType;
public enableCopy: boolean;
}

export const DuckDBBinding: typeof DuckDBClass = DuckDB;
4 changes: 0 additions & 4 deletions src/addon-types/duckdb-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ export interface IDuckDBOptionsConfig {
* Default order for Null values
*/
defaultNullOrder?: OrderByNullType;
/**
* Enable Copy
*/
enableCopy?: boolean;
}
/**
* Configuration object for DuckDB
Expand Down
7 changes: 0 additions & 7 deletions src/addon/duckdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,4 @@ export class DuckDB {
public get defaultNullOrder(): OrderByNullType {
return this.duckdb.defaultNullOrder;
}
/**
* Returns true of copying is enabled, false otherwise.
* @public
*/
public get enableCopy(): boolean {
return this.duckdb.enableCopy;
}
}
10 changes: 0 additions & 10 deletions src/tests/duckdb-config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,6 @@ describe("DuckDB configuration", () => {
);
});

it("allows to specify enable copy", () => {
const db = new DuckDB({ options: { enableCopy: false } });
expect(db.enableCopy).toBe(false);
db.close();
});

it("does not allow to specify invalid enableCopy", () => {
expect(() => new DuckDB(<any>{ options: { enableCopy: 10 } })).toThrow("Invalid enableCopy: must be a boolean");
});

it("returns package version", async () => {
const version = await DuckDB.getBindingsVersion();
expect(version).toMatch(/\d+\.\d+\.\d+/);
Expand Down
Loading

0 comments on commit 304e62e

Please sign in to comment.