Merge branch 'details-v1' into 'main'
Details See merge request x433485/minisql!13
This commit is contained in:
commit
dd013e5885
4 changed files with 29 additions and 2 deletions
16
.gitlab-ci.yml
Normal file
16
.gitlab-ci.yml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
stages:
|
||||
- primary
|
||||
|
||||
build-and-test:
|
||||
stage: primary
|
||||
image: rust:1.74.0
|
||||
tags:
|
||||
- shared-fi
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
script:
|
||||
# build and test in single job for faster execution
|
||||
# because shared runner doesn't allow caching
|
||||
- cargo build --verbose
|
||||
- cargo test --verbose
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
name = "minisql"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
rust-version = "1.74"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
|
|
|
|||
|
|
@ -210,8 +210,14 @@ async fn handle_query<W>(writer: &mut W, state: &SharedDbState, query: String, t
|
|||
}
|
||||
false
|
||||
},
|
||||
Response::TableCreated => true,
|
||||
Response::IndexCreated => true,
|
||||
Response::TableCreated => {
|
||||
writer.write_command_complete(CompleteStatus::CreateTable).await?;
|
||||
true
|
||||
},
|
||||
Response::IndexCreated => {
|
||||
writer.write_command_complete(CompleteStatus::CreateIndex).await?;
|
||||
true
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ pub enum CompleteStatus {
|
|||
},
|
||||
Delete(usize),
|
||||
Select(usize),
|
||||
CreateTable,
|
||||
CreateIndex,
|
||||
}
|
||||
|
||||
impl CompleteStatus {
|
||||
|
|
@ -21,6 +23,8 @@ impl CompleteStatus {
|
|||
CompleteStatus::Insert { oid, rows } => format!("INSERT {} {}", oid, rows),
|
||||
CompleteStatus::Delete(rows) => format!("DELETE {}", rows),
|
||||
CompleteStatus::Select(rows) => format!("SELECT {}", rows),
|
||||
CompleteStatus::CreateTable => "CREATE TABLE".to_string(),
|
||||
CompleteStatus::CreateIndex => "CREATE INDEX".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue