def test_redshift_query_uses_double_quote_chars(self): q = RedshiftQuery.from_(self.table_abc).select( self.table_abc.foo).groupby( self.table_abc.foo).having(self.table_abc.buz == 'fiz') self.assertEqual( "SELECT \"foo\" FROM \"abc\" GROUP BY \"foo\" HAVING \"buz\"='fiz'", str(q))
def test_redshift_query_uses_double_quote_chars(self): q = (RedshiftQuery.from_(self.table_abc).select( self.table_abc.foo).groupby( self.table_abc.foo).having(self.table_abc.buz == "fiz")) self.assertEqual( 'SELECT "foo" FROM "abc" GROUP BY "foo" HAVING "buz"=\'fiz\'', str(q))
def test_redshift_query_uses_double_quote_chars(self): q = RedshiftQuery.from_(self.table_abc).select( self.table_abc.foo ).groupby( self.table_abc.foo ).having( self.table_abc.buz == 'fiz' ) self.assertEqual("SELECT \"foo\" FROM \"abc\" GROUP BY \"foo\" HAVING \"buz\"='fiz'", str(q))
def test_redshift_query_uses_double_quote_chars(self): q = RedshiftQuery.from_(self.t).groupby(self.t.foo).select(self.t.foo) self.assertEqual('SELECT "foo" FROM "abc" GROUP BY "foo"', str(q))
def test_redshift_query_uses_double_quote_chars(self): q = RedshiftQuery.from_("abc").select("foo", "bar") self.assertEqual('SELECT "foo","bar" FROM "abc"', str(q))
def test__regexp_like__field_with_redshift_dialect(self): q = RedshiftQuery.from_(self.t).select( fn.RegexpLike(self.t.foo, '^a', 'x')) self.assertEqual( "SELECT REGEXP_MATCHES(\"foo\",\'^a\',\'x\') FROM \"abc\"", str(q))
def test__split_part__field_with_redshift_dialect(self): q = RedshiftQuery.from_(self.t).select(fn.SplitPart( self.t.foo, '|', 3)) self.assertEqual("SELECT SPLIT_PART(\"foo\",\'|\',3) FROM \"abc\"", str(q))
def test_redshift_query_uses_double_quote_chars(self): q = RedshiftQuery.from_('abc').select('foo', 'bar') self.assertEqual('SELECT "foo","bar" FROM "abc"', str(q))