Get results in wide format
Offen
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 13.7k
- Forks
- 1.1k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Is there an easy way to call db.exec and get the results in the conventional format:
[
{ "person" : "jerry", "age" : 34 },
{ "person" : "mary", "age": 37 },
{ "person" : "joe", "age" : 63 }
]
I am currently using:
var out = []
var res = db.prepare("SELECT * FROM hello");
while (stmt.step()) out.push(stmt.getAsObject());
But push() can be inefficient. It would be nice to have a shorthand for this.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Start by tracing the db.exec and prepare/step/getAsObject entry points shown in the issue, and inspect how query results are currently assembled. Done means a supported shorthand returns rows in the requested array-of-objects format without requiring the manual loop.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, sqlite
- Bereich
- database
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100