Connect to server
This guide covers connecting to TypeDB Cloud or TypeDB Core servers with Studio, Console, or one of the drivers.
Understanding connections
TypeDB uses a gRPC-based protocol for external communications, including queries. TypeDB clients, like Studio and Console, as well as language-specific drivers with native APIs, have been developed to implement this protocol.
Connect to TypeDB Core
A network connection to TypeDB Core requires the address and port of the server to connect to.
-
Studio
-
Console
Run Studio and follow instructions below:
-
Click Connect to TypeDB on the right side of the top toolbar.
-
Make sure the
TypeDB Core
option is selected in theServer
field. -
Enter the address and port of the server to connect to (e.g.
localhost:1729
). -
Click Connect.
Run Console using the --core
argument to set the address and port to connect to:
typedb console --core=<server-address>
The --core
argument is used to set the TypeDB Core server IP address and port to connect to,
for example, 10.0.0.5:1729
.
For programmatic access, use one of the TypeDB drivers via native API:
-
Rust
-
Python
-
Node.js
-
Java
-
C#
-
C++
-
C
let driver = Connection::new_core("127.0.0.1:1729")?;
Where 127.0.0.1:1729
is the address and port to connect to.
driver = TypeDB.core_driver("127.0.0.1:1729")
Where 127.0.0.1:1729
is the address and port to connect to.
let coreDriver = await TypeDB.coreDriver("127.0.0.1:1729");
Where 127.0.0.1:1729
is the address and port to connect to.
TypeDBDriver driver = TypeDB.coreDriver("127.0.0.1:1729");
Where 127.0.0.1:1729
is the address and port to connect to.
ITypeDBDriver driver = TypeDB.Driver.Drivers.CoreDriver(SERVER_ADDR);
Where 127.0.0.1:1729
is the address and port to connect to.
TypeDB::Driver driver = TypeDB::Driver::coreDriver("127.0.0.1:1729");
Where 127.0.0.1:1729
is the address and port to connect to.
connection = connection_open_core(SERVER_ADDR);
Where 127.0.0.1:1729
is the address and port to connect to.
After connecting to TypeDB Core, see how to create a database and manage sessions and transactions.
Connect to TypeDB Cloud
A network connection to a TypeDB Cloud cluster requires address and port of at least one server in the cluster, as well as username and password of a user.
-
Studio
-
Console
Run Studio and follow instructions below:
-
Click Connect to TypeDB on the right side of the top toolbar.
-
Switch the
Server
field drop-down toTypeDB Cloud
. -
Click Manage Cloud Addresses button.
-
Add address and port for at least one server from your TypeDB Cloud deployment, then close the Address Management window.
-
Fill in the
Username
andPassword
fields with valid user credentials.For newly created deployments, the default username and password are
admin
andpassword
. After connecting for the first time, you will be required to change the password before queries can be run. -
Turn on the
Enable TLS
option and leave theCA Certificate
field empty. For self-hosted deployments, encryption parameters may vary. -
Click
Connect
.
Run TypeDB Console using the --cloud
argument to set a list of addresses and ports to connect to:
typedb console --cloud=<server-address> --username=<username> --password --tls-enabled=true
You will be prompted for a password.
For newly created deployments, the default username and password are |
For programmatic access, use one of the TypeDB drivers via native API:
-
Rust
-
Python
-
Node.js
-
Java
-
C#
-
C++
-
C
let driver = Connection::new_cloud(&["127.0.0.1:1729"], Credential::with_tls("admin", "password", None)?)?;
Where 127.0.0.1:1729
is the address and port to connect to.
driver = TypeDB.cloud_driver("127.0.0.1:1729", TypeDBCredential("admin", "password", tls_enabled=True))
Where 127.0.0.1:1729
is the address and port to connect to.
let cloudDriver = await TypeDB.cloudDriver("127.0.0.1:1729", new TypeDBCredential("admin","password"));
Where 127.0.0.1:1729
is the address and port to connect to.
TypeDBDriver driver = TypeDB.cloudDriver("127.0.0.1:1729", new TypeDBCredential("admin", "password", true ));
Where 127.0.0.1:1729
is the address and port to connect to.
ITypeDBDriver driver = TypeDB.Driver.Drivers.CloudDriver(SERVER_ADDR, new TypeDBCredential("admin", "password", true));
Where 127.0.0.1:1729
is the address and port to connect to.
TypeDB::Driver driver = TypeDB::Driver::cloudDriver({"127.0.0.1:1729"}, TypeDB::Credential("admin", "password", true));
Where 127.0.0.1:1729
is the address and port to connect to.
Credential* credential = credential_new(
CLOUD_USERNAME,
CLOUD_PASSWORD,
"path/to/tls_root_ca",
true);
const char* addrs[] = {addr, NULL};
connection = connection_open_cloud(addrs, credential);
credential_drop(credential);
Where 127.0.0.1:1729
is the address and port to connect to.