Example #1
0
        public void LastInsertId()
        {
            IFunction func = (IFunction)sql.Val(() => SqlExp.LastInsertId());

            Exception ex = Assert.Throws <ClauseNotSupportedException>(() => engine.Compile(func));

            Assert.Equal($"Function \"LASTINSERTID\" is not supported in this engine.", ex.Message);
        }
Example #2
0
        public void LastInsertId()
        {
            IFunction func = (IFunction)sql.Val(() => SqlExp.LastInsertId());

            QueryResult result = engine.Compile(func);

            Assert.Equal("LAST_INSERT_ID()", result.Sql);
            Assert.Equal(new Dictionary <string, object>(), result.Parameters);
        }
        public void LastInsertId()
        {
            Exception ex = Assert.Throws <InvalidOperationException>(() => SqlExp.LastInsertId());

            Assert.Equal("Only for expressions.", ex.Message);
        }