Ejemplo n.º 1
0
        public void LTrim()
        {
            IAlias    person = sql.Alias("person");
            IFunction func   = SqlFn.LTrim(person["Name"]);

            QueryResult result = engine.Compile(func);

            Assert.Equal("LTRIM(\"person\".\"name\")", result.Sql);
            Assert.Equal(new Dictionary <string, object>(), result.Parameters);
        }
Ejemplo n.º 2
0
        public void LTrim_Trim_Leading()
        {
            engine.AddFunction(FunctionName.LTrim, FunctionHelper.TrimLeading);

            IAlias    person = sql.Alias("person");
            IFunction func   = SqlFn.LTrim(person["Name"]);

            QueryResult result = engine.Compile(func);

            Assert.Equal("TRIM(LEADING FROM \"person\".\"Name\")", result.Sql);
            Assert.Equal(new Dictionary <string, object>(), result.Parameters);
        }
Ejemplo n.º 3
0
        public void LTrim_Character()
        {
            IAlias    person = sql.Alias("person");
            IFunction func   = SqlFn.LTrim(person["Name"], ",");

            QueryResult result = engine.Compile(func);

            Assert.Equal("LTRIM(\"person\".\"Name\", @p0)", result.Sql);
            Assert.Equal(new Dictionary <string, object>
            {
                ["@p0"] = ","
            }, result.Parameters);
        }
Ejemplo n.º 4
0
        public void LTrim_Character()
        {
            IAlias    person = sql.Alias("person");
            IFunction func   = SqlFn.LTrim(person["Name"], ",");

            QueryResult result = engine.Compile(func);

            Assert.Equal("TRIM(LEADING @p0 FROM `person`.`Name`)", result.Sql);
            Assert.Equal(new Dictionary <string, object>()
            {
                ["@p0"] = ","
            }, result.Parameters);
        }