Comments (21)
@eads as a workaround you can create a regular view as follows:
create view somename as select * from materialized_view;
You can now access data from the view somename
which in turn fetches data from the materialized view.
from graphql-engine.
@amesas Could hasura automatically handle Refreshing view for us ?
from graphql-engine.
pg_class probably have what you are looking for:
SELECT n.nspname as "Schema",
c.relname as "Name",
CASE c.relkind WHEN 'r' THEN 'table' WHEN 'v' THEN 'view' WHEN 'm' THEN 'materialized view' WHEN 'f' THEN 'foreign table' WHEN 'p' THEN 'table' END as "Type",
pg_catalog.pg_get_userbyid(c.relowner) as "Owner"
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind IN ('r','p','f','v','m')
AND n.nspname <> 'pg_catalog'
AND n.nspname <> 'information_schema'
AND n.nspname !~ '^pg_toast'
AND pg_catalog.pg_table_is_visible(c.oid)
ORDER BY 1,2;
from graphql-engine.
👍 to this PR. Materialized views are a powerful tool for data analysis and it's a bummer I can't access them from Hasura currently.
from graphql-engine.
Does materialized view automatically get updated when we mutate the related tables ?
from graphql-engine.
Nope by default.
You have to call REFRESH VIEW
https://www.postgresql.org/docs/11/static/sql-refreshmaterializedview.html
We use triggers with REFRESH CONCURRENTLY in some scenarios and a "CRON" in others.
from graphql-engine.
@0x777 Thanks for the hack!
Would be great to have a proper solution though
from graphql-engine.
It's not just showing untracked that doesn't work, even if you create the materialized view within Hasura SQL tab and click "Track" it doesn't show up. So I'll use the view wrapper trick.
from graphql-engine.
+1 Would love to see this implemented
@0x777 hack is useful until then 😄
from graphql-engine.
👍 Hack works fine, but it would be cool to have materialized views discovered :).
from graphql-engine.
Can we get this before v1?
from graphql-engine.
👍 We would like to see this functionality also
from graphql-engine.
It will be really great!!
from graphql-engine.
Could hasura automatically handle Refreshing view for us ?
It would be absolutely fantastic, I use a cron script for that but centralizing everything in Hasura would be a very good addition for v1.
from graphql-engine.
+1 would be good to have
from graphql-engine.
+1
from graphql-engine.
+1
from graphql-engine.
+1
from graphql-engine.
+1
from graphql-engine.
+1
from graphql-engine.
This is fixed in v1.2.2 (or maybe earlier, I upgraded from 1.1)
from graphql-engine.
Related Issues (20)
- mysql 5 connection error. HOT 3
- Hasura Action error message for Attribute Errors has a typo in the message text HOT 1
- server: the method for associating/attaching response headers from Hasura
- auth url ? HOT 2
- Tweak Prettify GraphQL Setting in Console HOT 2
- Postgres Database DDL experience in V3 Console
- V3/VS Code extension - Allow Directory Selection while track/track all on VS Code actions.
- v2: Design, Hasura Console, with Headers in Event Trigger
- Undocumented Limitation: Remote Schema Session Arguments for Non-Singletons
- console/graphiql: multiple order_by arguments are not constructed as array when using GraphiQL explorer, instead it constructs an object with multiple keys- this removes the order of the arguements HOT 4
- Allow automatic authorization import from JWT sub claim HOT 2
- server: support "_like" operator for snowflake
- key "tables" not found
- server: support Kriti templating in remote schema URL field
- Relay API has does not work with allow-list
- get-graphql-schema export graphqlschema garbled characters HOT 1
- v3: `order_by` is not accepting a list of input objects, without list it's impossible to pass ordered arguments
- Clickhouse: unable to track tables from other database tables. HOT 2
- v3: Add tree view explorer on VS Code extension
- v3: error while deploy step in GCP Cloud Run getting error rm: cannot remove 'TEMP_PROJECT_DIR': Permission denied HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-engine.