loopbackio / loopbackio/loopback-next

lb4 discover does not handle BLOB fields

Aperta
#6,295 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug db:MySQL db:Oracle db:PostgreSQL good first issue Hacktoberfest help wanted Model Discovery
Lingua principale
TypeScript
Stelle
5.1k
Fork
1.1k
Merge medio
2g 21h
PR unite (30g)
27

Descrizione

## Steps to reproduce
To reproduce this problem use lb4 discover in a MySQL table having a BLOB field. It will generate a model where BLOB is mapped to binary and does not start.

## Current Behavior

The lb4 discover blob fields as binary fields

## Expected Behavior

Blob fields should be discovered as buffer type.

## Link to reproduction sandbox

## Additional information

The created model property is like

```ts
@property({
type: 'Binary',
required: true,
length: 65535,
mysql: {columnName: 'photo', dataType: 'blob', dataLength: 65535, dataPrecision: null, dataScale: null, nullable: 'N'},
})
// Binary is not defined so compiler fails
// it should be Buffer
photo: Binary;
```
## Related Issues

No similar issues found.

_See [Reporting Issues](http://loopback.io/doc/en/contrib/Reporting-issues.html) for more tips on writing good issues_

Guida per i contributori

Apri la guida per i contributori

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.

Direzione di ricerca

Start by reproducing the issue with lb4 discover against a MySQL table containing a BLOB field, then inspect the generated TypeScript model shown in the report. Verify that BLOB is mapped to Buffer rather than the undefined Binary type and that the generated model compiles and starts successfully.

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

Valutazione

Stack tecnologico
mysql, typescript
Ambito
database
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.