Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add a deleteAllRows function on database model

Aperta
#5,397 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
dart, postgresql
Ambito
backend, databases

Direzione di ricerca

Find how Model.db.deleteWhere is defined and generated in the Serverpod ORM (table/session APIs and any codegen for models). Add deleteAllRows that runs an unfiltered DELETE on the model table, mirroring existing delete helpers. Cover it with the same style of tests used for deleteWhere. Done when Model.db.deleteAllRows is available on generated models and clears the table.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement
Problem to Solve

Add a new function that let the user delete all rows in the db

Proposal

Add a new function to the Model.db like Model.db.deleteAllRows that would do a DELETE * FROM MODEL_DB

Use Case

Clean a table on server or client side with a simple command

Alternatives

Use the command Model.db.deleteWhere(session, where (row) => row.id.notEquals(null))

Additional context

This could be used on the client side to remove data when the user log out

How experienced are you with this library?

Intermediate - Familiar with the basics or have used it in a few projects

Are you interested in working on a PR for this?
  • I want to work on this
Lingua principale
Dart
Stelle
3.3k
Fork
382
Merge medio
1g 4h
PR unite (30g)
65

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di serverpod/serverpod

Tutte le issue di serverpod/serverpod

Issue simili

Altre issue su Dart

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.