loopbackio / loopback-connector-oracle

Connect Loopback to Oracle
http://loopback.io/doc/en/lb3/Oracle-connector.html
Other
28 stars 30 forks source link

Loopback 4 oracle connector is not working #168

Closed ashokkumarsand closed 6 years ago

ashokkumarsand commented 6 years ago

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: ? port: 1521 ? 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 commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

@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 commented 6 years ago

@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 commented 6 years ago

@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 commented 6 years ago

@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 commented 6 years ago

Thanks, It's working

edgeineer commented 5 years ago

@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