Browse Source

Rename program and improve language

Albin Söderqvist 10 years ago
parent
commit
66a66acc85
3 changed files with 31 additions and 39 deletions
  1. 11 19
      README.md
  2. 5 5
      src/mysql_poolboy.app.src
  3. 15 15
      src/mysql_poolboy.erl

+ 11 - 19
README.md

@@ -1,24 +1,20 @@
-MySQL/OTP - poolboy
-=================
+MySQL/OTP + Poolboy
+===================
 
-MySQL/OTP - poolboy is a wrapper for MySQL/OTP and poolboy where you create pools for MySQL/OTP.
-Each application is responsible to supervise the pools by themself, MySQL/OTP - poolboy will not handle
-it.
+MySQL/OTP + Poolboy is a wrapper for [MySQL/OTP](//github.com/mysql-otp/mysql-otp) and
+[Poolboy](//github.com/devinus/poolboy) where you create connection pools for the former. 
+Each application is itself responsible for supervising the pools, i.e. MySQL/OTP + Poolboy won't
+do it for you.
 
 Features:
 
 * Simple pool creation
-* Convenience function to do querys and transactions
-
-See also:
-
-* [MySQL/OTP](//github.com/mysql-otp/mysql-otp)
-* [Poolboy](//github.com/devinus/poolboy)
+* Convenience function to do queries and transactions
 
 Examples:
 ```Erlang
-%% Create a pool with 5 connection and allow another 5 if they are none available.
-%% returns a supvervise:child_spec()
+%% Creates a pool with 5 connections and allows another 5 if there are none available.
+%% Returns a supvervise:child_spec()
 mysql_poolboy:add_pool(
     {mypool, [{size, 5}, {max_overflow, 10}],
      [{host, "localhost"}, {user, "foo"}, {password, "hello"}, {database, "test"}]}
@@ -40,9 +36,5 @@ License
 
 GNU Lesser General Public License (LGPL) version 3 or any later version.
 Since the LGPL is a set of additional permissions on top of the GPL, both
-license texts are included in the files [COPYING](COPYING) and
-[COPYING.LESSER](COPYING.LESSER) respectively.
-
-We hope this license should be permissive enough while remaining copyleft. If
-you're having issues with this license, please create an issue in the issue
-tracker!
+license texts are included in the files [COPYING.LESSER](COPYING.LESSER) and
+[COPYING](COPYING) respectively.

+ 5 - 5
src/mysql_poolboy.app.src

@@ -1,22 +1,22 @@
-%% MySQL/OTP - Poolboy handler
+%% MySQL/OTP + Poolboy
 %% Copyright (C) 2014 Raoul Hess
 %%
-%% This file is part of MySQL/OTP - Poolboy handler.
+%% This file is part of MySQL/OTP + Poolboy.
 %%
-%% MySQL/OTP is free software: you can redistribute it and/or modify it under
+%% MySQL/OTP + Poolboy is free software: you can redistribute it and/or modify it under
 %% the terms of the GNU Lesser General Public License as published by the Free
 %% Software Foundation, either version 3 of the License, or (at your option)
 %% any later version.
 %%
 %% This program is distributed in the hope that it will be useful, but WITHOUT
 %% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-%% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+%% FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
 %% more details.
 %%
 %% You should have received a copy of the GNU Lesser General Public License
 %% along with this program. If not, see <https://www.gnu.org/licenses/>.
 {application, mysql_poolboy, [
-    {description, "MySQL/OTP - Poolboy handler"},
+    {description, "MySQL/OTP + Poolboy"},
     {vsn, "0.0.1"},
     {modules, []}
 ]}.

+ 15 - 15
src/mysql_poolboy.erl

@@ -1,16 +1,16 @@
-%% MySQL/OTP - Poolboy handler
+%% MySQL/OTP + Poolboy
 %% Copyright (C) 2014 Raoul Hess
 %%
-%% This file is part of MySQL/OTP - Poolboy handler.
+%% This file is part of MySQL/OTP + Poolboy.
 %%
-%% MySQL/OTP is free software: you can redistribute it and/or modify it under
+%% MySQL/OTP + Poolboy is free software: you can redistribute it and/or modify it under
 %% the terms of the GNU Lesser General Public License as published by the Free
 %% Software Foundation, either version 3 of the License, or (at your option)
 %% any later version.
 %%
 %% This program is distributed in the hope that it will be useful, but WITHOUT
 %% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-%% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+%% FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
 %% more details.
 %%
 %% You should have received a copy of the GNU Lesser General Public License
@@ -21,52 +21,52 @@
 -export([add_pools/1, add_pool/1, checkout_connection/1, checkin_connection/2,
          query/2, query/3, query/4, transaction/2, transaction/3]).
 
-%% @doc Creates pools from a list. Returning a list of supervisor:child_spec().
-%%      Each application should supervise these specification themself if needed.
+%% @doc Creates pools from a list and returns a list of supervisor:child_spec().
+%%      If needed, each application should itself supervise these specifications.
 add_pools(Pools) ->
     lists:map(fun (PoolData) -> add_pool(PoolData) end, Pools).
 
-%% @doc Creates a pool with the given arguments returning a supervisor:child_spec()
-%%      Each application should supervise these specification themself if needed.
+%% @doc Creates a pool with the given arguments and returns a supervisor:child_spec()
+%%      If needed, each application should itself supervise these specifications.
 add_pool({PoolName, PoolSizeArgs, MysqlArgs}) ->
     PoolArgs = [{name, {local, PoolName}}, {worker_module, mysql}] ++ PoolSizeArgs,
     poolboy:child_spec(PoolName, PoolArgs, MysqlArgs).
 
 %% Shorthand/convenience functions.
 
-%% @doc Checkouts a mysql connection from a given pool.
+%% @doc Checks out a mysql connection from a given pool.
 checkout_connection(PoolName) ->
     poolboy:checkout(PoolName).
 
-%% @doc Return a mysql connection to a pool when done with it.
+%% @doc Returns a mysql connection to a pool when done with it.
 checkin_connection(PoolName, Connection) ->
     poolboy:checkin(PoolName, Connection).
 
-%% @doc Execute a query to a mysql connection in a given pool.
+%% @doc Executes a query to a mysql connection in a given pool.
 query(PoolName, Query) ->
     poolboy:transaction(PoolName, fun(MysqlConn) ->
         mysql:query(MysqlConn, Query)
     end).
 
-%% @doc Execute a query to a mysql connection in a given pool.
+%% @doc Executes a query to a mysql connection in a given pool.
 query(PoolName, Query, ParamsOrTimeout) ->
     poolboy:transaction(PoolName, fun(MysqlConn) ->
         mysql:query(MysqlConn, Query, ParamsOrTimeout)
     end).
 
-%% @doc Execute a query to a mysql connection in a given pool.
+%% @doc Executes a query to a mysql connection in a given pool.
 query(PoolName, Query, Params, Timeout) ->
     poolboy:transaction(PoolName, fun(MysqlConn) ->
         mysql:query(MysqlConn, Query, Params, Timeout)
     end).
 
-%% @doc Execute a transaction fun. A connection will be supplied by the pool.
+%% @doc Executes a transaction fun. A connection will be supplied by the pool.
 transaction(PoolName, TransactionFun) ->
     poolboy:transaction(PoolName, fun(MysqlConn) ->
         mysql:transaction(MysqlConn, TransactionFun)
     end).
 
-%% @doc Execute a transaction fun. A connection will be supplied by the pool.
+%% @doc Executes a transaction fun. A connection will be supplied by the pool.
 transaction(PoolName, TransactionFun, Args) ->
     poolboy:transaction(PoolName, fun(MysqlConn) ->
         mysql:transaction(MysqlConn, TransactionFun, Args)