overview.edoc 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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="https://www.gnu.org/graphics/lgplv3-88x31.png" width="88" height="31"
  23. style="float:right"/>
  24. This library is free software licensed under the GNU LGPL which allows you to
  25. use it in non-free applications and applications with other licenses. This
  26. documentation is generated from the source code and thus goes under the same
  27. license as the library itself.
  28. <h2>API functions</h2>
  29. The <a href="mysql.html">mysql</a> module contains all the API
  30. functions for connecting to and interacting with a MySQL server.
  31. The <a href="mysql_connection.html">mysql_connection</a> module is the
  32. `gen_server' callback module holding a connection so you may want to refer to
  33. that sometimes (e.g. in the Modules part in a childspec for a supervisor). The
  34. other modules are for the internals.
  35. <h2>Value representation</h2>
  36. <table>
  37. <thead>
  38. <tr>
  39. <th>MySQL</th>
  40. <th>Erlang</th>
  41. <th>Example</th>
  42. </tr>
  43. </thead>
  44. <tbody>
  45. <tr>
  46. <td>INT, TINYINT, etc.</td>
  47. <td>`integer()'</td>
  48. <td>`42'</td>
  49. </tr>
  50. <tr>
  51. <td>VARCHAR, TEXT, etc.</td>
  52. <td>`iodata()'</td>
  53. <td>`<<"foo">>, "bar"'</td>
  54. </tr>
  55. <tr>
  56. <td>FLOAT, DOUBLE</td>
  57. <td>`float()'</td>
  58. <td>`3.14'</td>
  59. </tr>
  60. <tr>
  61. <td>DECIMAL</td>
  62. <td>`binary()'</td>
  63. <td>`<<"3.140">>'</td>
  64. </tr>
  65. <tr>
  66. <td>DATETIME, TIMESTAMP</td>
  67. <td>`calendar:datetime()'</td>
  68. <td>`{{2014, 11, 18}, {10, 22, 36}}'</td>
  69. </tr>
  70. <tr>
  71. <td>DATE</td>
  72. <td>`calendar:date()'</td>
  73. <td>`{2014, 11, 18}'</td>
  74. </tr>
  75. <tr>
  76. <td>TIME</td>
  77. <td>`{Days, calendar:time()}'</td>
  78. <td>`{0, {10, 22, 36}}'</td>
  79. </tr>
  80. <tr>
  81. <td>NULL</td>
  82. <td>`null'</td>
  83. <td>`null'</td>
  84. </tr>
  85. </tbody>
  86. </table>
  87. <h2>Example with Poolboy</h2>
  88. TODO