use of com.developmentontheedge.sql.model.AstInsert in project be5 by DevelopmentOnTheEdge.
the class AstInsertBuildTest method testStringReplacementParameter.
@Test
public void testStringReplacementParameter() {
AstInsert insert = Ast.insert("users").fields("name", "value").values("?", "?");
assertEquals("INSERT INTO users (name, value) VALUES (?, ?)", insert.format());
}
use of com.developmentontheedge.sql.model.AstInsert in project be5 by DevelopmentOnTheEdge.
the class AstInsertBuildTest method testStringError.
@Test(expected = ClassCastException.class)
public void testStringError() {
AstInsert insert = Ast.insert("users").fields(3).values("Test");
assertEquals("INSERT INTO users (name) VALUES (?)", insert.format());
}
use of com.developmentontheedge.sql.model.AstInsert in project be5 by DevelopmentOnTheEdge.
the class AstInsertBuildTest method test.
@Test
public void test() {
AstInsert insert = Ast.insert("users").fields(new AstFieldReference("name")).values(AstReplacementParameter.get());
assertEquals("INSERT INTO users (name) VALUES (?)", insert.format());
}
use of com.developmentontheedge.sql.model.AstInsert in project be5 by DevelopmentOnTheEdge.
the class AstInsertBuildTest method testEscapedColumns.
@Test
public void testEscapedColumns() {
AstInsert insert = Ast.insert("users").fields("___name").values("Test");
assertEquals("INSERT INTO users (\"___name\") VALUES ('Test')", insert.format());
}
use of com.developmentontheedge.sql.model.AstInsert in project be5 by DevelopmentOnTheEdge.
the class AstInsertBuildTest method testString.
@Test
public void testString() {
AstInsert insert = Ast.insert("users").fields("name", "value").values("Test", 1);
assertEquals("INSERT INTO users (name, value) VALUES ('Test', 1)", insert.format());
}
Aggregations