| CARVIEW |
Select Language
HTTP/2 200
date: Mon, 29 Dec 2025 11:06:26 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"fff5e762a74b9f452ed036be046a617f"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com github.githubassets.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com marketplace-screenshots.githubusercontent.com/ copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com github.githubassets.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=hSVrjCI6gCQi%2FIdfSyHBDw0xATEfw9L3obGJXuPyEDScdzPTe3ePCsCi62znvJrb2o6MyzK0REa%2FgyZVeN85SL1sS3avEvS1KhUXWBWLUjLkko3b32bQvdmS92hzdt8IdOTmd5y%2BfNRcUqE8VNoTOK4v4gWA%2FE3EonJiCq2Wmjygz2ASt3hupV%2FPlOAWljqDHao4wmn08EySEvw0BGmiuE1t0aB7RaOaQkWOCGQm6Ff7HnvXaSEnBnGeuuTiREAWwTUjEr6AeAnUqSS60fvLmg%3D%3D--ykmE4%2BsRNVFo%2F3ZU--WYGANGPMpOD%2B%2FOHcz9PRNw%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.61897881.1767006385; Path=/; Domain=github.com; Expires=Tue, 29 Dec 2026 11:06:25 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Tue, 29 Dec 2026 11:06:25 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: E702:2C1316:5F5B212:729CA47:695260B1
Releases · rbatis/rbatis · GitHub
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 164
Releases: rbatis/rbatis
Releases · rbatis/rbatis
v4.6.14
v4.6.13
what changes?
- Support for temporarily replacing the interceptor list
for example:
/// Mock intercept that just prints SQL
#[derive(Debug)]
pub struct MockIntercept;
#[async_trait]
impl Intercept for MockIntercept {
async fn before(
&self,
task_id: i64,
_rb: &dyn Executor,
sql: &mut String,
_args: &mut Vec<Value>,
_result: ResultType<&mut Result<ExecResult, rbatis::Error>, &mut Result<Vec<Value>, rbatis::Error>>,
) -> Result<Option<bool>, rbatis::Error> {
*sql = sql.replace("<my_table_name>", &format!("activity_{}",task_id % 2));
println!("MockIntercept: SQL = {}", sql);
Ok(Some(true))
}
}
#[tokio::main]
pub async fn main() -> Result<(), rbatis::Error> {
_ = fast_log::init(fast_log::Config::new().console());
let rb = RBatis::new();
rb.init(rbdc_sqlite::driver::SqliteDriver {}, "sqlite://target/sqlite.db")?;
// create table
_=rb.exec("CREATE TABLE activity_0 ( id INTEGER PRIMARY KEY);", vec![]).await;
_=rb.exec("CREATE TABLE activity_1 ( id INTEGER PRIMARY KEY);", vec![]).await;
let len = rb.intercepts.len();
println!("len={}", len);
// Create new intercept list and add our mock intercept
let new_intercept = Arc::new(SyncVec::new());
let intercept: Arc<dyn Intercept> = Arc::new(MockIntercept {});
new_intercept.push(intercept);
// Create connection and replace its intercepts
let mut conn = rb.acquire().await?;
conn.intercepts = new_intercept;
println!("conn.intercepts.len={}", conn.intercepts.len());
// Execute query to see the mock intercept in action
let _ = conn.query("SELECT <my_table_name>", vec![]).await;
let data = Activity::select_all(&conn).await?;
println!("data={:?}", json!(data));
Ok(())
}
/// table
#[derive(serde::Serialize, serde::Deserialize, Clone)]
pub struct Activity {
pub id: Option<String>,
pub name: Option<String>,
pub pc_link: Option<String>,
pub h5_link: Option<String>,
pub pc_banner_img: Option<String>,
pub h5_banner_img: Option<String>,
pub sort: Option<String>,
pub status: Option<i32>,
pub remark: Option<String>,
pub create_time: Option<DateTime>,
pub version: Option<i64>,
pub delete_flag: Option<i32>,
}
//crud!(Activity {},"activity");
crud!(Activity {},"<my_table_name>");Assets 2
v4.6.12
what changes?
- impl #591 for
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, PartialEq)]
struct MockTable {
pub id: Option<String>,
pub name: Option<String>,
pub status: Option<i32>
}
crud!(MockTable{});
let r = MockTable::update_by_map(rb, &table, value!{"id":"1", "column": ["name", "status"]}).await;- impl
crud!for select target columns
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, PartialEq)]
struct MockTable {
pub id: Option<String>,
pub name: Option<String>,
pub status: Option<i32>
}
crud!(MockTable{});
let tables = MockTable::select_by_map(rb,value!{"id":"1", "column": ["id", "name"]}).await?; Assets 2
v4.6.9
v4.6.8
add page method:
/// create Vec<PageRequest> from (total: u64, page_size: u64)
pub fn make_page_requests(total: u64, page_size: u64) -> Vec<PageRequest> {
let mut result = vec![];
let pages = PageRequest::new(1, page_size).set_total(total).pages();
for idx in 0..pages {
let current_page = PageRequest::new(idx + 1, page_size).set_total(total);
result.push(current_page);
}
result
}Assets 2
v4.6.7
- fix PageIntercept remove
order bysql when runcountsql
Assets 2
2 people reacted
v4.6.5
- crud macro
*_by_mapmethod will be skip null for example value!{ "name": null }
Assets 2
v4.6.4
- page intercept will be remove
order bywhen runcountsql
Assets 2
v4.6.3
in ()sql will be return default result
Assets 2
v4.6.2
- fix crud macro
select_by_map(&rb, value!{"id": &[]}).await;if is select empty array ,will be return empty vec result.
Assets 2
Previous Next
You can’t perform that action at this time.