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

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.

Related

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

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.

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.

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.

Is there a need in Neo4j to have initial scripts just like rdbms store needs initial CREATE(and other DDL scripts) scripts to insert,update etc?

I recently was working with liquibase which is capable of generating the initial DDL script for my JPA entities.
I am trying to do the same for my entities which has Neo4j as the store. Is there any library like liquibase which I can use to get my work done. Can someone put light on this ?
Is there a need in Neo4j to have initial scripts just like rdbms store needs initial CREATE(and other DDL scripts) scripts to insert,update etc ?
I don't want to use the auto capability of spring boot.
There is no need in Neo4j to create or update schema itself, as you're doing in SQL. Schema is dynamically builds from the data you have in your database.
But if you're trying to manage migration of the data stored in your database, you can take a look at liquigraph. It's able to manage a CYPHER queries within changesets.

chance for re-using oracle database after system migration?

I have an ERP application running with Oracle forms and Oracle database. Now I am planning to migrate this application to a java based enterprise application. will it be a good idea to keep the existing oracle database as back end and developing a web application with certain level of changes/additions in the DB design.
There are two facts to know before answer your questions:
has your database schema some oracle forms special structures or is it in 3rd normal form and simply stores data using keys and enforced referential integrity?
How much stored code contains your database?
Ad 1. Oracle forms don't have specific schema reqiurements. They work best if your schema if based on 3rd normal form. If your schema is like this, use it for new Java application. We have both forms and Java EE applications on same database schemas and is works fine.
Advantage is, if you have keys (primary, unique, foreign) in your schema. Use them when generating Java app.
Probably you will have to add #Version columns for optimistic locking (see https://docs.oracle.com/javaee/6/api/javax/persistence/Version.html). But there is not reason to build new schema for it.
Ad 2. Your will have to overwrite bigger part of database stored code (triggers, procedures, functions) to Java. In most cases this does not have dramatic impact to schema structure, but deal with it.
So - if your database schema is not tailored to some UI client needs AND you want only use a new client, use your schema. If not, create a new one.

Resources