Hello!
I am currently working on an implementation of an Ecto Adapter for XTDB v2.x. 2.x is not a production-ready version, but I just wanted to try to make this project as a way to learn more about Elixir and XTDB as well.
So first of course I would need to create a DB driver for Elixir. XTDB has an HTTP API so I figured I will implement the driver using that as the protocol.
To create a driver, it seems standard that you should implement the DBConnection.Connection behavior. I just have a few struggles with this.
1.) From looking at other DBConnection implementations (MyXQL, Postgrex), they all seem to implement their database-specific protocols via TCP. Then DBConnection is somehow able to keep these TCP connections alive (via pinging?). My question is, how would one implement a DBConnection for an HTTP based protocol, specifically for the ping callback. To my understanding, HTTP is stateless, so I don’t think there is a realistic way to implement ping for this. Should I just leave it undefined and force :idle_interval = 0? Which brings me to my next question…
2.) Is there anything to be gained from implementing DBConnection for an HTTP based protocol? The main value-gain from implementing DBConnection seems to be that it is able to pool and maintain open TCP connections. I don’t know if there are other benefits, but if this is not applicable to HTTP, then should I bother with implementing it in the first place?
Sorry if these are ill-informed questions, as my knowledge of network protocols is very low. Any advice is appreciated, thank you!






















