Wow wow wow. Great work, I've been dreaming of when we'd have parameterized database queries in ss, and pdo integration too!
I wish I had more time to help out but serious props to this.
I'll try to check out out and give it some testing on one of my projects tomorrow at the least.
How confident are you that this is stable?
--
You received this message because you are subscribed to the Google Groups "SilverStripe Core Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to silverstripe-d...@googlegroups.com.
To post to this group, send email to silverst...@googlegroups.com.
Visit this group at http://groups.google.com/group/silverstripe-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
One of my issues is that I've taken it upon myself to write the DBQueryGenerator class in such a way that it semi-formats the resulting SQL query with indentation and newlines. This also means that test cases that were written with the old SQL generator code no longer pass, even if the SQL is correct in many cases (although there will be still cases where it's not correct).
Here is my question; Should I revert to unformatted SQL generation (no newlines, indentation, etc), should I rewrite the test cases to use the new format, or thirdly, should I write a SQL text comparison class that compares SQL strings accounting for things such as parameters, formatting, case difference, newlines, indentation, and the like?
Can't you just replace white space with a single space before comparison? I guess it isn't very robust... but it'll work 99% of the time?
I think it's much nicer to have it formatted, but it does add length to the queries, thus slowing down queries, increasing cache store sizes and memory usage. Perhaps only format if debugging?
Would it be difficult to turn formatting on just for debugging and leave it without the rest of the time?
> Don't suppose you'll be going to the meetup tonight in Auckland?
I would've left for the airport quite a while ago to still make the meetup (working from Germany) ;)
> I can document the changes around DataObject::write, if it makes it easier to review. I don't think any new tests are required here, as it still effectively behaves the same, other than using the new API.
I completely agree that the charset should be on the connection and not the database, I always found this a bit strange. But a deprecation notice would be nice.
1. Yes, I'm not sure how is best, though for this to be a useful debugging tool it really needs to return executable queries imo. A lot of the time I find errors in logic by copying the query from the debug to mysql query browser and then can see why I'm not getting expected results. At the moment, this is much more difficult and it's a much less useful debugging tool.
2. Thanks, I haven't had time to dig around at all, so it may be something obvious...
As for going into 3.1, I was just teasing, this looks good, but agree it needs more community testing and prep for going into a release. Let's save blaming bugs on you until next year...
Dan
While I'm pushing forward on this, and am doing less development, more testing, and preparation for deployment, are there any additional tasks that I'll need to make sure of before issuing a pull request?
I haven't yet looked into the Silverstripe installer and what work will need to be done there,
but are there other modules I'll need to update?
I hope I'm not stumbling along in the wrong direction here. :)