Skip to content

Commit

Permalink
post rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Horusiath committed Feb 21, 2024
1 parent 81d5de0 commit 838ae76
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libsql-server/src/connection/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ pub struct DatabaseConfig {
pub shared_schema_name: Option<String>,
}

impl DatabaseConfig {
#[inline]
pub fn block_ddl(&self) -> bool {
self.shared_schema_name.is_some()
}
}

const fn default_max_size() -> u64 {
bytesize::ByteSize::pb(1000).as_u64() / LIBSQL_PAGE_SIZE
}
Expand Down
1 change: 1 addition & 0 deletions libsql-server/src/connection/libsql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,7 @@ impl<W: Wal> Connection<W> {
let blocked = match query.stmt.kind {
StmtKind::Read | StmtKind::TxnBegin | StmtKind::Other => config.block_reads,
StmtKind::Write => config.block_reads || config.block_writes,
StmtKind::DDL => config.block_reads || config.block_writes || config.block_ddl(),
StmtKind::TxnEnd | StmtKind::Release | StmtKind::Savepoint => false,
StmtKind::Attach | StmtKind::Detach => !config.allow_attach,
};
Expand Down
1 change: 1 addition & 0 deletions libsql-server/src/query_analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub enum StmtKind {
Release,
Attach,
Detach,
DDL,
Other,
}

Expand Down

0 comments on commit 838ae76

Please sign in to comment.