andr04.
andr04.
WWindmill
Created by andr04. on 8/12/2023 in #help
MySQL script: invalid type: string "", expected a boolean
Conceptually, it looks like a workaround. It's a bigint, not string, and transforming it to string should be done on another layer just for JS, which https://hub.windmill.dev/scripts/mysql/577/execute-query-mysql does. I have other more complicated queries which will be difficult to synchronize, because they work good outside JS.
27 replies
WWindmill
Created by andr04. on 8/12/2023 in #help
MySQL script: invalid type: string "", expected a boolean
It's interesting fact, but Chrome Developer Tools in raw response shows the correct (not rounded IDs). I really recommend you on the backend transform bigint to string before send the result. And the code https://hub.windmill.dev/scripts/mysql/577/execute-query-mysql returns an object with rows and fields properties, and there the field id is interpreted as string. Will try to find a way to protect it from SQL injections.
27 replies
WWindmill
Created by andr04. on 8/12/2023 in #help
MySQL script: invalid type: string "", expected a boolean
No, I say about a conceptual BigInt problem with JavaScript. Actually, it is int64, but JS supports only int53, as a result the ID is rounding to some other ID.
27 replies
WWindmill
Created by andr04. on 8/12/2023 in #help
MySQL script: invalid type: string "", expected a boolean
The next problem is BigInt of id field. I'm looking for a way to interpret it as string. I know I can cast it, but maybe it's more correct way?
27 replies
WWindmill
Created by andr04. on 8/12/2023 in #help
MySQL script: invalid type: string "", expected a boolean
You're absolutely correct. I don't know why it was set to the wrong value, because I used UI to configure the resource. And schema exploring works even with a wrong config.
27 replies
WWindmill
Created by andr04. on 8/12/2023 in #help
MySQL script: invalid type: string "", expected a boolean
On the same time, Explore schema works and shows correct tables and its field types, that means resource is configured correctly. I'm confusing... 🤯
27 replies
WWindmill
Created by andr04. on 8/12/2023 in #help
MySQL script: invalid type: string "", expected a boolean
No, the resulting SQL should be
SELECT id from tariff LIMIT 0,100
SELECT id from tariff LIMIT 0,100
27 replies