wansenai / mybatis Goto Github PK
View Code? Open in Web Editor NEWObject relational mapping SQL framework for Rust
License: Other
Object relational mapping SQL framework for Rust
License: Other
At present, when running in dev environment, the log cannot be seen. You can only see the log when you run the cargo run
log. In this way, if it is unreasonable to deploy in test environment and prod environment,
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
关于 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 `()`
//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
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
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
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
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
The code under some modules is not referenced. There is a warning during compilation and should be handled.
Modify the package of the warehouse to be the same as MyBatis
The code should be distinguished according to different learning channels or project examples, so as to be clearer
After adding documents, you have to update Cargo.toml file, add home page and document.
没有xml的写法?感觉失去了灵魂
summer-mybatis/runs/7086037298
This error is reported when GitHub CI action is running. It should be further checked and repaired
This document is required, but it is not available in the current v-1.0.8 version
Because he is currently using home page README.md file
This should not be done, the module should be documented separately.
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
This looks like a bug, but it doesn't affect the normal use of mybatis crates, but it needs further verification. necessary
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.