{"id":18728636,"url":"https://github.com/rubyonworld/rust_mysql_common","last_synced_at":"2026-04-30T14:32:01.349Z","repository":{"id":174008142,"uuid":"533346768","full_name":"RubyOnWorld/rust_mysql_common","owner":"RubyOnWorld","description":"This crate is an implementation of basic MySql protocol primitives.","archived":false,"fork":false,"pushed_at":"2022-09-13T21:59:07.000Z","size":4151,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-19T20:32:29.467Z","etag":null,"topics":["crate","mysql","primitive","protocol"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RubyOnWorld.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-09-06T13:51:40.000Z","updated_at":"2022-09-27T22:27:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"c281ab94-3d12-496e-b48c-a23328ce7d51","html_url":"https://github.com/RubyOnWorld/rust_mysql_common","commit_stats":null,"previous_names":["rubyonworld/rust_mysql_common"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/RubyOnWorld/rust_mysql_common","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Frust_mysql_common","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Frust_mysql_common/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Frust_mysql_common/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Frust_mysql_common/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RubyOnWorld","download_url":"https://codeload.github.com/RubyOnWorld/rust_mysql_common/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Frust_mysql_common/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32468009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crate","mysql","primitive","protocol"],"created_at":"2024-11-07T14:22:30.917Z","updated_at":"2026-04-30T14:32:01.341Z","avatar_url":"https://github.com/RubyOnWorld.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Gitter](https://badges.gitter.im/rust-mysql/community.svg)](https://gitter.im/rust-mysql/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n\n[![Crates.io](https://img.shields.io/crates/v/mysql_common.svg)](https://crates.io/crates/mysql_common)\n[![Docs.rs](https://docs.rs/mysql_common/badge.svg)](https://docs.rs/mysql_common)\n[![Build Status](https://travis-ci.org/blackbeam/rust_mysql_common.svg?branch=master)](https://travis-ci.org/blackbeam/rust_mysql_common)\n\n# mysql_common\n\nThis crate is an implementation of basic MySql protocol primitives.\n\nThis crate:\n* defines basic MySql constants;\n* implements necessary functionality for MySql `cached_sha2_password`,\n  `mysql_native_password` and legacy authentication plugins;\n* implements helper traits for MySql protocol IO;\n* implements support of named parameters for prepared statements;\n* implements parsers for a subset of MySql protocol packets (including binlog packets);\n* defines rust representation of MySql protocol value and row;\n* implements conversion between MySql values and rust types, between MySql rows and tuples\n  of rust types.\n\n### Supported rust types\n\nCrate offers conversion from/to MySql values for following types (please see MySql documentation\non supported ranges for numeric types). Following table refers to MySql protocol types\n(see `Value` struct) and not to MySql column types. Please see [MySql documentation][1] for\ncolumn and protocol type correspondence:\n\n| Type                                 | Notes                                                     |\n| ------------------------------------ | -------------------------------------------------------   |\n| `{i,u}8..{i,u}128`, `{i,u}size`      | MySql int/uint will be converted, bytes will be parsed.\u003cbr\u003e⚠️ Note that range of `{i,u}128` is greater than supported by MySql integer types but it'll be serialized anyway (as decimal bytes string). |\n| `f32`                                | MySql float will be converted to `f32`, bytes will be parsed as `f32`.\u003cbr\u003e⚠️ MySql double won't be converted to `f32` to avoid precision loss (see #17) |\n| `f64`                                | MySql float and double will be converted to `f64`, bytes will be parsed as `f64`. |\n| `bool`                               | MySql int {`0`, `1`} or bytes {`\"0x30\"`, `\"0x31\"`}        |\n| `Vec\u003cu8\u003e`                            | MySql bytes                                               |\n| `String`                             | MySql bytes parsed as utf8                                |\n| `Duration` (`std` and `time`)        | MySql time or bytes parsed as MySql time string           |\n| [`time::PrimitiveDateTime`] (v0.2.x) | MySql date time or bytes parsed as MySql date time string (⚠️ lossy! microseconds are ignored)           |\n| [`time::Date`] (v0.2.x)              | MySql date or bytes parsed as MySql date string (⚠️ lossy! microseconds are ignored)           |\n| [`time::Time`] (v0.2.x)              | MySql time or bytes parsed as MySql time string (⚠️ lossy! microseconds are ignored)           |\n| [`time::Duration`] (v0.2.x)          | MySql time or bytes parsed as MySql time string           |\n| [`time::PrimitiveDateTime`] (v0.3.x) | MySql date time or bytes parsed as MySql date time string (⚠️ lossy! microseconds are ignored)           |\n| [`time::Date`] (v0.3.x)              | MySql date or bytes parsed as MySql date string (⚠️ lossy! microseconds are ignored)           |\n| [`time::Time`] (v0.3.x)              | MySql time or bytes parsed as MySql time string (⚠️ lossy! microseconds are ignored)           |\n| [`time::Duration`] (v0.3.x)          | MySql time or bytes parsed as MySql time string           |\n| [`chrono::NaiveTime`]                | MySql date or bytes parsed as MySql date string           |\n| [`chrono::NaiveDate`]                | MySql date or bytes parsed as MySql date string           |\n| [`chrono::NaiveDateTime`]            | MySql date or bytes parsed as MySql date string           |\n| [`uuid::Uuid`]                       | MySql bytes parsed using `Uuid::from_slice`               |\n| [`serde_json::Value`]                | MySql bytes parsed using `serde_json::from_str`           |\n| `mysql_common::Deserialized\u003cT : DeserializeOwned\u003e` | MySql bytes parsed using `serde_json::from_str` |\n| `Option\u003cT: FromValue\u003e`               | Must be used for nullable columns to avoid errors         |\n| [`decimal::Decimal`]                 | MySql int, uint or bytes parsed using `Decimal::from_str`.\u003cbr\u003e⚠️ Note that this type doesn't support full range of MySql `DECIMAL` type. |\n| [`bigdecimal::BigDecimal`] (v0.2.x)  | MySql int, uint, floats or bytes parsed using `BigDecimal::parse_bytes`.\u003cbr\u003e⚠️ Note that range of this type is greater than supported by MySql `DECIMAL` type but it'll be serialized anyway. |\n| [`bigdecimal::BigDecimal`] (v0.3.x)  | MySql int, uint, floats or bytes parsed using `BigDecimal::parse_bytes`.\u003cbr\u003e⚠️ Note that range of this type is greater than supported by MySql `DECIMAL` type but it'll be serialized anyway. |\n| `num_bigint::{BigInt, BigUint}`      | MySql int, uint or bytes parsed using `_::parse_bytes`.\u003cbr\u003e⚠️ Note that range of this type is greater than supported by MySql integer types but it'll be serialized anyway (as decimal bytes string). |\n\nAlso crate provides from-row convertion for the following list of types (see `FromRow` trait):\n\n| Type                                            | Notes                                             |\n| ----------------------------------------------- | ------------------------------------------------- |\n| `Row`                                           | Trivial conversion for `Row` itself.              |\n| `T: FromValue`                                  | For rows with a single column.                    |\n| `(T1: FromValue [, ..., T12: FromValue])`       | Row to a tuple of arity 1-12.                     |\n| [`frunk::Hlist!`] types                         | Usefull to overcome tuple arity limitation        |\n\n#### Crate features\n\n| Feature        | Description                                 | Default |\n| -------------- | ------------------------------------------- | ------- |\n| `bigdecimal`   | Enables `bigdecimal` v0.2.x types support   | 🔴      |\n| `bigdecimal03` | Enables `bigdecimal` v0.3.x types support   | 🟢      |\n| `chrono`       | Enables `chrono` types support              | 🔴      |\n| `rust_decimal` | Enables `rust_decimal` types support        | 🟢      |\n| `time`         | Enables `time` v0.2.x types support         | 🔴      |\n| `time03`       | Enables `time` v0.3.x types support         | 🟢      |\n| `uuid`         | Enables `Uuid` type support                 | 🟢      |\n| `frunk`        | Enables `FromRow` for `frunk::Hlist!` types | 🟢      |\n\n[1]: https://dev.mysql.com/doc/internals/en/binary-protocol-value.html\n\n## License\n\nLicensed under either of\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\nat your option.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any\nadditional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyonworld%2Frust_mysql_common","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubyonworld%2Frust_mysql_common","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyonworld%2Frust_mysql_common/lists"}