@@ -137,12 +137,13 @@ def load(self, data: bytes | bytearray | memoryview) -> Any | None:
137137 return parseAgeValue (data_bytes .decode ('utf-8' ))
138138
139139
140- def setUpAge (conn :psycopg .connection , graphName :str , load_from_plugins :bool = False ):
140+ def setUpAge (conn :psycopg .connection , graphName :str , load_from_plugins :bool = False , skip_load : bool = False ):
141141 with conn .cursor () as cursor :
142- if load_from_plugins :
143- cursor .execute ("LOAD '$libdir/plugins/age';" )
144- else :
145- cursor .execute ("LOAD 'age';" )
142+ if not skip_load :
143+ if load_from_plugins :
144+ cursor .execute ("LOAD '$libdir/plugins/age';" )
145+ else :
146+ cursor .execute ("LOAD 'age';" )
146147
147148 cursor .execute ("SET search_path = ag_catalog, '$user', public;" )
148149
@@ -333,9 +334,9 @@ def __init__(self):
333334
334335 # Connect to PostgreSQL Server and establish session and type extension environment.
335336 def connect (self , graph :str = None , dsn :str = None , connection_factory = None , cursor_factory = ClientCursor ,
336- load_from_plugins :bool = False , ** kwargs ):
337+ load_from_plugins :bool = False , skip_load : bool = False , ** kwargs ):
337338 conn = psycopg .connect (dsn , cursor_factory = cursor_factory , ** kwargs )
338- setUpAge (conn , graph , load_from_plugins )
339+ setUpAge (conn , graph , load_from_plugins , skip_load = skip_load )
339340 self .connection = conn
340341 self .graphName = graph
341342 return self
0 commit comments