nette / database

💾 A database layer with a familiar PDO-like API but much more powerful. Building queries, advanced joins, drivers for MySQL, PostgreSQL, SQLite, MS SQL Server and Oracle.
https://doc.nette.org/database
Other
491 stars 105 forks source link

Microsoft SQL Server 2012 SYNTAX ERROR #112

Open ghost opened 8 years ago

ghost commented 8 years ago

Firstly, I would like to send many, many thanks to Davit to implement support of MSSQL. I found one important bug.

$this->context->table(...)->limit(100,10) generate bad syntaxt.

SELECT * FROM [table] OFFSET 10 ROWS FETCH NEXT 100 ROWS ONLY

This syntax works only, if I use order clausule, for example: SELECT * FROM [table] ORDER BY [id] DESC OFFSET 10 ROWS FETCH NEXT 100 ROWS ONLY

dg commented 8 years ago

Yes, it is known (and good) limitation.

ghost commented 8 years ago

Logic tells me, that you have truth. I was customized the driver in previous Nette version, and if ordering is not set in context, ordering is set automatically from identity column. Thank you for fast answer :-) Have a nice day.