-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSSQL TOP Limit style support #116
Conversation
…on/idiorm without tests. - Added detection and configuration option for mssql style 'select top' - Added mssql style top clauses - Added use of limit top style for the dblib driver.
Thank you for the pull request, but there are still a number of things that are off in this code. Some old code has been added back in ( Also the indentation of your code is not quite right. Please have tabs expand to four spaces. |
Oh and we need some tests for this new feature please. 😄 |
This should fix the issues you saw in the previous commit. I added some tests the same way it was done with the other ones but just for MSSQL since most of the test requires a working |
Still working on it... Somehow the tests exploded after double checking after the push... Sorry about that. |
I'm running into the issue that if I put my new tests with the others it seems like the fake PDO that is created during Have you ever run into that issue? |
Created 2 new static methods reset_config() and reset_db(). They are used in tests to make sure to reset what the static methods uses in between tests.
Ok I found my problem. It's caused because the tearDown() method in tests were not actually resetting everything. The As for I've added 2 static methods named Thanks! |
OK so I have completed a manual merge of this feature into a new feature branch of Idiorm. You'll notice that I made a number of changes to your code in the process. See: https://github.com/j4mie/idiorm/tree/feature.mssql_limit Please could you try the code for me and let me know how it goes? If it works for you then I will go ahead and merge it into develop. As a side note I have removed your code in the
|
Thank you for the merge! I did that change to #114 was when using I tested with idiorm the way it is and with the configuration for the quotes character and everything works great! If we want Thanks! |
Could you share the configuration you have setup to get this working? I can |
Of course! First of all you need to have the Once you have It's pretty straightforward, its just like ORM::configure('dblib:host=sqlhost;dbname=database_name');
ORM::configure('username', 'username');
ORM::configure('password', 'password');
ORM::configure('identifier_quote_character', ''); This of course works with multiple connection. That's how I'm currently using it. |
Thank you for the extra information. Just wanted to let you know this will be merged into develop soon. I am a little busy at the moment, but it's not forgotten! 😄 |
Why not automatically set identifier_quote_character for mssql / dblib? |
Suggest changing _detect_identifier_quote_character statement, switch case mssql returns " for the quote character. |
@samsong The correct identifier quote character is See my notes from a comment above for how to correctly configure your DB library: ...this should be setup via configuration as discussed in issue #114 and the SQL Server 2000 manual: http://msdn.microsoft.com/en-us/library/aa224033(v=sql.80).aspx
|
I have merged these changes and added documentation in commit: baff6ed |
As requested, this is a manual merge of the code that was in pull request #37 with support of multiple connections and forcing the use of the TOP style limit for the
dblib
driver.It is currently in use in it's current form in one my projects so I can attest that it's working.