You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The query that is getting generated for this is:
SQL: SELECT "property","staydate","rolluptype","totnights","totrevenue","bymarketcd","bychannel","byroomtype" FROM "castle"."v_histrollup" WHERE "property"=$1 AND "staydate"$2 ORDER BY "property" LIMIT 10
Parameters: ["c5ba1990-c458-11e4-a8e5-0b887e7b0d20",null]
The date parameter is going as null and I get the following error:
SQL: SELECT "property","staydate","rolluptype","totnights","totrevenue","bymarketcd","bychannel","byroomtype" FROM "castle"."v_histrollup" WHERE "property"=$1 AND "staydate" BETWEEN $2 AND $3 ORDER BY "property" LIMIT 10
Parameters: ["c5ba1990-c458-11e4-a8e5-0b887e7b0d20",{"sql":"to_timestamp(?,'yyyy-mm-dd hh24:mi:ss.ms')","params":["2014-04-28T10:00:00.000Z"]},{"sql":"to_timestamp(?,'yyyy-mm-dd hh24:mi:ss.ms')","params":["2014-10-01T09:59:59.999Z"]}]
error: invalid input syntax for type date: "{"sql":"to_timestamp(?,'yyyy-mm-dd hh24:mi:ss.ms')","params":["2014-04-28T10:00:00.000Z"]}"
Regards,
-Kesav
The text was updated successfully, but these errors were encountered:
raymondfeng
pushed a commit
to loopbackio/loopback-connector
that referenced
this issue
May 20, 2015
2.x version of loopback-connector-postgresql is failing for simple queries too.
I've the following model:
{
"name": "histrollup",
"base": "PersistedModel",
"idInjection": false,
"options": {
"validateUpsert": true
},
"postgresql": {
"table": "v_histrollup"
},
"properties": {
"property": {
"type": "string",
"id": true,
"required": true,
"postgresql": {
"dataType": "uuid"
}
},
"staydate": {
"type": "date",
"required": true
}
}
}
When I do simple queries on this model things are not working:
app.models.Histrollup.find({where: {property: inputs.property, staydate:new Date('2015-05-01')}, limit:10})
The query that is getting generated for this is:
SQL: SELECT "property","staydate","rolluptype","totnights","totrevenue","bymarketcd","bychannel","byroomtype" FROM "castle"."v_histrollup" WHERE "property"=$1 AND "staydate"$2 ORDER BY "property" LIMIT 10
Parameters: ["c5ba1990-c458-11e4-a8e5-0b887e7b0d20",null]
The date parameter is going as null and I get the following error:
error: syntax error at or near "$2"
Also the following query is not working:
app.models.Histrollup.find({where: {property: inputs.property, staydate: {between: [inputs.startStaydate, inputs.endStaydate]}}, limit:10})
SQL: SELECT "property","staydate","rolluptype","totnights","totrevenue","bymarketcd","bychannel","byroomtype" FROM "castle"."v_histrollup" WHERE "property"=$1 AND "staydate" BETWEEN $2 AND $3 ORDER BY "property" LIMIT 10
Parameters: ["c5ba1990-c458-11e4-a8e5-0b887e7b0d20",{"sql":"to_timestamp(?,'yyyy-mm-dd hh24:mi:ss.ms')","params":["2014-04-28T10:00:00.000Z"]},{"sql":"to_timestamp(?,'yyyy-mm-dd hh24:mi:ss.ms')","params":["2014-10-01T09:59:59.999Z"]}]
error: invalid input syntax for type date: "{"sql":"to_timestamp(?,'yyyy-mm-dd hh24:mi:ss.ms')","params":["2014-04-28T10:00:00.000Z"]}"
Regards,
-Kesav
The text was updated successfully, but these errors were encountered: