Changelog History
Page 10
-
v1.1.0-beta.3 Changes
February 06, 2020π This is mostly a bug fix release and unless new critical bugs are discovered, this will be promoted to
v1.1.0
.π Fixes
- π server: disable explain end-points when metadata API is disabled (#3717)
- server: fix postgres errors when using certain columns/relationshps in a mutation's
returning
clause (#3609, #3642, #3271) - π server: fix parsing JWK expiry time from headers on startup (#3655)
- server: new enum values are now reflected in the schema with 'reload enum values' (#3759)
- β‘οΈ server: fix webhook not being called on a trigger definition update (#3791)
- β¬οΈ server: fix webhook not being called after migrations/upgrade (#3791)
- server: allow disabling CORS headers through an environment variable (#3782)
- π console: handle uncategorized types in permission builder (close #3603) (#3712)
- console: allow "_is_null" operator for all types in permissions (close #3777) (#3813)
- console: handle empty columns / computed fields in permissions (close #3789) (#3813)
- console: separate operators for json and jsonb column types & allow null as valid JSON type in permissions (#3823)
- console: handle "create if not exists" syntax for track table (close #3766) (#3816)
π Feature additions
-
v1.1.0-beta.2 Changes
January 16, 2020π This release fixes the bugs found in
v1.1.0-beta.1
.π Changelog
-
v1.1.0-beta.1 Changes
January 14, 2020Known Issues
- β¬οΈ Missing
hdb_view
when inserting (#3710, #3598) - instructions to downgrade fromv1.1.0-beta.1
tov1.0.0
- π There is a bug in the CLI auto-update code which will cause the CLI to NOT auto-update to this version. If you have the server running on
v1.1.0-beta.1
release and want to use the CLI, please download/install the CLI again rather than auto-updating. (#3706, #3709)
π Changelog
A more detailed changelog will be added soon.
- server: check db connection in healthz endpoint (close #2645) (#3440)
- β‘οΈ server: fix updating a column with multiple operators causing postgres query error (fix #3432) (#3458)
- server: read cache control header to refresh JWK (fix #3301) (#3446)
- server: bulk query should not care about access mode of select or count queries (#3467)
- β‘οΈ server: Update server/CONTRIBUTING.md and include manual build/test steps (#3472)
- server: fix insert permission views are not unique for long role names (fix #3444) (#3486)
- server: avoid CTE expressions in sql function queries, close #3349 (#3504)
- server: fix json/jsonb columns as String values in nested returning of a mutation (fix #3365) (#3375)
- server: fix resolving user info in websocket transport (#3509)
- server: Fix documentation of HASURA_GRAPHQL_PG_CONNECTIONS (#3495)
- π server: export metadata without nulls, empty arrays & default values (#3393)
- server: Allow request body to be logged even with successful queries (#3529)
- β server: Test with postgis 3.0.0 (#3519)
- π server: Support batched queries (fix #1812) (#3490)
- server: Fix unnecessary conditional logic in cache implementations
- server: Fix Hasura.Cache.Bounded.mkCacheSize to make sure we don't silently wrap or accept 0
- server: Initial benchmarks for caching. Closes #3530
- β server: Show request id on test failures (#3556)
- server: fix absence of "args" input field omits session variable argument, fix #3576 (#3585)
- server: Report errors in parallel when batching (#3605)
- π server: add query execution time and response size to ws-server logs in websocket transport (#3584)
- π server: Add Hasura.Incremental, a library for incremental builds
- π¨ server: Refactor schema cache construction to avoid imperative updates
- server: Use arrows instead of monads to define the schema cache construction
- server: Split up Hasura.RQL.DDL.Schema.Cache
- server: Use a significantly more efficient table_info_agg view
- server: Switch to a CPS implementation of Rule
- server: Add caching for recreating event trigger functions
- server: Properly check that custom field names do not conflict with other fields
- server: Fix new hdb_table_info_agg query to fetch column base types
- π server: Move arrow transformers into a separate module
- π server: Add support for fine-grained dependency tracking to Incremental
- π server: Use fine(er)-grained dependency tracking when building permissions
- server: Alter the type of hdb_catalog columns that reference SQL identifiers
- β‘οΈ server: Add missing check in SetTableCustomFields; update various test cases
- π server: incremental metadata: Clean up a few lingering loose ends
- π· server: remove brotli from packaging and CI images (#3673)
- server: include scalars types returning by computed fields in generated schema (fix #3650) (#3651)
- π server: add computed fields support on console (close #3203 #3565) (#3522)
- π server: fix cache-control header parsing for JWK (fix #3655) (#3676)
- π server: Add fast path for server internal metadata migrations (#3686)
- cli: fix(cli): mark from flag as required for squash (close #3400) (#3500)
- cli: add examples to all cli commands (#3475) (#3492)
- cli: cli(installer): add -f flag to curl (fix #1871) (#3477)
- π cli: cli(build): migrate to go modules (close #3476) (#3493)
- π cli: export metadata without nulls, empty arrays & default values (#3393)
- β cli: Fix failing CLI test (#3567)
- cli: console(fix): blank image on remote schemas section (close #220β¦ (#3574)
- cli: cli: add directory name as an argument to init cmd (#3590)
- π cli: cli: add commands to manage inconsistent metadata (close #2766) (#2973)
- π cli: cli: use json logs on non-terminal envs (close #2770) (#3528)
- cli: cli(fix): squash command not adding the last down (close #3401) (#3569)
- π cli: cli(fix): better error handling on non-json api responses (closβ¦ (#3104)
- cli: cli(fix): execute down migration in the correct order (#3625)
- π» cli: cli: add browser flag to console command (close #3333) (#3601)
- β‘οΈ cli: cli: update go-binddata, fix realize (close #3588) (#3687)
- β‘οΈ cli: update manifests to v1.1.0-beta.1
- console: add read_only flag to run_sql select queries from console (#3465)
- console: fix column edit migrations (close #3291) (#3441)
- console: add custom root fields section for views to console (#3532)
- π console: remove console feature version checks (#3494)
- π console: merge branch 'release-v1.0' to master after stable release
- π console: console: Bump dependencies to support Node v13.x (#3579)
- console: add base code for console read only mode (#3466)
- console: display postgres version in About page of console (close #3461) (#3611)
- console: misc console improvements (#3435)
- console: console: add hasura pro info button (#3594)
- β‘οΈ console: update console pro popup content (#3660)
- π console: Use fine(er)-grained dependency tracking when building permissions
- console: add bigint id to frequently used columns (close #3524) (#3669)
- π¨ console: run sql queries refactor (close #3543) (#3662)
- π console: add computed fields support on console (close #3203 #3565) (#3522)
- β‘οΈ console: update console readme (#3691)
- β¬οΈ Missing
-
v1.0.0 Changes
December 17, 2019Read more about this command in the [docs](https://hasura.io/docs/1.0/graphql/manual/deployment/downgrading.html#downgrading-hasura-graphql-engine). (close #1156) (#3760) - Check expression in update permissions (close #384) (rfc #3750) (#3804) - console: add multi select in browse rows to allow bulk delete (close #1739) (#3735) Adds a checkbox to each row on Browse Rows view that allows selecting one or more rows from the table and bulk delete them. - console: allow setting check constraints during table create (#3881) Adds a component that allows adding check constraints while creating a new table in the same way as it can be done on the `Modify` view. - console: add dropdown for enum fields in insert/edit rows page (close #3748) (#3810) If a table has a field referencing an enum table via a foreign key, then there will be a select dropdown with all possible enum values for that field on `Insert Row` and `Edit Row` views. - console: generate unique exported metadata filenames (close #1772) (#4106) Exporting metadata from the console will now generate metadata files of the form `hasura_metadata_<timestamp>.json`. - cli(migrations-docker): add support for v2 config (close #3969) A new CLI migrations image is introduced to account for the new CLI workflow. If you're have a project with `version: 2` in `config.yaml`, you should use the new image: `hasura/graphql-engine:v1.2.0-cli-migrations-v2`. Mount the migrations at `/hasura-migrations` and metadata at `/hasura-metadata`.
-
v1.0.0-rc.1 Changes
December 02, 2019π Changelog
Accessing session information in functions
Functions can now access session information (JSON) when they are tracked via version 2 of the
track_function
metadata API (which allows specifying an input arg to access session information).Example
Tracking a function and specifying the input arg:
POST /v1/query HTTP/1.1 Content-Type: application/json X-Hasura-Role: admin { "type": "track\_function", "version": 2, "args": { "function": { "schema": "public", "name": "search\_articles" }, "configuration": { "session\_argument": "hasura\_session" } } }
Here's how you can access session information in function:
-- A simple function which accesses role -- information from the 'hasura\_session' argumentCREATE FUNCTION search\_articles(hasura\_session json) RETURNS SETOF articles AS $$ SELECT \* FROM articles where author\_id = (hasura\_session -\>\> 'x-hasura-user-id') $$ LANGUAGE sql STABLE;
π Performance (#3012)
π§ Configure GraphQL engine's internal operations cache size
The size of the operations plan cache used by GraphQL engine can now be limited. To keep the cache size constant, the older entries are discarded using LRU strategy.
Cache size (number of operations) can be configured through the command line argument
--query-plan-cache-size
and the env variableQUERY_PLAN_CACHE_SIZE
(the numbers of GraphQL operations to be cached; 100 is a decent default value for most apps). The accepted values are from 0-65535 (0 disables the cache). When this value isn't specified, an unbounded cache is used which is the current behaviour. A future iteration of this change will change this behavious to default to a fixed cache size.read-only
run_sql
APIA read_only parameter has been added to the
run_sql
metadata API. This sets the postgres transaction mode toReadOnly
. This can be used by the console, etc. to perform select operations without forcing cache/gctx recomputation.Other server & CLI changes
- Minor server changes (#3154, #3414, #3439)
- β Hasura Tests (#3356,#3434)
- β Add identifier to
migrate status
command's response in CLI (close #2376) (#3109)
Console changes
-
v1.0.0-beta.9 Changes
October 31, 2019π Changelog
β¬οΈ Upgrading & downgrading
β¬οΈ You can upgrade to
beta.9
from any version.β¬οΈ You can downgrade to
beta.8
just by changing the docker image tag.π For downgrading to other versions, you may need to manually run SQL scripts if your downgrade path involves a catalog change. Please see this for catalog history.
π Read more about upgrading and downgrading.
β‘οΈ Updates to CLI & Migrations
π New migrations folder structure
π Starting with this release, Hasura CLI supports a new directory structure for migrations folder and defaults to that for all new migrations created.
Each migration will get a new directory with the name format
timestamp_name
and inside the directory, there will be four files:βββ migrations βββ 1572237730898\_squashed β βββ up.sql β βββ up.yaml β βββ down.yaml β βββ down.sql
Existing files old migration format
timestamp_name.up|down.yaml|sql
will continue to work alongside new migration files.Squash command
π Lots of users have expressed their interest in squashing migrations (see #2724 and #2254) and some even built their own tools to do squash. In this PR, we take a systematic approach to squash migrations.
A new command called
migrate squash
is introduced. Note that this command is in PREVIEW and the correctness of squashed migration is not guaranteed (especially for down migrations). From our tests, it works for most use cases, but we have found some issues with squashing all the down migrations , partly because the console doesn't generate down migrations for all actions.π Hence, until we add an extensive test suite for squashing, we'll keep the command in preview. We recommend you to confirm the correctness yourself by diffing the SQL and Metadata before and after applying the squashed migrations (we're also thinking about embedding some checks into the command itself).
$ hasura migrate squash --help (PREVIEW) Squash multiple migrations leading upto the latest one into a single migration file Usage: hasura migrate squash [flags] Examples: # NOTE: This command is in PREVIEW, correctness is not guaranteed and the usage may change.# squash all migrations from version 1572238297262 to the latest one: hasura migrate squash --from 1572238297262 Flags: --from uint start squashing form this version --name string name for the new squashed migration (default "squashed") --delete-source delete the source files after squashing without any confirmation
Usage:
# squash all migrations from version 1572238297262 to the latest one:hasura migrate squash --from 1572238297262# mark the squashed one as appliedhasura migrate apply --version 1572238297262 --skip-execution
π See #3072 for more details.
π Dry run and diff metadata
A new command.
metadata diff
is introduced (in PREVIEW ) to show comparisons between two different sets of Hasura metadata.# Show changes between server metadata and the exported metadata file: hasura metadata diff # Show changes between server metadata and that in local_metadata.yaml: hasura metadata diff local_metadata.yaml # Show changes between metadata from metadata.yaml and metadata_old.yaml: hasura metadata diff metadata.yaml metadata_old.yaml
π This release also adds a
--dry-run
flag tometadata apply
command which will print the diff and exit rather than actually applying the metadata.π This is just a general-purpose diff. A more contextual diff with the understanding of metadata will be added later.
π Support for Postgres 12
β Postgres 12 is now officially supported and all our tests are run against 12.0 also
β‘οΈ
pg_dump
binary bundled with the Docker image is updated to 12π Docs
- AWS Cognito JWT Guide (#2910)
- π Production checklist (close #2561) (#3140)
Other changes
-
v1.0.0-beta.8 Changes
October 22, 2019π Changelog
π Note: This release fixes the bugs with
beta.7
and this is a combined changelog sincebeta.6
.β¬οΈ Upgrading & downgrading
β¬οΈ You can upgrade to
beta.8
from any version.π Downgrading: You may need to manually run SQL scripts if your downgrade path involves a catalog change. Please see this for catalog history.
π Read more about upgrading and downgrading.
Table of contents π
Customize names of root fields and column fields
Computed fields
Create permissions with conditions spanning tables
π Performance optimisations
- Compress HTTP responses
- Optmization for all subscriptions
π Annotate GraphQL schema for better documentation
β‘οΈ Update conditionally when using upsert
π Better support for Postgres connection string parameters
π Docs
Others
π± Customize the names of root fields and column fields π·
This change allows customizing the names of root fields and the column fields in Hasura's GraphQL schema.
0οΈβ£ E.g. the default root field names generated for a table named
author
are:Queries/Subscriptions:
author
author_by_pk
author_aggregate
Mutations:
insert_author
delete_author
- β‘οΈ
update_author
The above and the names of the column fields can now be customized.
How to customize
Console
(to be available shortly)Customizing root fields names: Head to the
Modify
tab of the table whose generated root fields you want to change:Customizing column field names: Head to the
Modify
tab of the table whose column fields you want to alias and edit the column for an option to provide a custom name:π Metadata API
The v2
track_table
allows you to specify all the customizations while tracking a table. Here's an example request:POST /v1/query HTTP/1.1Content-Type: application/json X-Hasura-Role: admin { "type": "track\_table", "version": 2, "args": { "table": "authors", "configuration": { "custom\_root\_fields": { "select": "authors", "select\_by\_pk": "author", "select\_aggregate": "authorStats", "insert": "createAuthors", "update": "updateAuthors", "delete": "removeAuthors" }, "custom\_column\_names": { "id": "authorId" } } } }
For tables that have already been tracked, you can use the
set_table_custom_fields
metadata API:POST /v1/query HTTP/1.1Content-Type: application/json X-Hasura-Role: admin { "type": "set\_table\_custom\_fields", "version": 2, "args": { "table": { "name": "site\_employees", "schema": "rocc" }, "custom\_root\_fields": { "select": "authors", "select\_by\_pk": "author", "select\_aggregate": "authorStats", "insert": "createAuthors", "update": "updateAuthors", "delete": "removeAuthors" }, "custom\_column\_names": { "id": "authorId" } } }
β β οΈ Warnings β οΈ
- π The original Postgres table and column names are used in metadata definitions for relationships, permissions etc.
- Please ensure that your client apps are in sync with this change as once you begin using custom names, requests with the original field names will result in an error.
- π Known limitations: an error is thrown if the custom name and the original name of a column are the same. This is being fixed in #3154.
Computed fields
π Computed fields are virtual values or objects that are dynamically computed and can be queried along with a table's columns. Computed fields are computed when requested for via SQL functions using other columns of the table and other custom inputs if needed. See pull request description.
β Adding a computed field
Computed fields are added to a table via SQL functions. Any SQL function which accepts table row type as one of the input arguments, returns base types (integer, Text, etc.) or
SETOF <table-name>
and notVOLATILE
can be added as computed field.Example:-
Let's say we have a table,
author
, that has two text columns,first_name
andlast_name
, and we want to enrich the table with a virtual field that combines these columns into a new one,full_name
. We can do this by adding a computed field:Define a SQL function called
author_full_name
:CREATE FUNCTION author\_full\_name(author\_row author) RETURNS TEXT AS $$ SELECT author\_row.first\_name || ' ' || author\_row.last\_name $$ LANGUAGE sql STABLE;
β Add a computed field,
full_name
to theauthor
table with the SQL function above using the following API.POST /v1/query HTTP/1.1Content-Type: application/json X-Hasura-Role: admin { "type":"add\_computed\_field", "args":{ "table":{ "name":"author", "schema":"public" }, "name":"full\_name", "definition":{ "function":{ "name":"author\_full\_name", "schema":"public" }, "table\_argument":"author\_row" } } }
Query the data from
author
table along with its computed fields.query { author { idfirst\_namelast\_namefull\_name } }
Response:
{ "data": { "author": [{ "id": 1, "first\_name": "Chris", "last\_name": "Raichael", "full\_name": "Chris Raichael" }] } }
π Please see docs to learn more about computed fields and their metadata API.
π Create permissions with conditions spanning tables π
π This change allows you to use data in unrelated tables to build a permission rule using the new
_exists
keyword. Let's use an example to see how this works:Say you have the following two tables:
users
Columns Type id Integer is_admin Boolean accounts
Columns Type id Integer account_info Text and you want to restrict access to the
accounts
table to only those users who are "admins" i.e. the value of theis_admin
column istrue
for the givenuser_id
(which is sent in theX-Hasura-User-Id
session variable).To compose a permission rule for this use-case, you can check if there's a row in the
users
table whereid
=X-Hasura-User-Id
andis_admin
=true
:Like all the other operators, you can use logical operators (
_and
,_or
and_not
) to further restrict access to a subset of the rows.
π Performance optimisations
π± Compress HTTP responses ποΈ
HTTP responses from Hasura are now compressed (using gzip) by default whenever supported by the requesting client. In anecdotal tests, we've noticed approximately 10X compression in response payloads with negligible overhead for handling compression in the server and in client apps.
π€ This should be especially useful to handle introspection queries on large datasets. We haven't yet benchmarked these changes in scenarios where network latency is a significant factor in overall latency, and any reports from the community on this front will be much appreciated!
π± Optmization for all subscriptions π
π The previous iteration of this change only optimised subscriptions that did not use non-scalar variables. This has now been fixed, and requests with non-scalar variable values, such as the following, are now multiplexed if they generate the same SQL:
subscription latest\_tracks($condition: tracks\_bool\_exp!) { tracks(where: $tracks\_bool\_exp) { idtitle } }
π Annotate GraphQL schema for better documentation π
π You can now annotate your GraphQL schema for better readability by adding comments to your Postgres schema elements i.e. tables, views, columns and functions. These comments will be displayed in the
Docs
window of GraphiQL:Note : Currently, you can add comments for tables, views and column names using the console, but for functions you'll need to run a SQL query that does the same (support for this will be added to the console shortly).
Update conditionally when using upsert (
where
clause inon_conflict
input object)β‘οΈ When using
upsert
, you can now conditionally update only a subset of rows using the new optionalwhere
clause in theon_conflict
input object. Here's an example mutation:mutation { insert\_item( objects: {itemId:"1234", creationEpochSeconds: 1567026834}, on\_conflict: { constraint: item\_pkey, update\_columns: [itemId, creationEpochSeconds] where: {creationEpochSeconds: {\_lt: 1567026834 }} }) { affected\_rows } }
π Better support for Postgres connection string parameters π
π Native support for the database connection string is now available and you can leverage the optional parameters in the string with Hasura. Examples of parameters you can now use:
application_name
ssl
connection_timeout
IPv6
(host address for the GraphQL engine -> Postgres connection)
π Please see this for details on parameters.
π Docs π
Modelling teams and user security with Hasura (author: @elgordino)
Public GraphQL queries with Hasura (unauthenticated users) (author: @mikewheaton)
Building file upload/downloads for your Hasura app(author: @elitan)
Others
π This release also includes bug-fixes and other minor changes.
A big shoutout to:
-
v1.0.0-beta.7 Changes
October 10, 2019π Changelog
π π¨ This was a buggy release, please avoid running this release π¨
EDIT: Oct 10, 2019 - 21:05 GMT+05:30 : We have taken down the image from Docker hub following a couple of bug reports.
latest
tags now points tobeta.6
. If you have already upgraded tobeta.7
, you can downgrade tobeta.6
after running the following SQL: https://gist.github.com/0x777/4e608a975ed4efeef6ac94ea329a4e80
EDIT: Oct 10 2019 - 15:30 GMT+05:30 : We have identified a potential issue with this release. Please do not upgrade until we put out another notice.- server: fix a typo in limit description of schema (close #2810) (#2811)
- server: allow creating permissions with conditions spanning tables (close #2512) (#2701)
- π server: support optional parameters in database url (close #1709) (#2344)
- server: Implemented graceful shutdown for websockets (#2827)
- server: fix row comparison operator in event triggers (fix #2036) (#2868)
- server: propagate Postgres table comments to GraphQL schema descriptions (close #446) (#2397)
- server: Add Data.Time.Clock.Units for DiffTime literals and conversions
- server: Multiplex all subscriptions, grouping them by their resolved SQL query
- server: Change the way we determine whether or not queries are reusable
- π server: server: Donβt allow warnings when building in CI (#2892)
- server: allow customising graphql schema for a table (close #981) (#2509)
- server: add gzip brotli compression to http responses (close #2674) (#2751)
- π¦ server: add brotli shared lib to packager image (#2924)
- server: Parameterize all SQL values when multiplexing subscription queries (#2942)
- β server: Fix typo in warning message (#2949)
- server: fix hpc combine error (close #2946) (#2947)
- β‘οΈ server: update custom column names on renaming/dropping columns (#2933)
- π server: remove conflict_action type (#2950)
- π server: fixes to the subscriptions improvements introduced with #2942 (#3005)
- server: fix SQL generation if more than one aggregate order_by items present, fix #2981 (#2998)
- π server: remove brotli compression (#2967)
- π² server: add raw query field for error http log (close #2963) (#3020)
- π server: support where clause in on_conflict of insert mutation (close #2795) (#3002)
- cli: check for empty response on migration settings (#2877)
- cli: optimise migrate api for console on cli (#2895)
- cli: allow customising graphql schema for a table (close #981) (#2509)
- π console: add console support for setting table as enum (close #2767) (#2789)
- β‘οΈ console: update enums docs (#2813)
- π console: handle "without time zone" dateTime types in permissions builder (close #2842) (#2844)
- π§ console: fix remote schema headers configuration in console (#2847)
- console: fix console insert/edit row glitches (close #2840, #2665) (#2843)
- console: make destructive actions on console require typed out confirmation (close #1469) (#2400)
- π console: fix typos in documentation (#2562)
- β‘οΈ console: update console telemetry config (#2899)
- π console: add console support for exists operator in permissions (close #2837) (#2878)
- π console: fix console server-build script (#2790)
- π console: better key persistence in console (#2686)
- βοΈ console: fix typos (#2935)
- β‘οΈ console: updated heroku url property in console readme (#2957)
- π console: fix console lint issues, code formatting (#3028)
- console: allow only tracked tables in manual relationship definition in console (#3046)
- console: separate server and cli env variables in console local dev (#2937)
- β‘οΈ console: update graphiql explorer in hasura console and graphiql online (closes #2313) (#2994)
- console: fix console README and isProduction check while setting globals (#3076)
-
v1.0.0-beta.6 Changes
August 29, 2019π Changelog
EDIT(10-Sept): Breaking change
π A minor breaking change with this release has been identified; some type names have been modified to make them more consistent with others. Here's a list of modified type-names:
integer_comparison_exp
->Int_comparison_exp
boolean_comparison_exp
->Boolean_comparison_exp
real_comparison_exp
->Float_comparison_exp
text_comparison_exp
->String_comparison_exp
varchar_comparison_exp
->String_comparison_exp
π Support for GraphQL Enums
π Single-column Postgres tables (or two-columns, where the second column is a documentation comment) can now be exposed as Enums in the GraphQL schema so that enum values can be explicitly represented and typechecked.
Creating Enums
π§ Here's how you can configure Enums:
π π Using metadata APIs
β 1. Adding a new table as Enums : An optional
is_enum
key has been added to thetrack_table
metadata API that lets you specify that a table is to be exposed as an Enum.- Setting an existing tracked table as Enum : A new
set_table_is_enum
metadata API allows specifying whether an already-tracked table should be used as an Enum table.
π± π₯ Using the console
β 1. Adding a new table as Enums
Create a table as usual (the table must have only 1 or 2 columns) and add some data in it:
Let's say we want to create an Enum for months of the year:CREATE TABLE months_of_the_year ( month text PRIMARY KEY, description text );
β Let's also add some test data into this table:
INSERT INTO months\_of\_the\_year (month, comment) VALUES('January', 'named after the Latin word for door (ianua)'), ('February', 'named after the Latin term februum, which means purification')
- Head to the
Modify
section for the table and toggle theSet table as enum
option and confirm.- Exposing an existing tracked table as Enum
- Head to the
Modify
section for the table and toggle theSet table as enum
option and confirm.
Note : The GraphQL Spec mandates that you not have empty Enum lists (in this case, tables). Using any of the above methods with empty tables will result in an error.
Using Enums
To restrict values for a column in a table to those from an enum, first, you need to set up a foreign key to the column of the enum table with the enum values β‘οΈ 2. If the enum table has been tracked and set as an enum table, the GraphQL schema will be updated to reflect Enums and the references to it in tables:
type rain_log { id: Int!rainfall: Numeric!month: months_of_the_year_enum! } enum months_of_the_year_enum { "named after the Latin word for door (ianua)" January"named after the Latin term februum, which means purification" February }
If you head to Graphiql, you'll notice that:
- you can pick the enum value in Explorer from a drop-down
- you can use the name of the enum value directly rather than providing a string
π± π§ πΊ Support for Raster
ST_Intersect
functionsπ Some of the overloaded variants of the PostGIS raster
ST_Intersects
function are now available as the following GraphQL operators forraster
columns in boolean expressions:_st_intersects_rast
->boolean ST_Intersects(raster <raster-col>, raster <raster-input>)
_st_intersects_nband_geom
->boolean ST_Intersects(raster <raster-col>, integer nband, geometry geommin)
_st_intersects_geom_nband
->boolean ST_Intersects(raster <raster-col> , geometry geommin, integer nband=NULL)
(with and without nband values)
Usage:
query ($raster\_input: raster) { table\_with\_raster\_col(where: {rast\_col: {\_st\_intersects\_rast: $raster\_input}}){ idrast\_col } }
Note:
raster_input
is a rawString
value of raster data.π Please see docs for more details.
π οΈ Bug Fixes and other changes
π The server now uses named notation instead of positional notation for function arguments to prevent issues with the generated SQL if any of the arguments is not specified. (fix #2730) (#2777)
π± The server now shuts down gracefully for HTTP requests i.e. it stops accepting new connections, waits for all connections to be drained before shutting down. It also forcefully kills all pending connections after 30 seconds. This change does not deal with gracefully shutting down websocket connections, something that will be handled in a subsequent PR. π£ Shoutout to @lorenzo for submitting this PR π π (close #2698) (#2717)
π Minor fixes in console & CLI (#2527, #2536, #2798, #2765, #2763, #2617)
-
v1.0.0-beta.5 Changes
August 23, 2019π Changelog
β¨ Enhancements
- The console now provides a summary view of permissions defined across roles in each schema. This summary interface can also be used to copy all permissions for a role in a schema to a new or existing role (#2693)
- The recently introduced templated "Frequently used columns" in the console are now available in the
Modify
section of a table too (close #2545) (#2593) - π Better console notifications are now shown for errors in db schema load & metadata reload (#2658)
- π Styles of data tables in console updated for better readability (#2629)
- π The "secure-your-endpoint" docs link in the console now opens in a new tab (#2709)
- π§ Remote schema definition now supports an optional
timeout_seconds
argument to configure timeouts for calls (close #2501) (#2753)
π Bug fixes
- All
Set-Cookie
headers are now read from a remote schema response and forwarded to the client (fix #2688) (#2739) - Postgres error code 22025 is captured as
HTTP 400
bad request (close #2486) (#2671) - The type of a column whose permissions defined only with session variables can now be altered (close #2070) (#2683)
- π» Only the
ExceptionContent
part of an HTTP Exception is now sent to the client (#2738) - null values in
order_by
input field do not throw an error anymore (fix #2754) (#2755)
π· Build system, code clean-up and other misc. changes
π· Tests & build system (#2472,#2547, #2685, #2712, #2742)
Code cleanup (#2661, #2670, #2762, #2708, #2668, #2684, #2676)