You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Including the schema name in tableName property is restrictive and seems unnecessary, since it won't allow us to use the same metadata files generated for different databases with the same schema.
I was able to run MySQL queries after following these steps:
introspect the database
remove all the <schema_name>. appended to tableName
run connector-link update command
add required models
build local and docker compose build and up
We would have the metadata file names as such: TableName, instead of SchemaNameTableName
here are the before and after of the SQL queries shown in the logs of the data connector:
before:
select json_object('rows', (
select json_arrayagg(json_object('email', email))
from (
select <schema_name>.<table_name>.email as email
from <schema_name>.<table_name>
group by <schema_name>.<table_name>.email
) as <alias>
))
after:
select json_object('rows', (
select json_arrayagg(json_object('email', email))
from (
select <table_name>.email as email
from <table_name>
group by <table_name>.email
) as <alias>
))
But we may have to check for and resolve the conflicting metadata files generated from multiple data sources (or instead of removing the schema name it should be taken from env? )
Hmm, I suppose there's no reason why a flag couldn't exist to omit schema name.
For some historical context, all DB connectors (MySQL/Oracle etc) used to run as one service, and you could add any type of database, or even multiple connections to the same database type.
For example, /api/v1/mysql/query, /api/v1/oracle/query
I'm not 100% sure if we still need the schema name in MySQL connector.
I have not tried using a JDBC URL with MySQL which doesn't specify a database. Since in that case you would need <db/schema_name>.<table_name> to disambiguate.
GavinRay97
changed the title
Schema name appended with table name in tableName property of configuration.json file
[FR] Schema name appended with table name in tableName property of configuration.json file
Nov 18, 2024
Including the schema name in
tableName
property is restrictive and seems unnecessary, since it won't allow us to use the same metadata files generated for different databases with the same schema.ndc-jvm-mono/ndc-cli/src/main/kotlin/io/hasura/cli/MySQLConfigGenerator.kt
Line 23 in 441f6b0
The text was updated successfully, but these errors were encountered: