Skip to content

Commit e07d1b9

Browse files
MazterQyouigorlukanin
authored andcommitted
feat(cubesql): Support SAVEPOINT, ROLLBACK TO, RELEASE (#9992)
1 parent 348854f commit e07d1b9

File tree

6 files changed

+34
-16
lines changed

6 files changed

+34
-16
lines changed

packages/cubejs-backend-native/Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/cubesql/Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/cubesql/cubesql/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ homepage = "https://cube.dev"
1010

1111
[dependencies]
1212
arc-swap = "1"
13-
datafusion = { git = 'https://github.com/cube-js/arrow-datafusion.git', rev = "6ac106244a1d4699f36d2bcbf435ca37363d1e21", default-features = false, features = [
13+
datafusion = { git = 'https://github.com/cube-js/arrow-datafusion.git', rev = "46de6806e4faae260691b5b1269a54785e76c76f", default-features = false, features = [
1414
"regex_expressions",
1515
"unicode_expressions",
1616
] }
1717
thiserror = "2"
1818
cubeclient = { path = "../cubeclient" }
1919
pg-srv = { path = "../pg-srv" }
20-
sqlparser = { git = 'https://github.com/cube-js/sqlparser-rs.git', rev = "e14d5bf45367edd8679cbc15ccee56693da8e4fb" }
20+
sqlparser = { git = 'https://github.com/cube-js/sqlparser-rs.git', rev = "16f051486de78a23a0ff252155dd59fc2d35497d" }
2121
base64 = "0.13.0"
2222
tokio = { version = "^1.35", features = ["full", "rt", "tracing"] }
2323
serde = { version = "^1.0", features = ["derive"] }

rust/cubesql/cubesql/src/compile/plan.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ pub enum CommandCompletion {
2828
Commit,
2929
Use,
3030
Rollback,
31+
Savepoint,
32+
Release,
3133
Set,
3234
Select(u32),
3335
DeclareCursor,

rust/cubesql/cubesql/src/compile/router.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,20 @@ impl QueryRouter {
132132
CommandCompletion::Rollback,
133133
))
134134
}
135+
(ast::Statement::Savepoint { .. }, DatabaseProtocol::PostgreSQL) => {
136+
// TODO: Real support
137+
Ok(QueryPlan::MetaOk(
138+
StatusFlags::empty(),
139+
CommandCompletion::Savepoint,
140+
))
141+
}
142+
(ast::Statement::Release { .. }, DatabaseProtocol::PostgreSQL) => {
143+
// TODO: Real support
144+
Ok(QueryPlan::MetaOk(
145+
StatusFlags::empty(),
146+
CommandCompletion::Release,
147+
))
148+
}
135149
(ast::Statement::Discard { object_type }, DatabaseProtocol::PostgreSQL) => {
136150
// TODO: Cursors + Portals
137151
self.state.clear_prepared_statements().await;

rust/cubesql/cubesql/src/sql/types.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ impl CommandCompletion {
129129
CommandCompletion::Prepare => CommandComplete::Plain("PREPARE".to_string()),
130130
CommandCompletion::Commit => CommandComplete::Plain("COMMIT".to_string()),
131131
CommandCompletion::Rollback => CommandComplete::Plain("ROLLBACK".to_string()),
132+
CommandCompletion::Savepoint => CommandComplete::Plain("SAVEPOINT".to_string()),
133+
CommandCompletion::Release => CommandComplete::Plain("RELEASE".to_string()),
132134
CommandCompletion::Set => CommandComplete::Plain("SET".to_string()),
133135
CommandCompletion::Use => CommandComplete::Plain("USE".to_string()),
134136
CommandCompletion::DeclareCursor => {

0 commit comments

Comments
 (0)