type_bridge.proxy¶
proxy
¶
Proxy database adapter for type-bridge server.
Routes queries through a type-bridge proxy server instead of connecting directly to TypeDB. Drop-in replacement for Database.
Usage
proxy = ProxyDatabase("http://localhost:8080", database="mydb") proxy.connect()
manager = Person.manager(proxy) manager.insert(alice) results = manager.all()
proxy.close()
ProxyError
¶
ProxyTransaction
¶
Transaction-like object that executes queries via the proxy server.
For MVP, each query is an independent HTTP request (stateless).
Source code in type_bridge/proxy.py
ProxyTransactionContext
¶
Context manager mimicking TransactionContext but routing through the proxy.
Source code in type_bridge/proxy.py
execute
¶
commit
¶
rollback
¶
manager
¶
Get a TypeDBManager bound to this proxy transaction.
Source code in type_bridge/proxy.py
ProxyDatabase
¶
Drop-in replacement for Database that routes queries through a type-bridge proxy server.
Instead of connecting directly to TypeDB, all queries are sent as HTTP requests to the proxy server's REST API. The proxy handles validation, interceptors (audit log, etc.), and forwarding to TypeDB.
Source code in type_bridge/proxy.py
connect
¶
Verify the proxy server is reachable via health check.
Source code in type_bridge/proxy.py
close
¶
transaction
¶
Create a proxy transaction context.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
transaction_type
|
Any
|
Transaction type string ("read", "write", "schema") or TransactionType enum value. |
'read'
|
Source code in type_bridge/proxy.py
execute_query
¶
Execute a query through the proxy and return results.