You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes we need some initial settings for the connected database and sometimes we need to gather some information from the connected server. (such as protocol version, server version,...) I already added some codes for CockroachDB to check the version of engine so we can handle version differences. In my opinion, the best chance to get that information is when we connect to it very first time.
Especially for CockroachDB, I found that transaction handling code is all of there own driver. (I cannot sure for now we can use that code or not, anyway.) And sometimes, we need to do some action for specific database engine when we get a new session (individual connections) and the NewTransaction() is the best place to do it.
Please think about my proposal and give me your opinions!
Thanks
The text was updated successfully, but these errors were encountered:
Hi, all!
I want to try to make a change on
connection.go
. The goals are:(It is indirectly related to #281)
Details
Current ideas are:
For
Connection.Open()
Sometimes we need some initial settings for the connected database and sometimes we need to gather some information from the connected server. (such as protocol version, server version,...) I already added some codes for CockroachDB to check the version of engine so we can handle version differences. In my opinion, the best chance to get that information is when we connect to it very first time.
So I will try to add something like:
and with
ConnectCallBack()
, we can add some database specific codes to initial setup and/or to get some information.For
NewTransaction()
I think transaction handling should be moved to dialect completely since there are some differences on transaction handling.
Especially for CockroachDB, I found that transaction handling code is all of there own driver. (I cannot sure for now we can use that code or not, anyway.) And sometimes, we need to do some action for specific database engine when we get a new session (individual connections) and the
NewTransaction()
is the best place to do it.Please think about my proposal and give me your opinions!
Thanks
The text was updated successfully, but these errors were encountered: