示例#1
0
 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))
示例#2
0
 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))
示例#3
0
 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))
示例#4
0
    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))
示例#5
0
    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))
示例#6
0
    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))
示例#7
0
    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))
示例#8
0
    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))
示例#9
0
    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))