In preparation for tightening up the various ways in which we construct and work with session variables, I am trying to move the behavior into the same module(s) as the data types, so that we can avoid exposing the internals of data structures in favor of smart constructors and conversions.
The session variable code was split between `Hasura.RQL.Types.Roles`, `Hasura.RQL.Types.Session`, and `Hasura.Session`, with the first two containing most of the data structures (and some logic) and the latter containing the rest of the logic. These files do not interact with the rest of `Hasura.RQL`, though they are depended upon by that namespace.
I have refactored these files into a new namespace, `Hasura.Authentication`. It now looks like this:
1. Role types are now in `Hasura.Authentication.Role`.
2. Header constants were moved from `Hasura.Server.Utils` to `Hasura.Authentication.Headers` (plural) to avoid cycles.
3. Header logic was moved from various places into `Hasura.Authentication.Header` (singular) for the same reason.
4. Session variable types and logic live together in `Hasura.Authentication.Session`.
5. User info types and logic live together in `Hasura.Authentication.User`.
This new structure is cycle-free and generally avoids importing the rest of the code, which means we should be able to start pruning the list of exports and locking down session variable construction.
No behavior was changed in this changeset.
The majority of changes are to the imports in a number of files; everything depends on these things. By splitting into multiple files, we also reduce the surface area of an individual import, which was a pleasant side-effect of this work.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10960
GitOrigin-RevId: 7cb962c06483cd9b92b80432aed5cabecb465cda
Alpine is often slower than Debian (because musl is sometimes slower than glibc) and not how anyone actually deploys PostgreSQL in production.
Most notably, some floating-point computations result in slightly different values, and Debian ships with better support for different locales so sorting text (e.g. with `ORDER BY`) behaves differently.
Let's test against an environment that people are likely to actually use.
As a result, there are slight changes to the results of PostGIS computations in a couple of test cases.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10942
GitOrigin-RevId: 4caed19def23a372fc3930c409514b1c9b385026
Upgrading HLint brought in a bunch of new suggestions for improvements to the code.
I thought I'd go through them quickly and get them in.
This is not all of them, just the ones I thought were reasonable.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10505
GitOrigin-RevId: cefd661e9dcb973843b421fd0e31a5c5ffe4720f
This changes our test configuration to use the PostgreSQL 16 image from `postgis/postgis`.
In addition, it bumps PostGIS to v3.4 (from v3.3).
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10361
GitOrigin-RevId: 883c96d8453efb42b226f849891488382a99c80c
Now that Docker for macOS supports using Rosetta for x86/amd64 emulation, we no longer need to use the `azure-sql-edge` image. We can always use the official `mcr.microsoft.com/mssql/server` one.
This also means that we no longer need the separate healthcheck container, because the official image ships with `sqlcmd`.
When this is merged, you will need to ensure you have enabled Rosetta emulation in the Docker settings to test against SQL Server on macOS. This requires macOS 13 (Ventura).
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10139
GitOrigin-RevId: 2225bf5f4c6d3632da1f29b2229c9b04ead5e34c
BigQuery has changed its error message text. This updates the test accordingly.
We could probably be more liberal when matching the text, but as this is unlikely to change again soon, that feels like overkill.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10306
GitOrigin-RevId: 74e7926ee17e617d9ff4430b3cea220ced579ae5
The "Analyze" feature for SQL Server only partially worked. It would show the SQL generated, but not the execution plan. This is because SQL Server doesn't support generating a plan for prepared statements with parameters.
To work around this, we restructure the query as one without parameters. Instead, we replace each parameter with a variable. We declare the variables but don't set values. We then plan _that_, which works.
We run all this in a single query because local variables only last for a single transaction/batch.
This feature does not work for stored procedures.
[NDAT-582]: https://hasurahq.atlassian.net/browse/NDAT-582?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10125
GitOrigin-RevId: a4b45b9b207456ff4fbd1b69b008e93f87346342