oleander-cli 0.25.0 → 0.25.1
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/dist/index.cjs +17 -8
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -45555,7 +45555,7 @@ function getHorizonCatalogBaseUrl(catalogUri) {
|
|
|
45555
45555
|
url.pathname = normalizedPath.endsWith(HORIZON_CATALOG_PATH) ? normalizedPath : HORIZON_CATALOG_PATH;
|
|
45556
45556
|
return url.toString().replace(/\/$/, "");
|
|
45557
45557
|
}
|
|
45558
|
-
function catalogAttachSql(catalog, credJson) {
|
|
45558
|
+
function catalogAttachSql(catalog, credJson, endpointOption = "URI") {
|
|
45559
45559
|
const secretName = `${catalog.name}_secret`;
|
|
45560
45560
|
if (catalog.type === "lakekeeper") {
|
|
45561
45561
|
return `
|
|
@@ -45566,7 +45566,7 @@ function catalogAttachSql(catalog, credJson) {
|
|
|
45566
45566
|
ATTACH '${catalog.properties.warehouse}' AS ${catalog.name} (
|
|
45567
45567
|
TYPE iceberg,
|
|
45568
45568
|
SECRET ${secretName},
|
|
45569
|
-
|
|
45569
|
+
${endpointOption} '${getIcebergEndpoint()}'
|
|
45570
45570
|
);
|
|
45571
45571
|
`;
|
|
45572
45572
|
}
|
|
@@ -45599,7 +45599,7 @@ function catalogAttachSql(catalog, credJson) {
|
|
|
45599
45599
|
ATTACH '${catalog.properties.database}' AS ${catalog.name} (
|
|
45600
45600
|
TYPE iceberg,
|
|
45601
45601
|
SECRET ${secretName},
|
|
45602
|
-
|
|
45602
|
+
${endpointOption} '${getHorizonCatalogBaseUrl(catalog.properties.catalogUri)}',
|
|
45603
45603
|
ACCESS_DELEGATION_MODE 'vended_credentials'
|
|
45604
45604
|
);
|
|
45605
45605
|
`;
|
|
@@ -45613,7 +45613,7 @@ function catalogAttachSql(catalog, credJson) {
|
|
|
45613
45613
|
ATTACH '' AS ${catalog.name} (
|
|
45614
45614
|
TYPE iceberg,
|
|
45615
45615
|
SECRET ${secretName},
|
|
45616
|
-
|
|
45616
|
+
${endpointOption} '${credJson.endpoint}',
|
|
45617
45617
|
ACCESS_DELEGATION_MODE 'vended_credentials',
|
|
45618
45618
|
DEFAULT_REGION '${credJson.region}',
|
|
45619
45619
|
READ_ONLY
|
|
@@ -45669,8 +45669,12 @@ async function duckdbTerminal(options) {
|
|
|
45669
45669
|
);
|
|
45670
45670
|
lineage = false;
|
|
45671
45671
|
}
|
|
45672
|
-
|
|
45672
|
+
const ownDuckdb = duckdb === "duckdb";
|
|
45673
|
+
let initSql = ".mode trash\n";
|
|
45674
|
+
if (!ownDuckdb) {
|
|
45675
|
+
initSql += `SET extension_directories = [${sqlString(extensionDirectory())}];
|
|
45673
45676
|
`;
|
|
45677
|
+
}
|
|
45674
45678
|
initSql += `
|
|
45675
45679
|
INSTALL httpfs; LOAD httpfs;
|
|
45676
45680
|
INSTALL iceberg; LOAD iceberg;
|
|
@@ -45698,7 +45702,11 @@ async function duckdbTerminal(options) {
|
|
|
45698
45702
|
continue;
|
|
45699
45703
|
}
|
|
45700
45704
|
const credJson = await credResp.json();
|
|
45701
|
-
const attachSql = catalogAttachSql(
|
|
45705
|
+
const attachSql = catalogAttachSql(
|
|
45706
|
+
catalog,
|
|
45707
|
+
credJson,
|
|
45708
|
+
ownDuckdb ? "ENDPOINT" : "URI"
|
|
45709
|
+
);
|
|
45702
45710
|
if (attachSql === null) {
|
|
45703
45711
|
skipped.push(
|
|
45704
45712
|
`Skipped catalog ${catalog.name}: unknown catalog type ${catalog.type}`
|
|
@@ -45716,9 +45724,10 @@ async function duckdbTerminal(options) {
|
|
|
45716
45724
|
if (lineage && target) {
|
|
45717
45725
|
initSql += lineageInitSql(target, attached);
|
|
45718
45726
|
}
|
|
45727
|
+
initSql += ".mode duckbox\n";
|
|
45719
45728
|
const tempDir = (0, import_fs5.mkdtempSync)((0, import_path5.join)((0, import_node_os4.tmpdir)(), "oleander-duckdb-init-"));
|
|
45720
45729
|
const initPath = (0, import_path5.join)(tempDir, "init.sql");
|
|
45721
|
-
(0, import_node_fs4.writeFileSync)(initPath, initSql
|
|
45730
|
+
(0, import_node_fs4.writeFileSync)(initPath, initSql, { encoding: "utf-8" });
|
|
45722
45731
|
spinner.succeed(
|
|
45723
45732
|
lineage ? `Starting DuckDB ${DUCKDB_VERSION} for oleander lake, reporting lineage.` : "Starting duckdb terminal for oleander lake."
|
|
45724
45733
|
);
|
|
@@ -45761,7 +45770,7 @@ var import_fs7 = require("fs");
|
|
|
45761
45770
|
// package.json
|
|
45762
45771
|
var package_default = {
|
|
45763
45772
|
name: "oleander-cli",
|
|
45764
|
-
version: "0.25.
|
|
45773
|
+
version: "0.25.1",
|
|
45765
45774
|
description: "oleander CLI",
|
|
45766
45775
|
keywords: [
|
|
45767
45776
|
"cli",
|