Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[issues-583] Fix ALTER TABLE Sqlite #595

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/backend/sqlite/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ impl TableBuilder for SqliteQueryBuilder {
fn prepare_table_alter_statement(&self, alter: &TableAlterStatement, sql: &mut dyn SqlWriter) {
if alter.options.is_empty() {
panic!("No alter option found")
};
}
if alter.options.len() > 1 {
panic!("Sqlite doesn't support multiple alter options")
}
write!(sql, "ALTER TABLE ").unwrap();
if let Some(table) = &alter.table {
self.prepare_table_ref_table_stmt(table, sql);
Expand Down
1 change: 1 addition & 0 deletions tests/sqlite/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ fn alter_6() {
}

#[test]
#[should_panic(expected = "Sqlite doesn't support multiple alter options")]
fn alter_7() {
let _ = Table::alter()
.table(Font::Table)
Expand Down