maxtoroq / DbExtensions

Data-access framework with a strong focus on query composition, granularity and code aesthetics.
https://maxtoroq.github.io/DbExtensions/
Apache License 2.0
227 stars 41 forks source link

LIMIT and OFFSET incorrectly adding {0} instead of actual value. #62

Closed TwitchBronBron closed 6 years ago

TwitchBronBron commented 6 years ago

It seems like the .LIMIT and .OFFSET items aren't working quite right. I would expect that function to insert the raw integer into the query, but instead it inserts the string placeholder. Is this a bug or by design?

 [TestMethod]
        public void Limit_Clause_Inserts_Value()
        {

            var query = SQL
               .SELECT("*")
               .FROM("TABLE")
               .LIMIT(1);

            Assert.AreEqual("SELECT *\r\nFROM TABLE\r\nLIMIT 1", query.ToString());
        }

Assert.AreEqual failed. Expected:<SELECT FROM TABLE LIMIT 1>. Actual:<SELECT FROM TABLE LIMIT {0}>.

maxtoroq commented 6 years ago

It's by design, see #2.