Python:Database Type:unavailable

Hi team,
I have been doing the auto-assignment of tables and DBconnection for the datamodel from python. But i am getting a problem in which the store type for a table is appearing as unavialable. This happens only some times when the datamodel is copied from some other server. But this completely removes the object of doing this in the first place.
below is the screenshot.
Any help would be appriciated.

Edit:
It should be as below

Hi @rahulbhatt,
as I can see, this question was answered by our servicedesk.
I will copy the response here in case someone else faces the issue:

“DataStore: Unavailable” means that the data for this table is cached data. As the customer described correctly, this happens when the table was imported via transport; the transport doesn’t know anything about the original DB connection, it just contains the data itself as files.

To set a DB connection for such a table, you can use

table.set_db_connection(<DBConnection>, <table name in the database>)

Then it should change the data store of the table accordingly.

So you just need a DBConnection object which should be set. If there are already connections defined in the datamodel, you can get all DBConnections for a DataModel with:

connections = datamodel.connections

Alternatively, if no DBConnection is contained in the datamodel, a new one can be created with DBConnection.create_new(…) or you can create it via the frontend first.

Hi @nicolas.i

Surely i’d hope this would be useful to someone.

Thank you .