@cargo-ai/cli 1.0.14 → 1.0.15

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.
@@ -1 +1 @@
1
- {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/commands/storage/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CA2BN"}
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/commands/storage/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CA4DN"}
@@ -20,4 +20,27 @@ Examples:
20
20
  const result = await handleApiCall(() => api.storage.query.execute({ query: sql }));
21
21
  outputJson(result);
22
22
  });
23
+ query
24
+ .command("download")
25
+ .description("Download the result of a SQL query against storage models as files")
26
+ .requiredOption("--query <sql>", "SQL query string")
27
+ .option("--format <format>", "Download format (csv or parquet)", "csv")
28
+ .addHelpText("after", `
29
+ Tables must be referenced as [datasetSlug].[modelSlug] and are rewritten
30
+ to the underlying warehouse table under the hood. Returns signed URLs to
31
+ download the resulting files.
32
+
33
+ Examples:
34
+ $ cargo-ai storage query download --query "SELECT * FROM my_dataset.my_model"
35
+ $ cargo-ai storage query download --query "SELECT * FROM sales.accounts" --format parquet`)
36
+ .action(async (opts) => {
37
+ const api = getApi();
38
+ const format = opts.format === "parquet"
39
+ ? "parquet"
40
+ : opts.format === "csv"
41
+ ? "csv"
42
+ : undefined;
43
+ const result = await handleApiCall(() => api.storage.query.download({ query: opts.query, format }));
44
+ outputJson(result);
45
+ });
23
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cargo-ai/cli",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "private": false,
5
5
  "description": "Command-line interface for the Cargo API",
6
6
  "engines": {
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "commander": "^12.1.0",
32
- "@cargo-ai/api": "^1.0.22"
32
+ "@cargo-ai/api": "^1.0.23"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@cargo-ai/eslint-config": "*",