Git Product home page Git Product logo

mybatis's People

Contributors

bors[bot] avatar dependabot[bot] avatar jackmacarthur avatar jzow avatar sh1-5 avatar xuhanfeng2219 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mybatis's Issues

Delete the test module, and some tests have no purpose

Is it possible to move the contents of mybatis test to the example module? Of course, test cases can also be added under each module. There is no need to pull out a separate test module, which is not used at present

Need to add a front-end page to the API interface

So far, there have been API interfaces related to users and nucleic acids, but there is no front-end page. At present, only a preliminary shelf has been built through vue-cli, and it is necessary to add assembly and draw pages

mybatis-sql module many match expression is unreachable

//value
impl BitXor<&Value> for Value {
    type Output = Value;
    fn op_bitxor(self, rhs: &Value) -> Self::Output {
        return match self {
            Value::Int32(s) => {
                let rhs = rhs.i32();
                return Value::Int32(s ^ rhs);
            }
            Value::Int64(s) => {
                let rhs = rhs.i64();
                return Value::Int64(s ^ rhs);
            }
            Value::UInt32(s) => {
                let rhs = rhs.u32();
                return Value::UInt32(s ^ rhs);
            }
            Value::UInt64(s) => {
                let rhs = rhs.u64();
                return Value::UInt64(s ^ rhs);
            }
            Value::Double(s) => {
                let rhs = rhs.as_f64().unwrap_or_default();
                return Value::Null;
            }
            _ => {
                return Value::Null;
            }
        };
    }
}

not should return match

Add the dependence of mybatis to Cargo.toml, I can't build project success, help me find the error please, thank you

I work on Windows system.
rustc version : rustc 1.63.0

cmd error info:

error[E0599]: no variant or associated item named ObjectId found for enum Bson in the current scope
--> C:\Users\admin.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-4f7dbcce21e258a2\mybatis-core-2.0.0\src\db\bind_pg.rs:119:15
|
119 | Bson::ObjectId(d) => {
| ^^^^^^^^ variant or associated item not found in Bson

error[E0599]: no variant or associated item named ObjectId found for enum Bson in the current scope
--> C:\Users\admin.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-4f7dbcce21e258a2\mybatis-core-2.0.0\src\db\bind_pg.rs:238:27
|
238 | Bson::ObjectId(d) => {
| ^^^^^^^^ variant or associated item not found in Bson

error[E0599]: no variant or associated item named ObjectId found for enum Bson in the current scope
--> C:\Users\admin.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-4f7dbcce21e258a2\mybatis-core-2.0.0\src\db\bind_mysql.rs:108:15
|
108 | Bson::ObjectId(d) => {
| ^^^^^^^^ variant or associated item not found in Bson

error[E0599]: no variant or associated item named ObjectId found for enum Bson in the current scope
--> C:\Users\admin.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-4f7dbcce21e258a2\mybatis-core-2.0.0\src\db\bind_sqlite.rs:108:15
|
108 | Bson::ObjectId(d) => {
| ^^^^^^^^ variant or associated item not found in Bson

error[E0599]: no variant or associated item named ObjectId found for enum Bson in the current scope
--> C:\Users\admin.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-4f7dbcce21e258a2\mybatis-core-2.0.0\src\db\bind_mssql.rs:105:15
|
105 | Bson::ObjectId(d) => {
| ^^^^^^^^ variant or associated item not found in Bson

error[E0599]: no variant or associated item named RegularExpression found for enum Bson in the current scope
--> C:\Users\admin.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-4f7dbcce21e258a2\mybatis-core-2.0.0\src\types\mod.rs:92:19
|
92 | Bson::RegularExpression(j) => { format!("{:?}", j) }
| ^^^^^^^^^^^^^^^^^ variant or associated item not found in Bson

error[E0599]: no variant or associated item named JavaScriptCode found for enum Bson in the current scope
--> C:\Users\admin.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-4f7dbcce21e258a2\mybatis-core-2.0.0\src\types\mod.rs:93:19
|
93 | Bson::JavaScriptCode(j) => { format!("{:?}", j) }
| ^^^^^^^^^^^^^^ variant or associated item not found in Bson

error[E0599]: no variant or associated item named JavaScriptCodeWithScope found for enum Bson in the current scope
--> C:\Users\admin.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-4f7dbcce21e258a2\mybatis-core-2.0.0\src\types\mod.rs:94:19
|
94 | Bson::JavaScriptCodeWithScope(j) => { format!("{:?}", j) }
| ^^^^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in Bson

error[E0599]: no variant or associated item named ObjectId found for enum Bson in the current scope
--> C:\Users\admin.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-4f7dbcce21e258a2\mybatis-core-2.0.0\src\types\mod.rs:131:19
|
131 | Bson::ObjectId(id) => {
| ^^^^^^^^ variant or associated item not found in Bson

error[E0599]: no variant or associated item named Symbol found for enum Bson in the current scope
--> C:\Users\admin.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-4f7dbcce21e258a2\mybatis-core-2.0.0\src\types\mod.rs:137:19
|
137 | Bson::Symbol(s) => { format!("{}", s) }
| ^^^^^^ variant or associated item not found in Bson

error[E0599]: no variant or associated item named Undefined found for enum Bson in the current scope
--> C:\Users\admin.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-4f7dbcce21e258a2\mybatis-core-2.0.0\src\types\mod.rs:141:19
|
141 | Bson::Undefined => {
| ^^^^^^^^^ variant or associated item not found in Bson

error[E0599]: no variant or associated item named MaxKey found for enum Bson in the current scope
--> C:\Users\admin.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-4f7dbcce21e258a2\mybatis-core-2.0.0\src\types\mod.rs:144:19
|
144 | Bson::MaxKey => { format!("{}", "MaxKey") }
| ^^^^^^ variant or associated item not found in Bson

error[E0599]: no variant or associated item named MinKey found for enum Bson in the current scope
--> C:\Users\admin.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-4f7dbcce21e258a2\mybatis-core-2.0.0\src\types\mod.rs:145:19
|
145 | Bson::MinKey => { format!("{}", "MinKey") }
| ^^^^^^ variant or associated item not found in Bson

error[E0599]: no variant or associated item named DbPointer found for enum Bson in the current scope
--> C:\Users\admin.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-4f7dbcce21e258a2\mybatis-core-2.0.0\src\types\mod.rs:146:19
|
146 | Bson::DbPointer(p) => { format!("{:?}", p) }
| ^^^^^^^^^ variant or associated item not found in Bson

For more information about this error, try rustc --explain E0599.
error: could not compile mybatis-core due to 14 previous errors

The code in response.rs should define an enumeration to mark the error type

use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct DataResponse<T> {
    pub code: i32,
    pub msg: String,
    pub data: T,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct SimpleResponse {
    pub code: i32,
    pub msg: String,
}

#[allow(dead_code)]
pub struct CodeResponse {
    pub code: i32,
}

#[allow(dead_code)]
impl <T> DataResponse<T> {
    pub fn new(code: i32, msg: String, data: T) -> DataResponse<T> {
        DataResponse {
            code,
            msg,
            data,
        }
    }
}

The code here should preferably be defined by enumeration, and the encapsulation method should be written as a custom method, which is more flexible

Clean up some unused crates

Many unused codes in macros and core modules should be cleared and added when necessary. They should not be added every time

cargo check

Reduce or eliminate warnings

expected enum `std::result::Result`, found `()`

关于 fmt 报错

#[derive(Debug)]
struct Structure(f32, f32, f32, f32);

#[test]
fn learn(){

    let matrx = Structure(1.1, 1.2, 2.1, 2.2);

    impl fmt::Display for Structure{
        fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result{
            write!(f, "({}, {})", self.0, self.1);
        }
    }
}

错误信息

error[E0308]: mismatched types
  --> src\Tuples.rs:59:50
   |
59 |         fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result{
   |            ---                                   ^^^^^^^^^^^ expected enum `std::result::Result`, found `()`
   |            |
   |            implicitly returns `()` as its body has no tail or `return` expression
60 |             write!(f, "({}, {})", self.0, self.1);
   |                                                  - help: consider removing this semicolon
   |
   = note:   expected enum `std::result::Result<(), std::fmt::Error>`
           found unit type `()`

Try to introduce two ORM frameworks for comparison

So far, I have done some business code development with SQL statements through mysql. Yesterday, I checked the rbatis framework and diesel framework. These two frameworks simplify that developers do not need to write SQL manually. They can encapsulate SQL dialect and interact with mysql through some methods and API

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.