loopbackio / loopbackio/loopback-connector-postgresql
LB4 discover Error after updating libraries to latest
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 118
- Forks
- 184
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 5
Description
Steps to reproduce
Updating loopback libraries
"@loopback/authentication": "^11.0.11", "@loopback/authentication-jwt": "^0.15.11", "@loopback/authorization": "^0.15.11", "@loopback/boot": "^7.0.11", "@loopback/context": "^7.0.11", "@loopback/core": "^6.1.8", "@loopback/openapi-v3": "^10.0.11", "@loopback/repository": "^7.0.11", "@loopback/rest": "^14.0.11", "@loopback/rest-explorer": "^7.0.11", "@loopback/service-proxy": "^7.0.11", "loopback-connector-rest": "^5.0.1",
and PostgreSQL connector
"loopback-connector-postgresql": "^7.1.10",
Current Behavior
The tool
lb4 discover --datasource db --schema appuser
failed with the Error:
Error: buildQueryUniqueKeys must be implemented by the connector at SQLConnector.buildQueryUniqueKeys (C:\Users\Paolo Conci\Documents\PROJECTS_LOCAL_WORKSPACE\L_FBK_MNFLims\APP_SERVER\fbk-fablims-server\node_modules\loopback-connector\lib\sql.js:2159:9) at SQLConnector.discoverUniqueKeys (C:\Users\Paolo Conci\Documents\PROJECTS_LOCAL_WORKSPACE\L_FBK_MNFLims\APP_SERVER\fbk-fablims-server\node_modules\loopback-connector\lib\sql.js:2180:20) at DataSource.discoverUniqueKeys (C:\Users\Paolo Conci\Documents\PROJECTS_LOCAL_WORKSPACE\L_FBK_MNFLims\APP_SERVER\fbk-fablims-server\node_modules\loopback-datasource-juggler\lib\datasource.js:1346:20)
Expected Behavior
With the previous libraries
"@loopback/authentication": "^11.0.8", "@loopback/authentication-jwt": "^0.15.8", "@loopback/authorization": "^0.15.8", "@loopback/boot": "^7.0.8", "@loopback/core": "^6.1.5", "@loopback/repository": "^7.0.8", "@loopback/rest": "^14.0.8", "@loopback/rest-explorer": "^7.0.8", "@loopback/service-proxy": "^7.0.8", "debug": "^4.3.7", "file-type": "^16.0.0", "jsonwebtoken": "^9.0.0", "loopback-connector-postgresql": "^7.1.5",
the tool extracts the DB information from Postgresql
lb4 discover --datasource db --schema appuser ? Select the models which to discover userTodo ? Select a convention to convert db column names(EXAMPLE_COLUMN) to model property names: (Use arrow keys) ? Select a convention to convert db column names(EXAMPLE_COLUMN) to model property names: Camel case (exampleColumn) (Recommended) create src\models\user-todo.model.ts
Link to reproduction sandbox
Additional information
Related Issues
See Reporting Issues for more tips on writing good issues
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing lb4 discover --datasource db --schema appuser with the listed PostgreSQL and LoopBack library versions. Inspect the stack-trace locations in node_modules/loopback-connector/lib/sql.js and loopback-datasource-juggler/lib/datasource.js, then compare them with the previous dependency set; done means discovery extracts the PostgreSQL schema and creates the model as shown.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs, postgresql
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100