MSSQL Connection in Apigee

ekumar
Participant II

Hi

I am trying connect to MSSQL from Apigee

i have created a trail version

I heard that i need to install npm mssql

How to install it

I have tried with post Manage Node Packaged Modules

but when i am tying i am getting below error


HTTP/1.1 500 Server Error

Connection:
keep-alive
Content-Length:
175
Content-Type:
application/json
Date:
Thu, 20 Jun 2019 11:50:31 GMT
Server:
Apigee LB
{
  "code": "scripts.node.InvalidAction",
  "message": "Invalid action install mssql: Valid actions are [dedupe, install, ls, outdated, prune, update]",
  "contexts": []
}
Solved Solved
0 6 189
1 ACCEPTED SOLUTION

sidd-harth
Participant V
Invalid action install mssql: Valid actions are [dedupe, install, ls, outdated, prune, update

In the management API, you should only mention install

The package.json in the proxy should contain the module name and version.

View solution in original post

6 REPLIES 6

sidd-harth
Participant V
Invalid action install mssql: Valid actions are [dedupe, install, ls, outdated, prune, update

In the management API, you should only mention install

The package.json in the proxy should contain the module name and version.

@Siddharth Barahalikar

Thanks for the quick response
Do u have any sample code for connecting MSSQL database?

if yes can u help me in providing sample proxy for that.


Thanks

sai kumar

Glad it helped.

This should be another question.

Anyway check this doc,

https://www.w3schools.com/nodejs/nodejs_mysql.asp

BTW you can only connect to Mysql server which is running on cloud through Apigee cloud accounts. You cannot connect to Mysql running on your local machine.

@Siddharth Barahalikar

Thanks for your quick response

Actually i need Connection with MSSQL not MYSQL

ekumar
Participant II

@Siddharth Barahalikar

I got this error when i traced it

{"fault":{"faultstring":"Script node executed prematurely: SyntaxError: invalid object initializer\nSyntaxError: invalid object initializer\n at module.js:439:0\n at module.js:474:0\n at module.js:356:0\n at module.js:312:0\n at module.js:364:0\n at require (module.js:380:0)\n at \/organization\/environment\/api\/node_modules\/mssql\/index.js:1:0\n at module.js:456:0\n at module.js:474:0\n at module.js:356:0\n at module.js:312:0\n at module.js:364:0\n at require (module.js:380:0)\n at \/organization\/environment\/api\/hello-world.js:3:0\n at module.js:456:0\n at module.js:474:0\n at module.js:356:0\n at module.js:312:0\n at module.js:497:0\n at startup (trireme.js:142:0)\n at trireme.js:923:0\n","detail":{"errorcode":"scripts.node.runtime.ScriptExitedError"}}}

May i know why i am getting error?
any specific reason

sidd-harth
Participant V

Apigee will be deprecating the Nodejs Proxies in the future as it is outdated and doesnt work with recent npm modules.

I am not sure if it supports Mssql. If you are on APigee cloud then try Hosted Targets.

https://docs.apigee.com/api-platform/hosted-targets/hosted-targets-overview