Repository navigation
Description
Feedback
A user evaluating the Go driver as a replacement for their hand-written HTTP client reported two gaps:
Server commands: create database and create user exist only through
Raw(), with no typed errors, and the application's per-user isolation depends on them. There is also no constant forsqlscript. Once these exist I'll gladly try the driver in place of my HTTP client.
Both gaps are real, and they affect all three HTTP clients, not just Go.
Gap 1: no facade for server commands (POST /api/v1/server, executeServerCommand)
| Client | Today |
|---|---|
Go (go/arcadedb) |
Server wraps only ListDatabases, Exists, ServerInfo, Health and Ready (server.go). Server commands are reachable only through Server.Raw(), which by design never returns an error on a non-2xx status, so the caller gets no *ArcadeDBError. |
Python (arcadedb-driver) |
No facade method. Only .raw, which crashes on the 200 body (see below). |
TypeScript (@arcadedb/driver) |
No facade method. |
Our own e2e suites skip the generated typed call and use ExecuteServerCommandWithBody (Go, go/e2e/main_test.go) or the raw httpx client (Python, e2e/conftest.py) to create their test databases. That alone shows the gap.
Why the generated client is not enough here: the contract declares the 200 body as QueryResponse with an array result, but a real admin command such as create database answers {"result": "ok"} (the known upstream quirk, documented in go/CLAUDE.md and python/CLAUDE.md):
- Go's typed
ExecuteServerCommandWithResponsereportsLimit,ReturnedandTruncatedas zero values the wire never carried. - Python's generated
from_dictraisesValueError.
Each facade method therefore has to decode the body itself, not through the generated model.
Proposed surface (names per language idiom)
Typed methods on Server, each going through the facade's normal error path (checkResponse / ArcadeDBError, so 400/401/403/404/409/5xx all surface as typed errors):
CreateDatabase(ctx, name)DropDatabase(ctx, name)CreateUser(ctx, user): name, password, and the per-database group map (databases: {db: group}), serialised into thecreate user {...}JSON payload so callers don't hand-build itDropUser(ctx, name)ServerCommand(ctx, command): the generic escape hatch, still with typed errors. It returns the decodedresultas untyped JSON, because its shape varies by command:"ok"for admin commands, row arrays forlist queries/list transactions, and status objects forterminate ....
To decide during design:
- Should
CreateDatabase/CreateUserexpose an "already exists" condition distinctly (e.g. anerrors.Is-able sentinel or a typed check) if the server's answer allows it reliably? Per-user isolation needs create-if-absent, and the facade must not string-match on an unstable message without saying so. Check what the server actually sends first. - Names must be validated or quoted so that a user-supplied database or user name cannot inject a second command into the command string.
- Whether to also wrap
open/close database,set server setting,list queries/terminate query, or leave those toServerCommand. Suggest: leave them out for now.
Gap 2: sqlscript is missing from the query-language set
| Client | Today | Effect |
|---|---|---|
| Go | constants SQL, Cypher, Gremlin, GraphQL, Mongo (envelope.go) |
QueryLanguage("sqlscript") works but is undiscoverable |
| Python | QueryLanguage = Literal["sql", "cypher", "gremlin", "graphql", "mongo"] (facade/data.py) |
"sqlscript" fails type-checking |
| TypeScript | type QueryLanguage = "sql" | "cypher" | "gremlin" | "graphql" | "mongo" (facade/data.ts) |
"sqlscript" fails to compile |
The contract itself lists sqlscript among the languages a build can run. Fix: add SQLScript / "sqlscript" in all three. While we're at it, decide whether Python and TypeScript should keep a closed set at all. Go deliberately allows any server-understood value through QueryLanguage("..."). An open-but-hinted type (Literal[...] | str in Python, ... | (string & {}) in TypeScript) would stop the next missing language from being a hard block.
Out of scope (possible follow-up)
The gRPC contract already has CreateDatabase, DropDatabase, CreateUser, DeleteUser and ListUsers on ArcadeDbAdminService. The Go gRPC client exposes them only through RawAdmin() (TypeScript and Python gRPC likewise through the raw stubs). gRPC errors are deliberately left unwrapped, so the "typed errors" complaint does not apply in the same way. Revisit if a user asks.
Acceptance
- Go:
Server.CreateDatabase/DropDatabase/CreateUser/DropUser/ServerCommand, unit tests on the fake server (including the{"result":"ok"}body and each error status), e2e coverage.go/e2estops hand-rolling database creation. - Python: the same surface on the sync and async servers.
e2e/conftest.pyuses it. - TypeScript: the same surface. The e2e setup uses it.
-
sqlscriptin all three language sets, with a unit test that a script reaches the wire as"language": "sqlscript". - READMEs: the server-command section, the root-only requirement, why
ServerCommandreturns untyped JSON, and the injection/validation rule. Updatego/CLAUDE.md/python/CLAUDE.mdwhere they currently say "no facade method wraps the endpoint".
Activity
robfrank commentedon Oct 15, 2026
Correction to the proposed surface: user management should not go through the
create user {...}command string. The contract has dedicated REST endpoints, all root-only:createUser/api/v1/server/usersupdateUser/api/v1/server/users?name=deleteUser/api/v1/server/users?name=listUsers/api/v1/server/usersSo
CreateUser/UpdateUser/DropUser/ListUserswrap these. They take a structuredCreateUserRequest(no command-string injection to guard against), and 409 gives create-if-absent a reliable signal without string-matching. Those are exactly the questions the issue left open. Same thing for groups (listGroups,createOrUpdateGroup,deleteGroupon/api/v1/server/groups), which per-user isolation will likely need too, so they belong in this issue.Databases have no dedicated endpoint, so
CreateDatabase/DropDatabasestill go throughPOST /api/v1/serverwith the{"result":"ok"}handling and name validation described above.robfrank commentedon Oct 15, 2026
Correction to my comment above: 409 is not what a duplicate user gets. I measured it against a live
26.11.1-SNAPSHOTserver while implementing the Go part:POST /api/v1/server/users, name already exists"Security error",detail: "User '<name>' already exists"create database, name already exists"Cannot execute command",detail: "Database '<name>' already exists"The 403 comes from
ServerSecurity.createUserClusterWidethrowingServerSecurityException, whichAbstractServerHttpHandlermaps to 403, the same status a non-root caller gets. So 403 cannot be read as "already exists", and create-if-absent still needs a look first (ListUsers/Exists). The Go facade documents this and does not classify either case, ande2e/admin_test.gopins both statuses. The 403-vs-409 mismatch is an upstream contract/server disagreement.feat(#122): server administration and sqlscript in the Go HTTP client (…
robfrank commentedon Oct 15, 2026
The Go HTTP client part landed in #126 (
github.com/ArcadeData/arcadedb-drivers/go/arcadedb). Creating and dropping databases, managing users and groups, and running any other server command no longer needRaw(), and every failure now comes back as an*ArcadeDBErrorlike the rest of the client.SQLScriptis now a named language constant. It is onmainnow, and you can try it before the next release withgo get github.com/ArcadeData/arcadedb-drivers/go/arcadedb@main.sqlscriptconstant: doneStill open:
ListUsers/Existsfirst (upstream: POST /api/v1/server/users answers 403 'Security error' for an existing user; the contract declares 409 arcadedb#10073).❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
fix(#122): a duplicate user is 409 since ArcadeData/arcadedb#10076
robfrank commentedon Oct 15, 2026
Update: upstream fixed ArcadeData/arcadedb#10073 in ArcadeData/arcadedb#10076. A duplicate user now gets 409, so a 409 from creating a user can be treated as "already there". Users who aren't root still get 403. #129 updates the Go client, and #128 (Python) already uses 409. A duplicate database still gets 400.
feat(#122): server administration and sqlscript in the Python HTTP cl…
robfrank commentedon Oct 15, 2026
The Python HTTP client part landed in #128 (
arcadedb-driver, both sync and async).ArcadeDBServerandAsyncArcadeDBServercan now create and drop databases, manage users and groups, and run any other server command. Every failure raisesArcadeDBError, and"sqlscript"is now accepted as a query language (until now it failed type-checking).Still open: the TypeScript part, which is why this issue stays open.
❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
fix(#122): a duplicate user is 409 since ArcadeData/arcadedb#10076 (G…
robfrank commentedon Oct 15, 2026
Done in all three HTTP clients. Creating and dropping databases, managing users and groups, and running any other server command now go through the facade with typed errors, and
sqlscriptis a supported query language:A duplicate user gets 409 (since ArcadeData/arcadedb#10076; older servers answer 403), so it can be treated as "already there" when creating a user only if it's missing. A duplicate database gets 400, with the reason only in
detail; callexistsfirst if you want to create a database only when it's missing. All of this is onmainand goes out in the next release; Go users can try it now withgo get github.com/ArcadeData/arcadedb-drivers/go/arcadedb@main.Still open: letting the query-language type accept any string in Python and TypeScript, as this issue suggested, was deliberately not done; Go already accepts any value. Related follow-ups are #123 (login and API tokens), #124 (listing and stopping running queries) and #125 (PromQL label values).
❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
fix(#122): a duplicate database is 409 since ArcadeData/arcadedb#10079 (
feat(ArcadeData#122): server administration and sqlscript in the Type…