Skip to content

TypeDB Core Concepts #958

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ Key responsibilities of a TypeDB driver include:
* **Query execution**: Sending TypeQL queries and processing results
* **Error handling**: Converting server errors into language-specific exceptions
* **Resource management**: Properly managing network resources and memory
* **Database management**: Create and delete databases
* **User management**: Create, delete, and manage users.

They also allow you to manage databases and users.
Check out the available xref:{page-version}@new_reference::typedb-grpc-drivers/index.adoc[gRPC drivers] and xref:{page-version}@new_reference::typedb-http-drivers/index.adoc[HTTP helper libraries] to find a driver that works for you.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange place to have it. Why not add it in the beginning

They provide a programming language-specific interface for all database operations, from connection management to query execution. Check the list of languages available here


== Communication endpoints

Expand Down
135 changes: 133 additions & 2 deletions new_core_concepts/modules/ROOT/pages/typedb/connections.adoc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this page exist here, given we have:

  • A dedicated page each for console and studio that already covers how to connect using them
  • A driver directory as a direct sibling of this one which covers the driver connections

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm honestly not sure. I don't think there's much to the concept of connections I can cover, so I just gave quickstart-level instructions to connect.

Original file line number Diff line number Diff line change
@@ -1,4 +1,135 @@
= Connections

[placeholder]
Managing connections in TypeDB server.
== Overview

To interact with a TypeDB database, a client application must first establish a connection to the server. This is typically done using a
xref:{page-version}@new_core_concepts::drivers/index.adoc[TypeDB driver] for your chosen programming language (e.g., Python, Java, Rust, Node.js) or through a tool like the TypeDB Console or TypeDB Studio.

A connection requires the server's address (host and port) and valid user credentials. For production environments, a secure connection using
TLS is strongly recommended.

== Connecting to TypeDB Cloud & Enterprise

[tabs]
====
Studio::
+
--
For a cloud deployment:

// include::../tools/studio.adoc[tag=connect_cloud_studio]
. In the https://cloud.typedb.com[TypeDB Cloud website], navigate to your cluster and click *Connect*. Then, click *Connect with TypeDB Studio*. This will launch TypeDB Studio.
. Fill in your password and hit *Connect*. Your password can be found in your downloaded credentials file (if you have one).

For an enterprise deployment:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come enterprise and not CE? Why does a cluster have a single address?


// include::../tools/studio.adoc[tag=connect_enterprise_studio]
. Launch TypeDB Studio.
. Enter the address of the HTTP endpoint of your cluster. By default, this is at port 8000.
. Enter your username and password.
. Click `Connect`.
--
Console::
+
--
Run Console in CLI:

//include::../tools/console.adoc[tag=connect_console]
.Connect to TypeDB
[source,console]
----
typedb console --address=<server-address> --username=<username>
----

You will be prompted for a password.
--

Comment on lines +11 to +46
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why bother at all here when they have there dedicated pages under /tools ?

====

== Connecting your application

For programmatic access, use one of the TypeDB xref:{page-component-version}@drivers::overview.adoc[drivers] via the network API:

[tabs]
====
Rust::
+
--
[,rust,indent=0]
----
let uri = format!("{}:{}", address, port);
include::{page-version}@drivers::partial$tutorials/rust/src/main.rs[tags=driver_new]
----

--

Python::
+
--
[,python,indent=0]
----
uri = f"{address}:{port}"
include::{page-version}@drivers::partial$tutorials/python/sample.py[tags=driver_new]
----
--
====

== Connecting to TypeDB Community Edition

[tabs]
====
Console::
+
--
Run Console in CLI:

//include::../tools/console.adoc[tag=connect_console]
.Connect to TypeDB
[source,console]
----
typedb console --address=<server-address> --username=<username> --tls-disabled
----

You will be prompted for a password.

TypeDB CE does not support encryption. Use `--tls-disabled` to connect without using TLS.
--

Studio::
+
--
// include::../tools/studio.adoc[tag=connect_ce_studio]
. Launch TypeDB Studio.
. Enter the address of the HTTP endpoint of your cluster. By default, this is at port 8000 and for local instances you can use `http://localhost:8000`.
. Enter your username and password - defaults are `admin` and `password`.
. Click `Connect`.
--
====

== Connecting your application

For programmatic access, use one of the TypeDB xref:{page-component-version}@drivers::overview.adoc[drivers] via the network API:

[tabs]
====
Rust::
+
--
[,rust,indent=0]
----
let uri = format!("{}:{}", address, port);
include::{page-version}@drivers::partial$tutorials/rust/src/main.rs[tags=driver_new]
----

--

Python::
+
--
[,python,indent=0]
----
uri = f"{address}:{port}"
include::{page-version}@drivers::partial$tutorials/python/sample.py[tags=driver_new]
----
--
====
Loading