How to update data in supabase having one to many relation? - supabase

I am working on a smaller project. I have two tables e.g. properties and agents. One property can have many agents. How can I update data in both tables using one query?
Here is the link to update data in postgres How I can update one to many relation in Postgres?

Supabase uses postgrest under the hood for the RESTful api, currently the suggested solution there is to write an rpc() function and call that.
Alternatively, since Supabase is just PostgreSQL, you always have the option of connecting directly using any postgres client and using the postgres solution you mentioned in your question.

Related

How to migrate from one backing store to another

I need to figure out a way to migrate our Javers audit data from DocumentDB to another independent repository than our domain data.
Does javers currently have any mechanism we can use to take our existing data and insert it properly into a second DB without having to manually map the data?
There is no migration tool. There are two javers' collections in MongoDB: jv_snapshots and jv_head_id, it's easy to copy them manually.

Is there a way Hasura can generate tables automatically using a schema.graphql file similar to keystonejs?

I'm wondering if there's a way where if given a schema.graphql file Hasura can create the required tables for the GraphQL endpoint? I'm looking for something similar to what keystonejs provides.
My current understanding is
Hasura
Tables --> GraphQL
KeystoneJS
Schema --> GraphQL (With automatic creation of tables)
You can use graphql-to-sql, here's an example (click "run"):
https://repl.it/repls/DangerousOutlyingSolution#index.js
I could not find anything about seeding or migrating in existing GraphQL file.
Maybe because they only operate on a PostgreSQL DB? You can just go a little more low level and seed the underlying PostgreSQL DB with some DDL.

How do you get aws appsync to pick up relations when adding Aurora as graphql datasource

Using add-graphql-datasource, appsync is supposed to generate a graphql endpoint based on the existing structure of an aurora mysql serverless database. The database already has data in it.
Relational Databases Section at
https://aws-amplify.github.io/docs/cli-toolchain/graphql
However, the generated endpoint just has flat representations of the data - none of the relations that exist in database.
How can you use add-graphql-datasource to generate the relations as well?
As of writing, the add-graphql-datasource command does not support auto-generating logic for relations. You can use the add-graphql-datasource command to get started and then write your own resolver logic to implement the relations.

Jira confluence setup

We decided to use jira and confluece with postgre. I have a question about the setup. I red the documentation but its still not clear to me. Do I need to create two databases and two login roles, one for confluence and one for jira with pgAdmin or just one database and one login role?
Thanks
Aleks
I just worked this out recently. You want two separate databases for sure.
I would recommend two database users, but you would be able to use just one if you wanted.
For what it's worth I had really good success using phppgadmin.
I'd call one database confluence and the other jira. It's really easy when the usernames match the database.
You can use one database username for both JIRA and Confluence but you need to have TWO Different Databases for them. You shouldn't try to install both of them in one database with different schema since it may cause lots of problem with a plugins later since they are using AO tables and sometimes you have same tables for both.

Neo4j - get friend list up to the 4th degree

I am working with one application which requires to show a friend list up to the 4th degree. After some research I came to know about one solution i.e. Neo4j.
I didn't get a clear idea from their tutorial, can I connect Neo4j to MySQL, and if not how should I implement that myself? I am currently using the codeigniter framework with MySQL.
Thanks.
neo4j is a database, and mysql is a database. so, this question is largely about connecting databases from different vendors together.
at this time, neo4j and mysql do not support direct connections to each other. you'd typically accomplish your desired task by exporting your data from mysql as CSV files (http://www.mysqltutorial.org/mysql-export-table-to-csv/) and importing to neo4j (http://jexp.de/blog/2014/06/load-csv-into-neo4j-quickly-and-successfully/)
michael hunger, a colleague of mine at neo4j, recently wrote this auto importer. you might want to check it out to make this process much easier:
https://github.com/jexp/neo4j-rdbms-import
before going through this data export/import, you may just want to download neo4j and play with the movie dataset. you can do this in about a minute (https://www.youtube.com/watch?v=om6E-HqtrZ0).
then, there are standalone PHP drivers for Neo4j:
http://neo4j.com/developer/php/
josh addell, the author of Neo4jPHP, has even written a post about how to use codeignitor 2 with his library:
http://blog.everymansoftware.com/2011/08/getting-neo4jphp-working-with.html

Resources