File tree 1 file changed +3
-4
lines changed
Filter options
1 file changed +3
-4
lines changed
Original file line number Diff line number Diff line change @@ -2,10 +2,9 @@ use log::LevelFilter;
2
2
use rbatis:: dark_std:: defer;
3
3
use rbatis:: rbdc:: datetime:: DateTime ;
4
4
use rbatis:: table_sync:: SqliteTableMapper ;
5
- use rbatis:: { crud , RBatis } ;
5
+ use rbatis:: RBatis ;
6
6
use serde_json:: json;
7
7
use rbatis:: impl_select;
8
- use rbatis:: rbdc:: db:: ExecResult ;
9
8
10
9
/// table
11
10
#[ derive( serde:: Serialize , serde:: Deserialize ) ]
@@ -23,7 +22,7 @@ pub struct Activity {
23
22
pub version : Option < i64 > ,
24
23
pub delete_flag : Option < i32 > ,
25
24
}
26
- crud ! ( Activity { } ) ;
25
+
27
26
impl_select ! ( Activity { select_id_name( id: & str , name: & str ) => "`where id = #{id} and name = #{name}`" } ) ;
28
27
29
28
#[ tokio:: main]
@@ -44,7 +43,7 @@ pub async fn main() {
44
43
// rb.init(rbdc_mssql::driver::MssqlDriver {}, "mssql://jdbc:sqlserver://localhost:1433;User=SA;Password={TestPass!123456};Database=master;").unwrap();
45
44
//rb.init(rbdc_sqlite::driver::SqliteDriver {}, "sqlite://target/sqlite.db").unwrap();
46
45
// table sync done
47
- let data = Activity :: select_in_column :: < i32 > ( & rb, "id " , & [ ] ) . await ;
46
+ let data = Activity :: select_id_name ( & rb, "1 " , "1" ) . await ;
48
47
println ! ( "select_id_name = {}" , json!( data) ) ;
49
48
}
50
49
You can’t perform that action at this time.
0 commit comments