Open gelin opened 5 years ago
Also, it's even not possible to send necessary JSON to Carto API for this case.
It's necessary to POST JSON like:
{
"connector": {
"provider": "postgres",
"connection": {
"server": "postgres.server",
"database": "db",
"username": "dbuser",
"password": "dbpass"
},
"schema": "dbschema",
"table": "dbtable"
},
"interval": 86400
}
However, SyncTableJobManager
does this:
resource = self.resource_class(url, interval, self.client)
resource.update_from_dict(kwargs)
resource.save(force_create=True)
It tries to create a resource of type SyncTableJob
which has no "connector" property. So connector parameters are never sent to the server.
The syncing DB connections, as described in Import API are POSTs with JSON content to "/api/v1/synchronizations" where both
connector
andinterval
are defined. Also, actually there arenull
data import urls (archive) there.The code in
datasets.py
does not allow to do this: