Ejemplo n.º 1
0
def test_string_literals_correctly_quoted():
    s = sql.select([
        func.look_at(sql.column("something") == "here's a single-quote")
    ]).select_from(
        sql.table("something_else")
    ).compile(
        compile_kwargs={"literal_binds": True},
        dialect=bq.BQDialect()
    )
    assert "here\\'s" in str(s)
Ejemplo n.º 2
0
def test_string_literal_does_not_use_old_sql_quote_escaping():
    s = sql.select([
        func.look_at(sql.column("something") == "here's a single-quote")
    ]).select_from(
        sql.table("something_else")
    ).compile(
        compile_kwargs={"literal_binds": True},
        dialect=bq.BQDialect()
    )
    assert "here''s" not in str(s)
Ejemplo n.º 3
0
def test_string_literals_correctly_quoted():
    s = sql.select([
        func.look_at(sql.column("something") == "here's a single-quote")
    ]).select_from(sql.table("something_else")).compile(
        compile_kwargs={"literal_binds": True}, dialect=bq.BQDialect())
    assert "here\\'s" in str(s)
Ejemplo n.º 4
0
def test_string_literal_does_not_use_old_sql_quote_escaping():
    s = sql.select([
        func.look_at(sql.column("something") == "here's a single-quote")
    ]).select_from(sql.table("something_else")).compile(
        compile_kwargs={"literal_binds": True}, dialect=bq.BQDialect())
    assert "here''s" not in str(s)