Merged
Conversation
In a handful of places in emysql_util, there were a few calls to emysql_util:do_something(), I just removed the extraneous emysql_util: prefixes.
All in the name of not requiring the programmer to include the emysql.hrl file.
This is just done to make the calls more consistent. Previously, in some places, it was is_record(result_packet), and in others it was Res = #result_packet. This just makes all calls in util consistent. Also, I fixed the ordering of the previously introduced functions insert_id/1 and affected_rows/1, which were originally put in the -export without being alphabetical. So I made them alphabetical.
This is a more straightforward way for a user to determine the packet type, rather than having to do element(1, Packet).
Perhaps there was a performance reason for doing array:to_list(array:new(length(FieldNames))), but in my non-scientific benchmarks, it appeared to mostly (but only marginally) faster to use lists:duplicate, and frankly, I think it's a little clearer what's going on with lists:duplicate, since it's a single function call rather than having to know that a new empty array of size X will return a list of X undefined atoms from array:to_list.
Improve performance when retrieving large blobs
Relevant changes:
.gitignore: Made so the autogenerated crypto_compat.hrl file is not
included in source control. It should be ignored because of its
autogenerated nature
Makefile: Add `make crypto_compat` rule, and make sure it runs before
compiling the modules.
rebar.config: Added so that apps that use rebar for dependencies can
take advantage of Rebar's pre_hooks capability
emysql_auth: Modified the password generation to use the generated
Macros instead of straight calls.
support/crypto_compat.escript: The script that generates the
include/crypto_compat.hrl file.
Also fix "can never match" error found by dialyzer.
emysql_tcp:response returns {Packet, Status, Buff}, whereas line 61 of
emysql_auth was trying to match against {{Packet}, _}, Buff}, an
incompatible match.
In this case, Packet was an #error_packet{} record.
There are two changes here: 1. Associate a connect timeout for a pool 2. Add add_pool/2, which uses the arg + options API convention in Erlang == Connect timeout To reasonably support connect problems, the module must support a configurable connect timeout, which is used in gen_tcp:connect/3. This can now be specified using add_pool/2. add_pool/8, and add_pool/9 use the atom infinity, which results in the original connect behvior -- i.e. this is a backward compatible change. == add_pool/2 The eight+ argument add_pool function is a complete PITA to use and is not easily enhanced - it should have been done away with a long time ago in favor of add_pool/2, which uses required arg + options list to manage the complexity of the API. add_pool/2 requires the pool ID, but uses sensible defaults for all other values. To stop the madness, I'm not exporting add_pool/10 (which does the work in this implementation). If someone needs a connect timeout, he/she should use add_pool/2. I'd like to see the doc updated to use add_pool/2, but won't presume to do this. We could export add_pool/10, but really, does the world need another add_pool arity?
…ol that already exists.
Conflicts: src/emysql.app.src
Fix formatting, code errors and indentation in README
Adding type specs to emysql.hrl
Add collation support for connection
More Dialyzer
Added types for the other records in emysql.hrl
Adds an option to fetch and log warnings
…ing under Erlang 16
Fix a typespec error for Erlang 17 of dict() becoming dict:dict()
manuel-rubio
added a commit
that referenced
this pull request
Apr 14, 2015
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.