spring-axum-mybatis 0.1.3

MyBatis-like SQL mapper integration for spring-axum via #[sql] and #[mapper].
Documentation

spring-axum-mybatis

MyBatis-like SQL mapper integration for spring-axum. Bind SQL to methods via the #[sql] and #[mapper] macros to simplify your data access layer.

Repository: https://gitee.com/luzhihaoTestingLab/spring-axum.git

Example

use spring_axum_macros::{mapper, sql};

#[derive(serde::Deserialize, serde::Serialize)]
struct User { id: i64, name: String }

#[mapper]
impl UserMapper {
    #[sql("SELECT id, name FROM users WHERE id = #{id}")]
    async fn find_by_id(&self, id: i64) -> anyhow::Result<User> { todo!() }
}

For more details, see the SQL/Mapper section in the root repository README.

License

MIT