docs: point HTTP examples at the multitenant gateway - #148
Conversation
The HTTPS server moved off the per-node address onto the multitenant gateway at <project-id>.<hosted-zone>.gateway.sqlite.cloud. The dashboard (Weblite, Edge Functions) already points there; the docs did not. - rewrite all 26 REST/HTTP endpoint URLs onto the gateway host - replace the Weblite curl Authorization headers: the bearer is now the plain API key instead of a sqlitecloud:// connection string - add a Base URL section to the Weblite page - fix a broken host in the AI search example (myproject.cloud) and the vague <your-project-url> placeholder in the access tokens page - add the missing <hosted-zone> segment to sqlitecloud:// connection strings, and normalize the filler host names (myproject, myhost, xxx, host, mynode) to a single myproject.myzone.sqlite.cloud Connection strings keep pointing at the node on port 8860; only the HTTPS endpoints move to the gateway. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01259fQ5Dg5Ax68zHLrje6QA
…example
The Weblite POST /v2/weblite/{database} endpoint takes a JSON body with a
`location` URL and fetches the file itself; it does not accept a file in the
request body. Verified against the gateway OpenAPI spec and a live request.
…xamples
POST and PATCH /v2/weblite/{database} take a JSON body with a `location`
URL; they do not accept an octet-stream file body. Verified against the
gateway OpenAPI spec and a live request.
POST /v2/weblite/{database} with no body returns 422 ("Missing database
name or location parameter"); the REST API cannot create an empty database.
Point readers to the Dashboard and CREATE DATABASE instead.
There was a problem hiding this comment.
While verifying the upload examples in this PR against the staging gateway, I found that the endpoint returns success even when the location URL cannot be fetched, and silently creates an empty database.
Reproducer:
curl -X 'POST' 'https://<project>.<zone>.staging-gateway.sqlite.cloud/v2/weblite/local-test.sqlite' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-d '{"location": "file:///Users/me/Downloads/some.sqlite"}'
Response:
{"metadata":{"connectedMs":132,"executedMs":3,"elapsedMs":135}}
The database is created but is empty so:
- can we provide a local file to be uploaded?
- should POST
/v2/weblite/{database}fail when it cannot fetch location?
Replace the non-existent Files group with Tokens, Memory and MCP, which the gateway actually exposes, and fix the 'executing SQLiteCloudArrayType' wording in both places it appeared.
There was a problem hiding this comment.
Added these fixes:
3a33dae Closes the unterminated quote on the POST /v2/weblite/sql URL, which made the example fail to parse in bash.
5a78e8a Adds the missing line continuation after the Authorization header in six Weblite examples, so the request body is actually sent.
3fecc39 Fixes $<encoded_query> to $encoded_query in the GET example so the URL-encoded SQL reaches the query string.
7119e6d Rewrites the create-database upload example to send a JSON location URL, since the endpoint fetches the file itself and does not accept a file body.
accaf9b Adds an Authentication section to the Weblite page stating that either an API Key or an Access Token is accepted as the Bearer value.
95ccfc2 Changes the write-data example to send the {"sql": ..., "database": ...} JSON body the endpoint expects instead of raw SQL.
8b551e5 Switches the Weblite upload and replace-database examples from an octet-stream body to the JSON location form.
ab0c335 Removes the empty-body create-database API example, which returns 422, and points readers to the Dashboard or CREATE DATABASE.
576a185 Rewrites the Weblite overview list to match the gateway's real API groups, replacing the non-existent Files group with Tokens, Memory, and MCP, and fixes the "executing SQLiteCloudArrayType" wording.
7012d2c Changes the Knex quickstart template to @{HOST}:8860 so the full server hostname can be substituted without doubling the .sqlite.cloud suffix.
eb910bb Changes the CDN and Gin quickstart templates to {host}:8860 and tells readers to copy the full hostname from the dashboard instead of assembling it from the project name.
The template appended .sqlite.cloud to {HOST} while the prose said to
substitute the server hostname, which already ends in .sqlite.cloud.
The templates appended .sqlite.cloud to {host} and the prose told readers
to assemble the value from the project name. Make {host} the complete
hostname copied from the dashboard, matching the Knex fix.
Context
The HTTPS server moved off the per-node address (
<project-id>.<hosted-zone>.sqlite.cloud) onto the multitenant gateway (<project-id>.<hosted-zone>.gateway.sqlite.cloud). The dashboard's Weblite and Edge Functions pages already point there — the docs still pointed at the node.Changes
Gateway migration (26 endpoint URLs, 6 files)
platform/weblite.mdx(19),create-database.mdx(2),write-data.mdx(1),multi-code-example.mdx(1),sqlite-ai/aisearch-documents.mdx(3),platform/access-tokens.mdx(2)myproject.cloud, missing.sqlite) and the vague<your-project-url>placeholder in the access tokens pageWeblite auth headers (22 curl examples)
Authorization: Bearer sqlitecloud://<project>.sqlite.cloud:8860?apikey=<key>→Authorization: Bearer <your-api-key>Node connection strings (85 occurrences)
<hosted-zone>segmentmyproject,myhost,xxx,host,mynode, plusabcd1234.global1.qwerty) to a singlemyproject.myzone.sqlite.cloudsqlitecloud://connection strings still target the node on port 8860 — only the HTTPS endpoints move to the gateway.Placeholder conventions
<your-project-id>.<your-hosted-zone>.gateway.sqlite.cloudabcdef123k.g4.gateway.sqlite.cloud(one realistic host, inmulti-code-example.mdx)myproject.myzone.sqlite.cloud(neutral zone, no real value)Open question for the reviewer
Six whole-host placeholders were left untouched:
{host}.sqlite.cloud(quick-start-cdn ×3, quick-start-gin ×2),{HOST}.sqlite.cloud(knex ×1), and{hostname}in the Swift/PHP/SQLAlchemy pages. They come with prose like "To get the host, see under your Project name{host}.sqlite.cloud". Whether they are wrong depends on what the dashboard renders under the project name: if it showscdrehk1lik.g4, they are already correct; if it shows only the project id, both the token and that sentence need rewriting.Verification
Two sweeps over the repo come back empty: no HTTPS URL points anywhere but the gateway, and no
sqlitecloud://connection string is missing a zone segment.ai.sqlite.cloudsyncbundle identifiers were left untouched.🤖 Generated with Claude Code
https://claude.ai/code/session_01259fQ5Dg5Ax68zHLrje6QA