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
Feature Request: Truncate collection #2238
Comments
Something like this was requested previously in #560. I think it will be confusing to have a "Select all ..." in the bulk bar UI. Instead it might be better to have a "Truncate" option in the collection settings dropdown (eg. next to the "Duplicate" option). The "Truncate" option could trigger a dedicated endpoint accessible only by admins. I'll add it to the roadmap but for now remains a low priority. |
maybe someone will find it helpful: import { RecordService } from "pocketbase";
declare module "pocketbase" {
interface RecordService {
truncate(): Promise<void>;
}
}
RecordService.prototype.truncate = async function () {
const old = await this.getFullList();
for (const oldRecord of old) {
await this.delete(oldRecord.id);
}
console.log(`Truncated ${this.collectionIdOrName}`);
}; |
My
Does it in on sqlite query instead of how many records you have. |
Summary: Bulk delete thousands of records using the Admin UI.
Details: We have a couple of collections in our PocketBase instance that have thousands of records. We'd like to be able to completely clear out these records when testing a custom data migration. Currently in the admin dashboard it shows 30 records by default and you can scroll down and load 30 more at a time. It would be nice if the bulk select at the top had the option to select the currently loaded records or all the records in the entire collection, which you then could bulk delete.
Concept for how this could look in the UI
The text was updated successfully, but these errors were encountered: