diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b84bd3..96b52e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # DuckDB Connector Changelog This changelog documents changes between release tags. +## [0.0.11] - 2024-04-17 +* Update generate-config to use the proper configuration directory + ## [0.0.10] - 2024-04-17 * Update SDK to 4.5.0 * Update packaging to use a Dockerized Command diff --git a/connector-definition/connector-metadata.yaml b/connector-definition/connector-metadata.yaml index 9fa7621..77657e9 100644 --- a/connector-definition/connector-metadata.yaml +++ b/connector-definition/connector-metadata.yaml @@ -1,13 +1,13 @@ packagingDefinition: type: PrebuiltDockerImage - dockerImage: ghcr.io/hasura/ndc-duckdb:v0.0.10 + dockerImage: ghcr.io/hasura/ndc-duckdb:v0.0.11 supportedEnvironmentVariables: - name: DUCKDB_URL description: The url for the DuckDB database commands: update: type: Dockerized - dockerImage: ghcr.io/hasura/ndc-duckdb:v0.0.10 + dockerImage: ghcr.io/hasura/ndc-duckdb:v0.0.11 commandArgs: - update dockerComposeWatch: diff --git a/generate-config.ts b/generate-config.ts index 55c22ab..5b4b3ac 100644 --- a/generate-config.ts +++ b/generate-config.ts @@ -5,8 +5,11 @@ import * as fs from 'fs'; import { promisify } from "util"; const writeFile = promisify(fs.writeFile); const readFile = promisify(fs.readFile); +let HASURA_CONFIGURATION_DIRECTORY = process.env["HASURA_CONFIGURATION_DIRECTORY"] as string | undefined; +if (HASURA_CONFIGURATION_DIRECTORY === undefined || HASURA_CONFIGURATION_DIRECTORY.length === 0){ + HASURA_CONFIGURATION_DIRECTORY = "."; +} const DUCKDB_URL = process.env["DUCKDB_URL"] as string; -const HASURA_PLUGIN_CONNECTOR_CONTEXT_PATH = process.env["HASURA_PLUGIN_CONNECTOR_CONTEXT_PATH"] as string | undefined; const db = new duckdb.Database(DUCKDB_URL); const con = db.connect(); @@ -110,10 +113,7 @@ async function main() { } }; const jsonString = JSON.stringify(res, null, 4); - let filePath = `${HASURA_PLUGIN_CONNECTOR_CONTEXT_PATH}/config.json`; - if (HASURA_PLUGIN_CONNECTOR_CONTEXT_PATH === undefined || HASURA_PLUGIN_CONNECTOR_CONTEXT_PATH.length === 0){ - filePath = "config.json"; - } + let filePath = `${HASURA_CONFIGURATION_DIRECTORY}/config.json`; try { const existingData = await readFile(filePath, 'utf8'); if (existingData !== jsonString) { diff --git a/package-lock.json b/package-lock.json index 826bbc8..2bf6f39 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "duckdb-sdk", - "version": "0.0.10", + "version": "0.0.11", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "duckdb-sdk", - "version": "0.0.10", + "version": "0.0.11", "dependencies": { "@hasura/ndc-sdk-typescript": "^4.5.0", "duckdb": "^0.9.2", diff --git a/package.json b/package.json index 8b1db83..3667dae 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "name": "duckdb-sdk", - "version": "0.0.10", + "version": "0.0.11", "description": "", "main": "index.js", "scripts": { - "start": "DUCKDB_URL=md:?motherduck_token=ey ts-node ./src/index.ts serve --configuration=", - "generate-config": "DUCKDB_URL=md:?motherduck_token=ey ts-node generate-config" + "start": "ts-node ./src/index.ts serve --configuration=", + "generate-config": "ts-node generate-config" }, "devDependencies": { "ts-node": "^10.9.1",