Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ curl -fsSL "https://raw.githubusercontent.com/tollbit/cli/main/scripts/install.s
Pin a version or choose an install directory:

```bash
curl -fsSL "https://raw.githubusercontent.com/tollbit/cli/main/scripts/install.sh" | bash -s -- --version v0.3.4
curl -fsSL "https://raw.githubusercontent.com/tollbit/cli/main/scripts/install.sh" | bash -s -- --version v0.3.5
curl -fsSL "https://raw.githubusercontent.com/tollbit/cli/main/scripts/install.sh" | bash -s -- --install-dir "$HOME/bin" --force
```

Expand All @@ -37,7 +37,7 @@ Pin a version or skip `PATH` changes (useful in CI):

```powershell
irm "https://raw.githubusercontent.com/tollbit/cli/main/scripts/install.ps1" | iex
Install-Tollbit -Version v0.3.4 -Force
Install-Tollbit -Version v0.3.5 -Force
Install-Tollbit -NoModifyPath -PrintPathInstructions
```

Expand Down Expand Up @@ -167,7 +167,7 @@ Installer channel updates:
curl -fsSL "https://raw.githubusercontent.com/tollbit/cli/main/scripts/install.sh" | bash

# Pinned
curl -fsSL "https://raw.githubusercontent.com/tollbit/cli/main/scripts/install.sh" | bash -s -- --version v0.3.4 --force
curl -fsSL "https://raw.githubusercontent.com/tollbit/cli/main/scripts/install.sh" | bash -s -- --version v0.3.5 --force
```

```powershell
Expand Down
3 changes: 2 additions & 1 deletion internal/cli/analytics.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ automatically when needed).`

const analyticsQueryLongHelp = `Execute a read-only SQL query against TollBit analytics.

Queries use BigQuery Standard SQL. Only a single SELECT statement is accepted;
Queries use standard SQL (SQL:2011) as reported by "analytics schema" in its
"dialect" field. Only a single SELECT statement is accepted;
SHOW, DESCRIBE, and data-modifying statements are rejected by the server.
Use "analytics schema" to list the tables and columns you can query.

Expand Down
6 changes: 3 additions & 3 deletions internal/cli/analytics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func TestAnalyticsSchemaUsesOBOAgentTokenAndWritesJSON(t *testing.T) {
if r.Header.Get("Authorization") != "Bearer "+token {
t.Fatal("unexpected authorization header")
}
_, _ = w.Write([]byte(`{"dialect":"bigquery","tables":[{"name":"agent_logs_by_page","clustering":["host","user_agent","path"],"columns":[{"name":"host","type":"STRING"}]}],"limits":{"max_rows":{"value":10000,"unit":"rows"}}}`))
_, _ = w.Write([]byte(`{"dialect":"standard_sql","tables":[{"name":"agent_logs_by_page","clustering":["host","user_agent","path"],"columns":[{"name":"host","type":"STRING"}]}],"limits":{"max_rows":{"value":10000,"unit":"rows"}}}`))
}))
defer analyticsSrv.Close()

Expand Down Expand Up @@ -211,7 +211,7 @@ func TestAnalyticsSchemaUsesOBOAgentTokenAndWritesJSON(t *testing.T) {
if err := json.Unmarshal(stdout.Bytes(), &output); err != nil {
t.Fatalf("invalid JSON output %q: %v", stdout.String(), err)
}
if output.Dialect != "bigquery" || len(output.Tables) != 1 || output.Tables[0].Name != "agent_logs_by_page" {
if output.Dialect != "standard_sql" || len(output.Tables) != 1 || output.Tables[0].Name != "agent_logs_by_page" {
t.Fatalf("unexpected schema: %#v", output)
}
if len(output.Tables[0].Clustering) != 3 || len(output.Tables[0].Columns) != 1 || output.Tables[0].Columns[0].Name != "host" {
Expand Down Expand Up @@ -304,7 +304,7 @@ func TestAnalyticsHelpDocumentsQueryContract(t *testing.T) {
want []string
}{
{[]string{"analytics", "--help"}, []string{"analytics schema", "analytics query"}},
{[]string{"analytics", "query", "--help"}, []string{"BigQuery Standard SQL", "single SELECT", "timestamp", "user_agent_aggregate", "Examples:", "meta"}},
{[]string{"analytics", "query", "--help"}, []string{"standard SQL", "single SELECT", "timestamp", "user_agent_aggregate", "Examples:", "meta"}},
{[]string{"analytics", "schema", "--help"}, []string{"JSON object", "limits", "clustering", "analytics query"}},
} {
var stdout, stderr bytes.Buffer
Expand Down
4 changes: 2 additions & 2 deletions internal/client/analytics/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func TestSchema(t *testing.T) {
t.Fatal("unexpected authorization header")
}
_, _ = w.Write([]byte(`{
"dialect": "bigquery",
"dialect": "standard_sql",
"tables": [{"name": "agent_logs_by_page", "description": "Daily counts.", "clustering": ["host", "user_agent", "path"],
"columns": [{"name": "host", "type": "STRING", "description": "Site hostname."},
{"name": "type", "type": "STRING", "values": ["REQUEST", "ROBOT"]}]}],
Expand All @@ -106,7 +106,7 @@ func TestSchema(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if schema.Dialect != "bigquery" {
if schema.Dialect != "standard_sql" {
t.Fatalf("unexpected dialect: %q", schema.Dialect)
}
if len(schema.Tables) != 1 || schema.Tables[0].Name != "agent_logs_by_page" || schema.Tables[0].Description != "Daily counts." {
Expand Down
2 changes: 1 addition & 1 deletion internal/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// Bump this when shipping; keep skill frontmatter `version` in sync (tests enforce it).
package version

const Version = "0.3.4"
const Version = "0.3.5"
2 changes: 1 addition & 1 deletion skill/tollbit-cli/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: tollbit-cli
version: 0.3.4
version: 0.3.5
description: Search for news and articles and ground answers in licensed publisher content on the TollBit network. Use whenever the user wants to find news, articles, reporting, or sources on a topic or current event — searches the catalog, then prices and fetches full article content (paid) with the tollbit CLI.
---

Expand Down