Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View resources / tables generated by another ORM #32

Closed
laloweb99 opened this issue Dec 19, 2021 · 6 comments
Closed

View resources / tables generated by another ORM #32

laloweb99 opened this issue Dec 19, 2021 · 6 comments

Comments

@laloweb99
Copy link

Hello! I'm trying to view the tables created by an application that uses Gorm as resources. But motor admin doesn't show them and I cannot find how to add a resource to the motor admin. Is there guide for this? Thank you.

@omohokcoj
Copy link
Member

Hi @laloweb99 - motor admin should display all tables which are present in your postgresql database automatically.
If you have some custom sql view in your Gorm application then you probably need to copy that sql code into motor admin queries to display it there.

@laloweb99
Copy link
Author

I have the "papers" table on the public schema but is not being shown on motor admin. I'm running the docker compose. Is there a way to sync the tables on moto admin?
image

image

@omohokcoj
Copy link
Member

@laloweb99 it seems like you are using the same docker compose postgresql for motor admin configuration tables and for application data tables.
You need to make sure that motor admin is connected to the same docker compose database with papers table here (if that's what is intended):
http://localhost:3000/settings/database

But usually application data should be stored in a separate database (meaning that your papers table won't be in the same database with motor_admin_users table) - you can specify databases using this link http://localhost:3000/settings/database (might require to restart a server).

Please let me know if this solves the issue.

@laloweb99
Copy link
Author

laloweb99 commented Dec 19, 2021

I moved the "papers" table to an app database but it's still not showing the "papers" resource:

DB config on motor admin
image

Tables on app databse
image

Resources shown in motor admin
image

@omohokcoj
Copy link
Member

@laloweb99 apparently the table was not visible because it didn't contain a primary key.
This bug has been fixed in the latest 0.2.38 release - you can update your docker image with docker pull motoradmin/motoradmin:latest

@laloweb99
Copy link
Author

Now it shows the table 😄 thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants