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)
- Ability to configure the deletion of errored event logs in Hasura
- REST endpoints do not send request body to auth webhook HOT 1
- Cannot add comment/description to Mutation exposed via Remote Schema
- Segmentation fault issue not referenced in the docs HOT 2
- Custom Permissions UI doesn't support Sessions Variables in Data Tab Performance Mode
- docker compose fails to assign ports HOT 1
- Can not parse OpenAPI 3 specification for Actions HOT 2
- Wildcard in JSON path for claims_map
- Order by aggregates with filters HOT 1
- Content-Type header's value override HOT 5
- Trying to run Hasura locally with nginx in front of it, getting `v1/graphql`, console seems busted?
- v3 docker compose expects git directory HOT 4
- Error trying to introspect hasura/openapi HOT 5
- Use supported version of Node.js in Dockerfiles
- Set-Cookie header missing in non-200 responses forwarded responses from Authorization Hook HOT 1
- Test Issue
- Output OGC API - Features HOT 2
- Auth Webhook Missing Request Data
- Unable to create computed field with text[] HOT 2
- v3 engine-1 fails with 400 / Unexpected / OCI runtime
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.