Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loopback 4 oracle connector is not working #168

Closed
ashokkumarsand opened this issue Oct 19, 2018 · 9 comments
Closed

Loopback 4 oracle connector is not working #168

ashokkumarsand opened this issue Oct 19, 2018 · 9 comments
Assignees

Comments

@ashokkumarsand
Copy link

Description/Steps to reproduce

113071-MBP15:reporting asand$ lb4 --version
@loopback/cli version: 1.0.1

@loopback/* dependencies:

@loopback/authentication: ^1.0.1
@loopback/boot: ^1.0.1
@loopback/build: ^1.0.0
@loopback/context: ^1.0.0
@loopback/core: ^1.0.0
@loopback/metadata: ^1.0.0
@loopback/openapi-spec-builder: ^1.0.0
@loopback/openapi-v3-types: ^1.0.0
@loopback/openapi-v3: ^1.0.1
@loopback/repository-json-schema: ^1.0.1
@loopback/repository: ^1.0.1
@loopback/rest: ^1.0.1
@loopback/testlab: ^1.0.0
@loopback/docs: ^1.0.1
@loopback/example-hello-world: ^1.0.1
@loopback/example-log-extension: ^1.0.1
@loopback/example-rpc-server: ^1.0.0
@loopback/example-todo: ^1.0.1
@loopback/example-soap-calculator: ^1.0.1
@loopback/service-proxy: ^1.0.0
@loopback/http-caching-proxy: ^1.0.0
@loopback/http-server: ^1.0.0
@loopback/example-todo-list: ^1.0.1
@loopback/dist-util: ^0.4.0
113071-MBP15:reporting asand$ lb4 datasource
? Datasource name: oracle
? Select the connector for oracle: Oracle (supported by StrongLoop)
? Connection String tns (eg: DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MY_HOST)(PORT=MY_PORT))(CONNECT_DATA=(SERVER=DEDICATED)(SE
RVICE_NAME=MY_DB))):
? host: <My_URL>
? port: 1521
? user: <My_USER>
? password: [hidden]
? database: demonlord
create src/datasources/oracle.datasource.json
create src/datasources/oracle.datasource.ts
oracledb@2.3.0 install /Users/asand/workspace/reporting/node_modules/oracledb
node package/oracledbinstall.js

oracledb Beginning installation
oracledb Verifying installation
oracledb Continuing installation
oracledb Oracledb downloaded
oracledb Verifying installation
oracledb Binary SHA matches SHA in SHASUMS256.txt
oracledb
oracledb ********************************************************************************
oracledb ** Node-oracledb 2.3.0 installation complete for Node.js 8.11.4 (darwin, x64)
oracledb **
oracledb ** To use the installed node-oracledb:
oracledb ** - You need to have the Oracle Instant Client Basic or Basic Light package in ~/lib or /usr/local/lib
oracledb ** Download from http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html
oracledb **
oracledb ** Node-oracledb installation instructions: https://oracle.github.io/node-oracledb/INSTALL.html
oracledb ********************************************************************************

npm WARN reporting@1.0.0 No license field.

loopback-connector-oracle@4.1.1
added 2 packages in 7.38s
[!] 1 vulnerability found [2755 packages audited]
Severity: 1 Low
Run npm audit for more detail

update src/datasources/index.ts

Datasource oracle was created in src/datasources/

113071-MBP15:reporting asand$ lb4 model
? Model class name: ReportEngineJob
? Please select the model base class Entity
Let's add a property to ReportEngineJob
Enter an empty property name when done

? Enter the property name: id
? Property type: string
? Is id the ID property? Yes
? Is it required?: Yes
? Default value [leave blank for none]:

Let's add another property to ReportEngineJob
Enter an empty property name when done

? Enter the property name: status
? Property type: string
? Is it required?: Yes
? Default value [leave blank for none]:

Let's add another property to ReportEngineJob
Enter an empty property name when done

? Enter the property name: resourceId
? Property type: string
? Is it required?: Yes
? Default value [leave blank for none]:

Let's add another property to ReportEngineJob
Enter an empty property name when done

? Enter the property name: resourcePath
? Property type: string
? Is it required?: Yes
? Default value [leave blank for none]:

Let's add another property to ReportEngineJob
Enter an empty property name when done

? Enter the property name:
create src/models/report-engine-job.model.ts
update src/models/index.ts

Model ReportEngineJob was created in src/models/

113071-MBP15:reporting asand$ lb4 repository
? Please select the datasource OracleDatasource
? Select the model(s) you want to generate a repository
Generation is aborted: Error: You did not select a valid model

Link to reproduction sandbox

Expected result

Additional information

@dhmlau
Copy link
Member

dhmlau commented Oct 19, 2018

@ashokkumarsand , looking at the last part of the output:

113071-MBP15:reporting asand$ lb4 repository
? Please select the datasource OracleDatasource
? Select the model(s) you want to generate a repository
Generation is aborted: Error: You did not select a valid model

Looks like you haven't selected a model yet? Please make sure that the "dot" in front of the model is selected before you hit enter.

If that's the cause, we'll probably see if we could pre-select the first one for this prompt so that cli won't try to generate repository without a model.

@dhmlau
Copy link
Member

dhmlau commented Oct 19, 2018

To illustrate that, make sure the dot in front of the model is checked.

won't work
screen shot 2018-10-19 at 6 09 38 pm

will work
screen shot 2018-10-19 at 6 09 48 pm

@ashokkumarsand
Copy link
Author

@ashokkumarsand , looking at the last part of the output:

113071-MBP15:reporting asand$ lb4 repository
? Please select the datasource OracleDatasource
? Select the model(s) you want to generate a repository
Generation is aborted: Error: You did not select a valid model

Looks like you haven't selected a model yet? Please make sure that the "dot" in front of the model is selected before you hit enter.

If that's the cause, we'll probably see if we could pre-select the first one for this prompt so that cli won't try to generate repository without a model.

I selected model but it doesn't display in command line and it gives error

@dhmlau
Copy link
Member

dhmlau commented Oct 20, 2018

@ashokkumarsand, wanna make sure if I understand where the problem is.
Do you see your model name in the prompt Select the model(s) you want to generate a repository, just like the Todo model in my screenshot?

@ashokkumarsand
Copy link
Author

@ashokkumarsand, wanna make sure if I understand where the problem is.
Do you see your model name in the prompt Select the model(s) you want to generate a repository, just like the Todo model in my screenshot?

Thank you, It's working now.

2 similar comments
@ashokkumarsand
Copy link
Author

@ashokkumarsand, wanna make sure if I understand where the problem is.
Do you see your model name in the prompt Select the model(s) you want to generate a repository, just like the Todo model in my screenshot?

Thank you, It's working now.

@ashokkumarsand
Copy link
Author

@ashokkumarsand, wanna make sure if I understand where the problem is.
Do you see your model name in the prompt Select the model(s) you want to generate a repository, just like the Todo model in my screenshot?

Thank you, It's working now.

@ashokkumarsand
Copy link
Author

Thanks, It's working

@edgeineer
Copy link

@ashokkumarsand , looking at the last part of the output:

113071-MBP15:reporting asand$ lb4 repository
? Please select the datasource OracleDatasource
? Select the model(s) you want to generate a repository
Generation is aborted: Error: You did not select a valid model

Looks like you haven't selected a model yet? Please make sure that the "dot" in front of the model is selected before you hit enter.

If that's the cause, we'll probably see if we could pre-select the first one for this prompt so that cli won't try to generate repository without a model.

Yes.. use spacebar to select and press enter to continue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants