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
Hi there, I have a suggested improvement to the package.
Problem:
I had some trouble using the correct schema in my project. I added the schema inside the connection object (which is a Options object from Sequelize). However, when I added the schema there, it did not generate types! It said it was empty and I actually thought the repo was broken. However, looking inside the source code, I found that I needed to add the schema to the metadata object.
Also: Adding using npx terminal command with the -s or --schema makes the generation step not look into the schema.
Output printed to terminal:
As you can see, it looks at the t.table_schema='public' and i expected t.table_schema='eetschema'
Fetching metadata from source
Executing (default): SELECT 1+1 AS result
Executing (default): SELECT
t.table_name AS table_name,
obj_description(pc.oid) AS table_comment
FROM information_schema.tables t
JOIN pg_class pc
ON t.table_name = pc.relname
WHERE t.table_schema='public' AND pc.relkind = 'r';
Couldn't find any table for database eetlijst-db and provided filters
The text was updated successfully, but these errors were encountered:
Hi there, I have a suggested improvement to the package.
Problem:
I had some trouble using the correct schema in my project. I added the schema inside the connection object (which is a Options object from Sequelize). However, when I added the schema there, it did not generate types! It said it was empty and I actually thought the repo was broken. However, looking inside the source code, I found that I needed to add the schema to the
metadata
object.Also: Adding using npx terminal command with the
-s
or--schema
makes the generation step not look into the schema.npx stg -D mysql -h localhost -p 3306 -d myDatabase -u myUsername -s mySchema -x myPassword --indices --dialect-options-file path/to/dialectOptions.json --case camel --out-dir models --clean
Probably the connection schema field is necessary, but for me, it was really confusing.
Solution:
metadata
objectOutput printed to terminal:
As you can see, it looks at the
t.table_schema='public'
and i expectedt.table_schema='eetschema'
The text was updated successfully, but these errors were encountered: