I’m trying to create a datasource programmatically and append to the connection string. I need to add the following MSSQL connection string: “DateTimeInputParameterType=dateTime” to make preserve sending datetime params as “datetime” and not “datetime2” values.
Looking at the documentation, it would appear I should be able to pass the following to the updateDatasource() method of the Administrator.cfc:
“custom”: “DateTimeInputParameterType=dateTime”
However, the actual component (Lucee/Administrator.cfc at 7d73d7357de7a0b0e91d7b7df27b37aa6171d67c · lucee/Lucee · GitHub ) does not seem to support this.
Or should it be:
customDateTimeInputParameterType=“dateTime”
custom needs to be a struct, but the var custom=structNew();
should go, rather updateDatasource should accept custom as an argument
custom = { DateTimeInputParameterType":"dateTime" }
customDateTimeInputParameterType="dateTime"
should work tho
boolean customUseLegacyDatetimeCode=false ){ var driverNames=structnew("linked"); driverNames=ComponentListPackageAsStruct("lucee-server.admin.dbdriver",driverNames); driverNames=ComponentListPackageAsStruct("lucee.admin.dbdriver",driverNames); driverNames=ComponentListPackageAsStruct("dbdriver",driverNames); var driver=createObject("component", drivernames[ arguments.type ]); var custom=structNew(); loop collection="#arguments#" item="key"{ if(findNoCase("custom",key) EQ 1){ l=len(key); custom[mid(key,8,l-8+1)]=arguments[key]; } } if( arguments.type == "MSSQL" ){ custom["databaseName"] = arguments.database; }
Thanks!. That’s what I was really thinking was probably correct.
What’s the customUseLegacyDatetimeCode
do in Lucee 6?
I have a feeling that might be doing what I’m wanting, but I’m not sure based on the comment hint, which just says:
@customUseLegacyDatetimeCode Use code for DATE/TIME/DATETIME/TIMESTAMP handling in result sets and statements
it’s a mysql jdbc feature/quirk
opened 10:58AM - 24 Apr 17 UTC
closed 07:31AM - 25 Dec 17 UTC
For future discussion about embulk-input-mysql.
It seems better to set useLegacyDatetimeCode=false by default.
For example, If server use UTC timezone, and client use...
FYI, I added a PR on that ticket
1 Like