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)
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)
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)
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)