Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

reserve table names #381

Merged
merged 1 commit into from
May 4, 2023
Merged

reserve table names #381

merged 1 commit into from
May 4, 2023

Conversation

glommer
Copy link
Contributor

@glommer glommer commented May 4, 2023

some tables come from libSQL and cannot be deleted. Others, are usually associated with backups and internal functions and should also not be deleted.

A long term better strategy is to allow users to specify which tables cannot be dropped, but litestream is widespread enough, and simple enough, that we can assume that if it is in use, we don't want those tables to be dropped. So a static list works for now.

None
} else {
Some(StmtKind::Write)
}
Copy link
Contributor

@psarna psarna May 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also can't resist posting that this whole function body can be replaced with the following idiomatic beauty:

fn write_if_not_reserved(name: &QualifiedName) -> Option<StmtKind> {
    is_reserved_tbl(name).then_some(StmtKind::Write)
}

(obviously non-blocking though)

some tables come from libSQL and cannot be deleted. Others, are usually
associated with backups and internal functions and should also not be
deleted.

A long term better strategy is to allow users to specify which tables
cannot be dropped, but litestream is widespread enough, and simple
enough, that we can assume that if it is in use, we don't want those
tables to be dropped. So a static list works for now.
@psarna psarna added this pull request to the merge queue May 4, 2023
Merged via the queue into libsql:main with commit 7935698 May 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants