records.hrl 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. %% --- Records ---
  2. %% Returned by parse_handshake/1.
  3. -record(handshake, {server_version :: binary(),
  4. connection_id :: integer(),
  5. capabilities :: integer(),
  6. character_set :: integer(),
  7. status :: integer(),
  8. auth_plugin_data :: binary(),
  9. auth_plugin_name :: binary()}).
  10. %% OK packet, commonly used in the protocol.
  11. -record(ok, {affected_rows :: integer(),
  12. insert_id :: integer(),
  13. status :: integer(),
  14. warning_count :: integer(),
  15. msg :: binary()}).
  16. %% Error packet, commonly used in the protocol.
  17. -record(error, {code, state, msg}).
  18. %% EOF packet, commonly used in the protocol.
  19. -record(eof, {status, warning_count}).
  20. %% Column definition, used while parsing a result set.
  21. -record(column_definition, {name, type, charset}).
  22. %% A resultset as received from the server using the text protocol.
  23. %% All values are binary (SQL code) except NULL.
  24. -record(text_resultset, {column_definitions :: [#column_definition{}],
  25. rows :: [[binary() | null]]}).
  26. %% Response of a successfull prepare call.
  27. -record(prepared, {statement_id :: integer(),
  28. params :: [#column_definition{}],
  29. columns :: [#column_definition{}],
  30. warning_count :: integer()}).