Open vahidtakro opened 3 years ago
Okay I fixed this by exporting the provided metadata first, and integrated with the metadata provided in this package.
Ah yes, the metadata in this package (version 2
) only works with Hasura's versions <= 1.3.x. I'll fix it and provide Hasura's metadata in version 3
. Thanks for reporting! I'll reopen this issue to track this.
Facing the same issue. Would be great if this can be mentioned in the docs or the JSON can be uploaded.
note: Got it working using @vahidtakro 's suggestion.
My metadata.json file for Version 3:
{
"resource_version":3,
"metadata":{
"version":3,
"sources":[
{
"name":"default",
"kind":"postgres",
"tables":[
{
"table":{
"schema":"public",
"name":"comments"
},
"insert_permissions":[
{
"role":"anonymous",
"permission":{
"check":{
},
"columns":[
"author",
"content",
"post_id"
],
"backend_only":false
}
}
],
"select_permissions":[
{
"role":"anonymous",
"permission":{
"columns":[
"author",
"content",
"created_at",
"hidden",
"id",
"post_id"
],
"filter":{
"hidden":{
"_ne":true
}
},
"allow_aggregations":true
}
}
]
}
],
"configuration":{
"connection_info":{
"use_prepared_statements":true,
"database_url":{
"from_env":"HASURA_GRAPHQL_DATABASE_URL"
},
"isolation_level":"read-committed",
"pool_settings":{
"connection_lifetime":600,
"retries":1,
"idle_timeout":180,
"max_connections":50
}
}
}
}
]
}
}
There were many significant changes to Hasura since I created this project. I think this is what we should cover in the docs:
Suggest to use Hasura Cloud (there is a free tier and it's the easiest way to set up Hasura).
Create a database via Hasura Console:
Back when this issue was created, the new database URL was stored as a connection string in the metadata, which wasn't great for this project (we would need to tell user to additionally change the URL in the metadata). However, if you use Cloud and create a DB via Heroku, it's stored as PG_DATABASE_URL
, which makes it simpler.
Change the metadata content and include:
"sources": [
{
"name": "default",
"kind": "postgres",
"tables": [],
"configuration": {
"connection_info": {
"use_prepared_statements": false,
"database_url": {
"from_env": "PG_DATABASE_URL"
},
"isolation_level": "read-committed"
}
}
}
]
What do you think?
I used Hasura as a Docker container and it set up perfectly. Found it faster than setting up an account, even. 😅
I then followed the steps on your website to get it working.
I think it's best to leave the installation method of choice to the Dev (more flexibility). Or mention that there are more options like local installation.
What if there was a list of metadata.json files for each version?
What if there was a list of metadata.json files for each version?
Yeah, that would be cool too.
I think it's best to leave the installation method of choice to the Dev (more flexibility
So maybe let's mention that on the cloud you have to create a DB on your own but then you can use ready metadata, and via Heroku, you'll have a DB but you'd need to set the database connection string.
That sounds great. Multiple options with their explained pros/cons is good.
Hello, I want to test and use use-comments on heroku, but I am not able to import metadata, I get the following error:
key "args" not found