loopbackio / loopbackio/loopback-next
Cassandra UDT not being persisted in cassandra database
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 5.1k
- Forks
- 1.1k
- Ø Merge
- 2 T. 21 Std.
- Gemergte PRs (30 T.)
- 27
Beschreibung
### Describe the bug
The code converts Json object in request payload to string for UDT. We debugged and found the issue with Cassandra.prototype.create function in loopback-connector-cassandra/lib/cassandra.js. Please provide the solution for the issue.
### Logs
```shell
Payload object:
{
id: 'c',
name: 'otlsgy4',
phone: '88774622572',
address: {
street: 'Sahastradhara Road',
city: 'Dehradun',
state_or_province: 'Uttarakhand',
postal_code: '248001',
country: 'India'
}
}
Insert Query by loopback:
INSERT INTO "hotels"("id","name","phone","address") VALUES(?,?,?,?) [
'c',
'otlsgy4',
'88774622572',
'{"street":"Sahastradhara Road","city":"Dehradun","state_or_province":"Uttarakhand","postal_code":"248001","country":"India"}'
]
Expected Result:
INSERT INTO "hotels"("id","name","phone","address") VALUES(?,?,?,?) [
'c',
'otlsgy4',
'88774622572',
{"street":"Sahastradhara Road","city":"Dehradun","state_or_province":"Uttarakhand","postal_code":"248001","country":"India"}
]
```
### Additional information
_No response_
### Reproduction
https://github.com/nishankpathak/cassandrademo
@dhmlau
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
Beginne in loopback-connector-cassandra/lib/cassandra.js bei Cassandra.prototype.create und reproduziere das Problem anhand des verlinkten cassandrademo-Beispiels. Verfolge, wie der address UDT in den INSERT-Parametern gebunden wird; abgeschlossen ist die Aufgabe, wenn der UDT als strukturierte Cassandra-Daten statt als JSON-String gespeichert wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- cassandra, typescript
- Bereich
- databases
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100