Repository navigation
docs: add a Go PostgreSQL quickstart and fix the Python/JS ones - #475
Merged
Merged
Conversation
Add tutorials/go-quickstart.adoc, the Go counterpart of the Python and
JavaScript PostgreSQL-protocol quickstarts, using pgx. It sets
default_query_exec_mode=exec because ArcadeDB describes every
parameter as varchar, which makes pgx's default mode refuse to encode
a Go int. List it in the Go nav group, the tutorials chapter, the
Native Drivers tip and the Go landing card.
Running the sibling tutorials against 26.10.1 showed two snippets that
fail with a syntax error there:
- `SELECT ... FROM MATCH {...} -Acted-> {...}` is not ArcadeDB SQL.
Use `MATCH {...}.outE('Acted'){as: acted}.inV(){...} RETURN ...`.
- `CREATE INDEX ... VECTOR (4, COSINE, LSM_VECTOR)` is a syntax error.
Use `LSM_VECTOR METADATA {dimensions: 4, similarity: 'COSINE'}`, as
the vector search tutorial does, on a LIST OF FLOAT property.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the missing PostgreSQL protocol entry to the Go section of Languages & Drivers, matching Python and JavaScript.
tutorials/go-quickstart.adoc: a Go version of the Python/JS PostgreSQL quickstarts, using pgx v5. It has the same sections: connect, schema, SQL, Cypher, vector search, full example.tutorials/chapter.adocfor the legacy build and PDF. It also appears in the Native Drivers "Which page do I want?" tip, andpgxis now on the Go landing card.pgx needs
default_query_exec_mode=execpgx's default mode describes each prepared statement and encodes arguments to the parameter types the server reports. ArcadeDB reports every parameter as
varchar, so passing a Gointfails withunable to encode 26 into text format for varchar (OID 1043). The tutorial putsdefault_query_exec_mode=execin the connection string and has a NOTE explaining why.simple_protocoland a per-callpgx.QueryExecModeExecalso work. This might be worth an engine issue: the server could report real parameter types instead ofvarchar.Fixes to the Python and JS quickstarts
Running the sibling tutorials against 26.10.1 turned up two snippets that fail with a syntax error:
SELECT person.name, … FROM MATCH {…} -Acted-> {…}no viable alternative at input 'MATCH')MATCH {…}.outE('Acted'){as: acted}.inV(){…} RETURN person.name AS name, …CREATE INDEX ON Product (embedding) VECTOR (4, COSINE, LSM_VECTOR)LSM_VECTOR METADATA {dimensions: 4, similarity: 'COSINE'}on aLIST OF FLOATproperty, as in the vector search tutorialThe
ASaliases also fix the JS SQL section, which readsrow.name,row.titleandrow.role. Without aliases the columns come back asperson.nameand so on, and those reads areundefined.Verification
All against
arcadedata/arcadedb:26.10.1with the Postgres plugin, on a fresh database:execmode.psycopg. MATCH returnsAlice acted in The Matrix as Trinity, and the vector search returns Laptop, Tablet, Phone.pg, wrapped in an async function because the page's top-levelawaitwithrequiredoesn't run as-is in CommonJS. That problem predates this PR and is left alone. Same results.docs-validator.py: broken refs unchanged (2, pre-existing). There's one new orphan warning,go-quickstart.adoc, because the validator only credits<<anchor>>references.migrate.sh && npm run buildpasses, and no stray backticks reach the rendered page.🤖 Generated with Claude Code