[Elixir] Idea #2: Idea #2: A new MySQL driver for Ecto

161 views
Skip to first unread message

Maqbool

unread,
Jan 29, 2018, 11:48:39 AM1/29/18
to BEAM Community
Hi Mentors,

I am Maqbool an undergraduate student from Delhi, India. Also I co-organize the elixirdelhi meetup and wish to contribute to the elixir project.

I did some research on this particular idea of driver and had a conversation with the mentor Michał Muskała about this project. Goals of project is to build a driver for MySQL db. Driver is that component which in responsible for connecting to the database and executes SQL queries and each of the of driver use db_connection as the base.

I quote Michał on db_connection

"The project implements an abstract notion of a database driver, and requires the actual driver to implement the protocol handling."

so i'll be diving into postgrex driver implementation and will be going to prototype "decoding and encoding the data sent on the wire" it's recommended  by him where to start project itself. 

I'll be using this thread for further clarification and update about the project 

Thank You 

Mohd Maqbool Alam

José Valim

unread,
Jan 29, 2018, 2:17:12 PM1/29/18
to Maqbool, BEAM Community
Welcome Maqbool and please do let us know of any questions!



José Valim
Founder and 
Director of R&D
Message has been deleted

Maqbool

unread,
Feb 19, 2018, 8:07:14 AM2/19/18
to BEAM Community
Hi Jose,

 I got quite acquainted with client-server protocol thanks to Michał I want to know the scope of the project it will be written from the scratch?

and should I use db_connection or connection behavior for the prototype It makes sense to play with that for the connection handling 

Thanks

Maqbool

José Valim

unread,
Feb 19, 2018, 8:59:43 AM2/19/18
to Maqbool, BEAM Community
Getting started with db_connection and starting a basic implementation of the MySQL handshake is a good next step! :+1:



José Valim
Founder and 
Director of R&D

Maqbool

unread,
Feb 19, 2018, 9:35:07 AM2/19/18
to José Valim, BEAM Community
Thanks, Jose 

I will soon share the handshake Request and Response Packet basic implementation.


Mohd Maqbool Alam

Maqbool

unread,
Feb 25, 2018, 2:47:17 AM2/25/18
to BEAM Community
Hi, Jose

I have implemented the parsing of initial handshake packet please take a look at the repo[1]  MySQL docs are terrible I think this project needs a lot internal documentation MySQL docs are very hard to follow sometimes I think internal docs are really important for this project. 

I'll be pushing the response packet implementation hopefully by midnight anything you want me do after this implementation i have got quite an experience in maraiex source code the macros parts are quite confusing. 



Thank you
Mohd Maqbool Alam

Maqbool

unread,
Mar 5, 2018, 5:53:19 AM3/5/18
to BEAM Community
Ping 

José Valim

unread,
Mar 5, 2018, 7:00:40 AM3/5/18
to Maqbool, BEAM Community
Apologies for the lack of replies, I missed your first email.

Your code looks good and you are using DBConnection, which is a requirement. That's great!

One thing you need to consider, although it is not required now before submitting a proposal, is how the test suite will be structured.

It may also be important to figure out which SQL versions we are going to support. Although, given the lack of documentation around this, it would be understandable if we discover those only during the project and not at the proposal stage.

We are looking forward to your proposal!



José Valim
Founder and 
Director of R&D

Maqbool

unread,
Mar 7, 2018, 9:04:10 AM3/7/18
to BEAM Community
Hello Jose, 

I'm sorry for late reply, I was looking into which version should we support. I had a small discussion with James Fish where I proposed two possible cases I was thinking either by 

1. MySQL latest release[1]
   In this case, latest release was in the month January for 5.5, 5.6 and 5.7 version of db
  
2. EOF packet deprecation[2]
   The MySQL server sends OK  or EOF packet after the end of the query though both of them are similar 2 different packets are used for the same kind of work which is quite redundant so they deprecate it. Now only OK packet is got sends at the end of the query result. so we could drop the support for EOF packet in our driver and MYSQL server supports EOF packet  
 In this case, James Fish said "I think the driver is much simplified if it doesn't support EOF"

I'm more inclined towards the second option though. What do you think about this you have any suggestion which version should we support?

Now for tests, I didn't look into this though but we could take inspiration from postgrex and mariaex tests what do you think?



Mohd Maqbool Alam

José Valim

unread,
Mar 7, 2018, 11:52:44 AM3/7/18
to BEAM Community
Let's go with EOF packet deprecation. Mariaex would still be available for people who need previous versions.
 
Now for tests, I didn't look into this though but we could take inspiration from postgrex and mariaex tests what do you think?

Definitely. Although they were written a long time ago and could probably be better structured. For example, they could at least use the describe blocks added to Elixir.

Thanks for the info!

Maqbool

unread,
Mar 27, 2018, 8:47:22 PM3/27/18
to BEAM Community
Hello Jose,

I have submitted my proposal looking  forward to working on the project MySQL  driver for ecto 

Let me know if you have any question
Reply all
Reply to author
Forward
0 new messages