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)
- Subscription in SQL Server using where on date field doesn't work HOT 1
- Citus Streaming Subscription issue
- Expose remote_table option in Native Queries Relationships UI
- Unable to login with VS Code extension on VS Code Insiders
- Bigint in Postgres doesn't work with HASURA_GRAPHQL_STRINGIFY_NUMERIC_TYPES = true HOT 3
- support: ability to clear/invalidate auth webhook cache via API
- Why are renamed field names displayed in table view?
- support: accept resource attribute values not limited to string type in OTEL
- How to upload a file to Hasura Engine and pass it to azure blob storage Action without using Base64?
- support: provide option to stringify log body directly in OTEL exporter HOT 1
- Console breaks when doing table-to-native query relationship
- --from-server flag is not working for schemas having capital letters (postgres).
- Sort metadata lists alphabetically
- OpenAPI import fails on Procore OpenAPI specs in Hasura Graphql 2.37.0 HOT 1
- Change log level for GC message from warn to info
- Batch input validation not working as expected HOT 1
- Add _like support for the Athena connector
- otel status value for the graphql engine metadata cannot be sourced from env vars similar to other otel properties
- support: honor scopes for JWT auth (hasura v2)
- hasura-cli v2.38.0 npm installation has no dist folder causing installation issues HOT 6
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.