Fresh install - selected MSSQL - using a datatype of mediumtext it’s throwing the above error.
{
“datasources”:{
“preside”:{
“host”:“localhost”,
“dbdriver”:“MSSQL”,
“password”:“xxxxxxxxxx”,
“database”:“xxxxxx_preside”,
“port”:“1433”,
“username”:“xxxxxx_preside”
}
},
“templateCharset”:“UTF-8”,
“webCharset”:“UTF-8”,
“resourceCharset”:“UTF-8”,
“dotNotationUpperCase”:false
}
mediumtext isn’t a valid MSSQL datatype - it looks to be using config files for MySQL - I’ve pasted in my .config.json about confirming DB type.
We have limited support for MSSQL and do not actively check or maintain compatibility. This looks like a bug in the adapter if that is the case. Can I check which version of MSSQL you are running (highly recommend using MariaDB/MySQL if you are able)?
Our core product is essentially designed for (and on) MySQL/MariaDB, so although we do support MSSQL there are occasionally bits that fall through the gaps!
If you are able to edit /preside/system/services/database/adapters/MsSqlAdapter.cfc, at around line 42 you’ll find this:
case "longtext":
case "text":
arguments.maxLength = 0;
columnDef &= _getUseVarcharMaxForText() ? "varchar(max)" : "text";
break;
Can you add an extra line and try again?
case "longtext":
case "mediumtext":
case "text":
arguments.maxLength = 0;
columnDef &= _getUseVarcharMaxForText() ? "varchar(max)" : "text";
break;
If that works for you, we’ll get it rolled into the released code…
I was about to post the same. Thanks Seb.
A big thank for your helpful advice. Interestingly, I made the change you suggested right after I posted my question, and it resolved the issue I was facing. However, I soon discovered that there were more spots that needed attention.
After considering your feedback, I think I might just go ahead and use MySQL as you have recommended. Thanks for the support and answering my question.
Thanks and welcome @mikeraphone
We’d love to be able to support more engines but we simply don’t have anyone using right now so difficult to justify the effort. I guess it would be wise to be clearer about that in the docs and commands - i.e. add a (unsupported and untested) note on the db engines in the preside start
command.
Hey team - another setup question. I created a new instance of the Admin sample app - I’m getting an error “datasource preside” not found - It’s easy enough for me to create but thought I would report it incase it was meant to be automated as part of the setup.
It is, and works for me and everywhere tested. Did you use box start
perhaps instead of preside start
?
If this was in the already initialised first project also, then it might have been an issue with existing cfconfig file (preside start
will only give you the datasource wizard when no datasource detected in cfconfig)
Hi @dominic.watson - definitely followed the developer quick start guide with the site creation - can confirm I used preside start. Here is the error below:
I have confirmed connectivity to my MySQL instance also.
Curious. Thanks for the persistence. Can you confirm what the contents of the C:\dev\h2ohub_preside\
directory looks like? If the preside start
wizard had worked correctly, I’d expect you to have been prompted to enter db connection details and for those to have been persisted in a cfconfig.json file. From there, Commandbox should take care of creating the datasource for you.
Thank you also for your persistence @dominic.watson I am very keen to give preside a fair dinkum try for my new app I am writing.
To answering your questions. I ran preside start - the wizard ran, I entered my db details and CommandBox proceeded to create the instance.
Here is the additional information you have requested. Looking at this further I believe even it could be my CommandBox setup as I am not able to browse the server admin interface, to check/created the datasource. I get this:
I am familiar with the security behind CommandBox and what is required to set up the password and the like however nothing appears to be working.
Success! I changed a few things in my CommandBox config and cleared my temporary internet files. Did the trick!