loopbackio / loopbackio/loopback-connector
Model-specific schema not respected by SQL building methods
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 35
- Fork
- 102
- Merge medio
- 14h 26m
- PR unite (30g)
- 13
Descrizione
We are working with a legacy database that has our data divided among different schemas.
As per the documentation, I should be able to set the schema for an individual model.
https://docs.strongloop.com/display/public/LB/Model+definition+JSON+file#ModeldefinitionJSONfile-Datasource-specificoptions
However, SQLConnector does not specify any schema in the SQL statements that it builds, even though there is a schema method that properly determines which schema to use for a given model.
We should use this schema method to always specify the schema in generated SQL.
@raymondfeng @bajtos What are the chances of this being implemented and released as version 3? It doesn't look like a complicated change, so I could probably implement it myself and submit a PR, if that increases the chances.
Are there any problems you can see with making this change? I know this would break loopback-connector-db2 since it needlessly overrides the schema method with a schema string property in the constructor, which is why I believe it should be released in the next major version.
Thanks :)
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Leggi lib/sql.js intorno al metodo schema a cui fa riferimento l’issue, quindi segui i metodi di SQLConnector che costruiscono le istruzioni. Verifica in che modo loopback-connector-db2 esegue l’override di schema e determina l’impatto sulla compatibilità. Il lavoro è completato quando l’SQL generato utilizza in modo coerente lo schema specifico del modello senza compromettere il comportamento documentato del connector.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, sql
- Ambito
- backend, database
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100