Closed GRISHNOV closed 1 year ago
In this case, requests to the server via the connection.update_schema will no longer be made when there is SchemaReloadException.
So there won't be any way to use a connection for any space operations? Only calls and evals? To be honest, I don't quite get this one without tests.
In this case, requests to the server via the connection.update_schema will no longer be made when there is SchemaReloadException.
So there won't be any way to use a connection for any space operations? Only calls and evals? To be honest, I don't quite get this one without tests.
I suppose, it is. By analogy with an existing solution:
c = netbox.connect(uri, {fetch_schema = false})
c.space -- always will be nil
Now the connection with fetch_schema=False
will throw an exception NotSupportedError
when trying to call the methods replace
, insert
, delete
, upsert
, update
, select
.
You'll also need to rebase, sorry for the inconveniences
While working on the task, I noticed that there is an issue in the CRUD tests.
When running make test
locally, in the absence of an installed crud rocks
, CRUD tests freezes forever.
So, I made some changes to the CRUD instance configuration file
Thanks for the feedback!
I've made all the corrections. At the moment there is a problem with tests that fall with variable probability. At the moment, it is difficult to determine the cause, but the problem, as far as I can see, is related to the update_schema
call for connection pool:
# Turning the same connection into schemafull.
if mode is not None:
for addr in con.pool.keys():
con.pool[addr].conn.update_schema(con.pool[addr].conn.schema_version) # <------
else:
con.update_schema(con.schema_version)
It looks like there is a desynchronization with the transmitted con.pool[addr].conn.schema_version
value and the value on the server
Ping me when everything is ready
Added support of the
fetch_schema
parameter, which allows to ignore schema changes on the server.By default, it is used
fetch_schema = True
:If the
fetch_schema
is specified asFalse
, fieldsschema_version
andschema
will no longer be present in theconnection
object:In this case, requests to the server via the
connection.update_schema
will no longer be made when there isSchemaReloadException
.Closes #219