chore: add limitation when importing csv file (#5381)

This commit is contained in:
Nathan.fooo 2024-05-21 14:41:47 +08:00 committed by GitHub
parent 24b3d69860
commit e85dbe724c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -347,6 +347,12 @@ impl DatabaseManager {
})
.await
.map_err(internal_error)??;
// Currently, we only support importing up to 500 rows. We can support more rows in the future.
if !cfg!(debug_assertions) && params.rows.len() > 500 {
return Err(FlowyError::internal().with_context("The number of rows exceeds the limit"));
}
let result = ImportResult {
database_id: params.database_id.clone(),
view_id: params.inline_view_id.clone(),