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

REST query for a service with composite key returns an error in postman Incorrect syntax near ',' #178

Open
haniyasin opened this issue May 13, 2022 · 0 comments

Comments

@haniyasin
Copy link

Summary : auto generated query to count is not compatible with MSSQL
it should be something like : select count (*) from ( select distinct CompanyID, DivisionID,DepartmentID,OrderNumber from orderheader )AS sub


Postman request URL:
http://localhost:3030/orderheader?companyid=Dinos&divisionid=default&departmentid=default

error result(postman):
"name": "GeneralError",
"message": "select count(distinct [orderheader].[CompanyID], [orderheader].[DivisionID], [orderheader].[DepartmentID], [orderheader].[OrderNumber]) as [total] from [orderheader] where [companyid] = @p0 and [divisionid] = @p1 and [departmentid] = @p2 - Incorrect syntax near ','.",
"code": 500,
"className": "general-error",
"errors": {}
}

service options:
const options = {
Model: createModel(app),
paginate: app.get('paginate'),
id:['CompanyID','DivisionID','DepartmentID','OrderNumber']
};

Connection :
const client = 'mssql'
const connection = {
user: 'enterprise',
password: 'enterprise',
server: 'localhost',
database: 'enterprise',
port: 1433,
//debug: true,
options: {
encrypt: false
}
}

Dependencies:
"dependencies": {
"@feathersjs/authentication": "^4.5.14",
"@feathersjs/authentication-local": "^4.5.14",
"@feathersjs/authentication-oauth": "^4.5.14",
"@feathersjs/configuration": "^4.5.12",
"@feathersjs/errors": "^4.5.12",
"@feathersjs/express": "^4.5.14",
"@feathersjs/feathers": "^4.5.12",
"@feathersjs/socketio": "^4.5.14",
"@feathersjs/transport-commons": "^5.0.0-pre.20",
"compression": "^1.7.4",
"cors": "^2.8.5",
"feathers-objection": "^7.5.3",
"helmet": "^4.6.0",
"knex": "^2.0.0",
"mssql": "^8.1.0",
"objection": "^3.0.1",
"serve-favicon": "^2.5.0",
"winston": "^3.7.2"
},

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

1 participant