V
V
valter_bas2020-11-22 21:07:53
Database
valter_bas, 2020-11-22 21:07:53

How does the driver connect to the database?

How the driver connects to the database. As I understand it, this should be some kind of request, like http, or a connection via TCP, if so, what is contained in this request, where you can read about it in detail, there are some articles, books, or at least open source code where it is can you see?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vasily Bannikov, 2020-11-22
@valter_bas

Each database has its own api - it can be both on TCP and HTTP. Usually, it is documented somewhere for driver developers, but not always.
For example, clickhouse has a documented HTTP-api , but not a documented TCP, but this does not really bother people, because the sources are open .
Here, for example, is the implementation of the postgresql driver in C#: https://github.com/npgsql/npgsql/tree/main/src/Npgsql
Here it is, but in Java: https://github.com/pgjdbc/pgjdbc
In 99% of cases, there is no point in developing your own driver, because this is not such an easy task, and DBMS developers are already writing down their implementations for the most popular platforms.

N
NewDevLab, 2020-11-22
@NewDevLab

the driver can implement and connect through the physical medium that the server has an implementation of. for example, you can connect to MsSql via shared memory, pipe, or tcp/ip. Accordingly, the native driver from MS implements all three connection methods. Although one, for example, another driver could. The way the driver and the DBMS communicate is the application level, and, for example, MsSql is closed, as far as I know.
There are sources in OpenSource MySql, you can have a look.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question