Skip to content

v0.9.12

Choose a tag to compare

@github-actions github-actions released this 15 Oct 16:13

Release v0.9.12

📦 NPM packages

🐳 Docker image

docker pull ms2data/malloy-publisher:0.9.12
docker pull ms2data/malloy-publisher:latest

ℹ️ Details

  • Release branch: release/v0.9.12
  • Triggered by: @housejester

A SQL statement Postgres rejects answers 400 with the database's message, not 502

On a Postgres connection, sqlSource, sqlQuery and sqlTemporaryTable (and their per-package forms) now answer 400 when the database refuses the statement itself: a column, table, function or type that does not exist, a syntax error, an ambiguous name, a type mismatch. The body carries Postgres's own sentence, for example column "sundance_name" does not exist. They answered 502 Upstream connection error. before, with that sentence logged only on the server.

One case answers 404 instead: a statement naming a table the database does not have (relation "public.spaces" does not exist) carries reason: "TABLE_NOT_FOUND", the same discriminator the table lookup has emitted since 0.2.6, so a router that re-resolves a 404 can tell it from a worker that no longer hosts the connection.

If you branch on 502 to mean "the warehouse is unreachable", that is now what it means on these routes for Postgres; a rejected statement is a 4xx. Unchanged: an unreachable database (502, reason: CONNECTION_FAILED), rejected credentials (424), a role without CONNECT or a table the connection's user may not read (still 502), and every other dialect.


SQL Server connections

A connection of type: "sqlserver" reaches Microsoft SQL Server through @malloydata/db-sqlserver (Malloy 0.0.435): a SQL login over TCP with server, port, database, user, password, encrypt (on by default), trustServerCertificate, hostNameInCertificate and instanceName, the connector's own field names. The Console's connection dialogs offer it, the schema browser lists the schemas that own a table or a view (dbo the default) and a table is addressed schema.table. Schema and table names are matched as Unicode, so a non-ASCII name lists under any collation. The password is write-only, as for every other type, and a port that is not an integer from 1 to 65535 fails the config at load, naming the value.

The dialect is experimental upstream; the server accepts it for every compile, so a model needs no ##! experimental.dialect.sqlserver pragma. The connection is read-only: a colocated #@ persist on a SQL Server source is refused at load with the new RefusedSource.reason value read_only_dialect, and the source serves live. A rejected login answers as rejected credentials (424) and an unreachable server as unreachable (502). A certificate the client cannot verify is neither, since a retry cannot fix it: it answers as any unclassified driver failure on that route does (a 500 on schema and table listing), the server log names the certificate, and the connection test returns the driver's message naming it. A query that outruns requestTimeoutMs is likewise not read as an unreachable server.

Not covered yet, as for Postgres in 0.9.7: on the single-table lookup (…/tables/{tablePath}) a refused login answers as a plain driver error rather than 424, because the driver returns that failure as text with its code dropped. An unreachable server is recognized there from the text and answers 502, and a table that does not exist answers 404. Every login refusal answers 424, including a transient one such as a paused Azure SQL serverless database once the driver's retries are spent, since the driver drops the server's error number. See docs/connections.md.

What's Changed

  • test(app): notebook-authorize UI tests wait for a required given by @housejester in #1409
  • chore(release): 0.9.11 by @housejester in #1408
  • feat(connections): SQL Server connection type by @housejester in #1402
  • docs(eval): goldens are Malloy, not SQL, and two storefront-tour keys account for the conventions guide by @jswir in #1407
  • fix(server): answer a statement Postgres rejected with 400, not 502 by @sagarswamirao in #1403

Full Changelog: v0.9.11...v0.9.12