overview.edoc 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. MySQL/OTP – MySQL client library for Erlang/OTP
  2. Copyright (C) 2014 Viktor Söderqvist
  3. This file is part of MySQL/OTP.
  4. MySQL/OTP is free software: you can redistribute it and/or modify it under
  5. the terms of the GNU Lesser General Public License as published by the Free
  6. Software Foundation, either version 3 of the License, or (at your option)
  7. any later version.
  8. This program is distributed in the hope that it will be useful, but WITHOUT
  9. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  11. more details.
  12. You should have received a copy of the GNU Lesser General Public License
  13. along with this program. If not, see <https://www.gnu.org/licenses/>.
  14. ------------------------------------------------------------------------
  15. @title MySQL/OTP client library
  16. @doc
  17. This is the documentation generated from the Erlang source code using EDoc.
  18. The source code is available on the github page <a target="_top"
  19. href="https://github.com/mysql-otp/mysql-otp/">
  20. https://github.com/mysql-otp/mysql-otp/</a> along with a wiki and an issue
  21. tracker.
  22. <img src="LGPLv3_Logo.svg" width="100" height="43" style="float:right"/>
  23. This library is free software licensed under the GNU LGPL which allows you to
  24. include it in any application, regardless its license, free or proprietary. This
  25. documentation is generated from the source code and thus has the same license as
  26. the library itself.
  27. <h2>API functions</h2>
  28. The <a href="mysql.html">mysql</a> module contains all the API
  29. functions for connecting to and interacting with a MySQL server.
  30. The <a href="mysql_connection.html">mysql_connection</a> module is the
  31. `gen_server' callback module holding a connection so you may want to refer to
  32. that sometimes (e.g. in the Modules part in a childspec for a supervisor). The
  33. other modules are for the internals.
  34. <h2>Value representation</h2>
  35. <table>
  36. <thead>
  37. <tr>
  38. <th>MySQL</th>
  39. <th>Erlang</th>
  40. <th>Example</th>
  41. </tr>
  42. </thead>
  43. <tbody>
  44. <tr>
  45. <td>INT, TINYINT, etc.</td>
  46. <td>`integer()'</td>
  47. <td>`42'</td>
  48. </tr>
  49. <tr>
  50. <td>VARCHAR, TEXT, etc.</td>
  51. <td>`iodata()'</td>
  52. <td>`<<"foo">>, "bar"'</td>
  53. </tr>
  54. <tr>
  55. <td>FLOAT, DOUBLE</td>
  56. <td>`float()'</td>
  57. <td>`3.14'</td>
  58. </tr>
  59. <tr>
  60. <td>DECIMAL</td>
  61. <td>`binary()'</td>
  62. <td>`<<"3.140">>'</td>
  63. </tr>
  64. <tr>
  65. <td>DATETIME, TIMESTAMP</td>
  66. <td>`calendar:datetime()'</td>
  67. <td>`{{2014, 11, 18}, {10, 22, 36}}'</td>
  68. </tr>
  69. <tr>
  70. <td>DATE</td>
  71. <td>`calendar:date()'</td>
  72. <td>`{2014, 11, 18}'</td>
  73. </tr>
  74. <tr>
  75. <td>TIME</td>
  76. <td>`{Days, calendar:time()}'</td>
  77. <td>`{0, {10, 22, 36}}'</td>
  78. </tr>
  79. <tr>
  80. <td>NULL</td>
  81. <td>`null'</td>
  82. <td>`null'</td>
  83. </tr>
  84. </tbody>
  85. </table>
  86. <h2>Example with Poolboy</h2>
  87. TODO