vaticle / typedb-driver

TypeDB Drivers for Rust, Python, Java, Node.js, C, C++, and C#.
https://typedb.com
Apache License 2.0
30 stars 32 forks source link

Address translation #624

Closed dmitrii-ubskii closed 2 months ago

dmitrii-ubskii commented 2 months ago

Usage and product changes

We allow the user to provide a translation map from the advertised server addresses (now treated as generic server names) to the actual addresses the driver shall use to connect to the cloud instances. We require the user to provide the full mapping.

Example usage:

Python:

with TypeDB.cloud_driver({
            "0.deployment-UUID.cloud.typedb.com:1729": "localhost:11729",
            "1.deployment-UUID.cloud.typedb.com:1729": "localhost:21729",
            "2.deployment-UUID.cloud.typedb.com:1729": "localhost:31729"
        }, credential) as driver:
    pass

Rust:

Connection::new_cloud_with_translation(                                                        
    [                                                                                          
        ("0.deployment-UUID.cloud.typedb.com:1729", "localhost:11729"),
        ("1.deployment-UUID.cloud.typedb.com:1729", "localhost:21729"),
        ("2.deployment-UUID.cloud.typedb.com:1729", "localhost:31729"),
    ].into(),                                                                                  
    credential                                                                                   
)                                                                                              
vaticle-bot commented 2 months ago

PR Review Checklist

Do not edit the content of this comment. The PR reviewer should simply update this comment by ticking each review item below, as they get completed.


Trivial Change

Code

Architecture