oleander-cli 0.25.0 → 0.25.2
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 +20 -22
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -43758,18 +43758,12 @@ function registerCatalogNamespaceCommands(namespaces) {
|
|
|
43758
43758
|
|
|
43759
43759
|
// src/commands/catalogs/list-format.ts
|
|
43760
43760
|
var TYPE_ORDER = ["lakekeeper", "s3tables", "horizon", "tableflow"];
|
|
43761
|
-
var TYPE_LABEL = {
|
|
43762
|
-
lakekeeper: "oleander-managed",
|
|
43763
|
-
s3tables: "Amazon S3 Tables",
|
|
43764
|
-
horizon: "Snowflake Horizon",
|
|
43765
|
-
tableflow: "Confluent Tableflow"
|
|
43766
|
-
};
|
|
43767
43761
|
var EMPTY_REGION = "\u2014";
|
|
43768
43762
|
function catalogsToResults(catalogs) {
|
|
43769
43763
|
const columns = ["catalog", "type", "region", "created"];
|
|
43770
43764
|
const rows = [...catalogs].sort(compareCatalogType).map((catalog) => [
|
|
43771
43765
|
catalog.name ?? null,
|
|
43772
|
-
|
|
43766
|
+
catalog.type ?? null,
|
|
43773
43767
|
propertyValue(catalog, "region"),
|
|
43774
43768
|
formatCreated(catalog.created_at)
|
|
43775
43769
|
]);
|
|
@@ -43798,10 +43792,6 @@ function compareCatalogType(left2, right2) {
|
|
|
43798
43792
|
if (rightIndex === -1) return -1;
|
|
43799
43793
|
return leftIndex - rightIndex;
|
|
43800
43794
|
}
|
|
43801
|
-
function catalogTypeLabel(type) {
|
|
43802
|
-
if (!type) return null;
|
|
43803
|
-
return TYPE_LABEL[type] ?? type;
|
|
43804
|
-
}
|
|
43805
43795
|
function formatCreated(value) {
|
|
43806
43796
|
if (!value) return null;
|
|
43807
43797
|
const match = /^(\d{4}-\d{2}-\d{2})/.exec(value);
|
|
@@ -43920,9 +43910,8 @@ var FIELDS_BY_TYPE = {
|
|
|
43920
43910
|
};
|
|
43921
43911
|
function catalogDetailFields(catalog) {
|
|
43922
43912
|
const fields = [];
|
|
43923
|
-
|
|
43924
|
-
|
|
43925
|
-
fields.push({ key: "type", label: "Type", value: type });
|
|
43913
|
+
if (catalog.type) {
|
|
43914
|
+
fields.push({ key: "type", label: "Type", value: catalog.type });
|
|
43926
43915
|
}
|
|
43927
43916
|
for (const field of FIELDS_BY_TYPE[catalog.type ?? ""] ?? []) {
|
|
43928
43917
|
const value = propertyValue2(catalog, field.key);
|
|
@@ -45555,7 +45544,7 @@ function getHorizonCatalogBaseUrl(catalogUri) {
|
|
|
45555
45544
|
url.pathname = normalizedPath.endsWith(HORIZON_CATALOG_PATH) ? normalizedPath : HORIZON_CATALOG_PATH;
|
|
45556
45545
|
return url.toString().replace(/\/$/, "");
|
|
45557
45546
|
}
|
|
45558
|
-
function catalogAttachSql(catalog, credJson) {
|
|
45547
|
+
function catalogAttachSql(catalog, credJson, endpointOption = "URI") {
|
|
45559
45548
|
const secretName = `${catalog.name}_secret`;
|
|
45560
45549
|
if (catalog.type === "lakekeeper") {
|
|
45561
45550
|
return `
|
|
@@ -45566,7 +45555,7 @@ function catalogAttachSql(catalog, credJson) {
|
|
|
45566
45555
|
ATTACH '${catalog.properties.warehouse}' AS ${catalog.name} (
|
|
45567
45556
|
TYPE iceberg,
|
|
45568
45557
|
SECRET ${secretName},
|
|
45569
|
-
|
|
45558
|
+
${endpointOption} '${getIcebergEndpoint()}'
|
|
45570
45559
|
);
|
|
45571
45560
|
`;
|
|
45572
45561
|
}
|
|
@@ -45599,7 +45588,7 @@ function catalogAttachSql(catalog, credJson) {
|
|
|
45599
45588
|
ATTACH '${catalog.properties.database}' AS ${catalog.name} (
|
|
45600
45589
|
TYPE iceberg,
|
|
45601
45590
|
SECRET ${secretName},
|
|
45602
|
-
|
|
45591
|
+
${endpointOption} '${getHorizonCatalogBaseUrl(catalog.properties.catalogUri)}',
|
|
45603
45592
|
ACCESS_DELEGATION_MODE 'vended_credentials'
|
|
45604
45593
|
);
|
|
45605
45594
|
`;
|
|
@@ -45613,7 +45602,7 @@ function catalogAttachSql(catalog, credJson) {
|
|
|
45613
45602
|
ATTACH '' AS ${catalog.name} (
|
|
45614
45603
|
TYPE iceberg,
|
|
45615
45604
|
SECRET ${secretName},
|
|
45616
|
-
|
|
45605
|
+
${endpointOption} '${credJson.endpoint}',
|
|
45617
45606
|
ACCESS_DELEGATION_MODE 'vended_credentials',
|
|
45618
45607
|
DEFAULT_REGION '${credJson.region}',
|
|
45619
45608
|
READ_ONLY
|
|
@@ -45669,8 +45658,12 @@ async function duckdbTerminal(options) {
|
|
|
45669
45658
|
);
|
|
45670
45659
|
lineage = false;
|
|
45671
45660
|
}
|
|
45672
|
-
|
|
45661
|
+
const ownDuckdb = duckdb === "duckdb";
|
|
45662
|
+
let initSql = ".mode trash\n";
|
|
45663
|
+
if (!ownDuckdb) {
|
|
45664
|
+
initSql += `SET extension_directories = [${sqlString(extensionDirectory())}];
|
|
45673
45665
|
`;
|
|
45666
|
+
}
|
|
45674
45667
|
initSql += `
|
|
45675
45668
|
INSTALL httpfs; LOAD httpfs;
|
|
45676
45669
|
INSTALL iceberg; LOAD iceberg;
|
|
@@ -45698,7 +45691,11 @@ async function duckdbTerminal(options) {
|
|
|
45698
45691
|
continue;
|
|
45699
45692
|
}
|
|
45700
45693
|
const credJson = await credResp.json();
|
|
45701
|
-
const attachSql = catalogAttachSql(
|
|
45694
|
+
const attachSql = catalogAttachSql(
|
|
45695
|
+
catalog,
|
|
45696
|
+
credJson,
|
|
45697
|
+
ownDuckdb ? "ENDPOINT" : "URI"
|
|
45698
|
+
);
|
|
45702
45699
|
if (attachSql === null) {
|
|
45703
45700
|
skipped.push(
|
|
45704
45701
|
`Skipped catalog ${catalog.name}: unknown catalog type ${catalog.type}`
|
|
@@ -45716,9 +45713,10 @@ async function duckdbTerminal(options) {
|
|
|
45716
45713
|
if (lineage && target) {
|
|
45717
45714
|
initSql += lineageInitSql(target, attached);
|
|
45718
45715
|
}
|
|
45716
|
+
initSql += ".mode duckbox\n";
|
|
45719
45717
|
const tempDir = (0, import_fs5.mkdtempSync)((0, import_path5.join)((0, import_node_os4.tmpdir)(), "oleander-duckdb-init-"));
|
|
45720
45718
|
const initPath = (0, import_path5.join)(tempDir, "init.sql");
|
|
45721
|
-
(0, import_node_fs4.writeFileSync)(initPath, initSql
|
|
45719
|
+
(0, import_node_fs4.writeFileSync)(initPath, initSql, { encoding: "utf-8" });
|
|
45722
45720
|
spinner.succeed(
|
|
45723
45721
|
lineage ? `Starting DuckDB ${DUCKDB_VERSION} for oleander lake, reporting lineage.` : "Starting duckdb terminal for oleander lake."
|
|
45724
45722
|
);
|
|
@@ -45761,7 +45759,7 @@ var import_fs7 = require("fs");
|
|
|
45761
45759
|
// package.json
|
|
45762
45760
|
var package_default = {
|
|
45763
45761
|
name: "oleander-cli",
|
|
45764
|
-
version: "0.25.
|
|
45762
|
+
version: "0.25.2",
|
|
45765
45763
|
description: "oleander CLI",
|
|
45766
45764
|
keywords: [
|
|
45767
45765
|
"cli",
|