loopbackio / loopback-next

LoopBack makes it easy to build modern API applications that require complex integrations.
https://loopback.io
Other
4.95k stars 1.07k forks source link

how we can expose stored procedure of MySQL database in rest API using loopback4 #5408

Closed kanusoni closed 3 years ago

kanusoni commented 4 years ago

Hello, is there any library or any code available to get the stored procedure of MySQL database into Rest API using loopback4.

dougal83 commented 4 years ago

Please see https://github.com/strongloop/loopback-next/issues/5101#issuecomment-613189957

deepakrkris commented 4 years ago

@kanusoni please take a look at #3459

constructor( @repository(MyRepository) public myRepo: MyRepository, ) { this.user_Profile = userProfile; } async testData( ): Promise { return await this.myRepo.dataSource.execute(EXEC Get_Customer(?), ['CUSTID01']); } and

https://loopback.io/doc/en/lb4/apidocs.repository.connector.execute.html

kanusoni commented 4 years ago

@deepakrkris @dhmlau That code you mentioned in #3459 is working fine. But what i want is to get the list of stored procedure and execute the stored procedure of MySQL database using an API in loopback4 explorer. Thanks.

Arathy-sivan commented 4 years ago

What is the use of " --save " in mysql loopback4 connector command?? ( npm install --save loopback-connector-mysql )

achrinza commented 4 years ago

@Arathy-sivan This is a question with regards to NPM and not specific to LoopBack 4.

Please see https://stackoverflow.com/questions/19578796/what-is-the-save-option-for-npm-install