How to use the pypika.Interval function in PyPika

To help you get started, we’ve selected a few PyPika examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kayak / pypika / test / test_functions.py View on Github external
def test_add_microsecond(self):
        c = self.dt + Interval(microseconds=1)

        self.assertEqual("dt+INTERVAL 1 MICROSECOND", str(c))
github kayak / pypika / test / test_functions.py View on Github external
def test_add_value_complex_expressions(self):
        c = self.dt + Interval(quarters=1) + Interval(weeks=1)

        self.assertEqual("dt+INTERVAL 1 QUARTER+INTERVAL 1 WEEK", str(c))
github kayak / pypika / test / test_functions.py View on Github external
def test_add_day_second(self):
        c = self.dt + Interval(days=1, seconds=1)

        self.assertEqual("dt+INTERVAL 1 0:0:1 DAY_SECOND", str(c))
github kayak / pypika / test / test_functions.py View on Github external
def test_add_hour_second(self):
        c = self.dt + Interval(hours=1, seconds=1)

        self.assertEqual("dt+INTERVAL 1:0:1 HOUR_SECOND", str(c))
github kayak / pypika / test / test_functions.py View on Github external
def test_add_day_minute(self):
        c = self.dt + Interval(days=1, minutes=1)

        self.assertEqual("dt+INTERVAL 1 0:1 DAY_MINUTE", str(c))
github kayak / pypika / test / test_functions.py View on Github external
def test_add_day(self):
        c = self.dt + Interval(days=1)

        self.assertEqual("dt+INTERVAL 1 DAY", str(c))
github kayak / pypika / test / test_functions.py View on Github external
def test_add_day_microsecond(self):
        c = self.dt + Interval(days=1, microseconds=1)

        self.assertEqual("dt+INTERVAL 1 0:0:0.1 DAY_MICROSECOND", str(c))
github kayak / pypika / test / test_functions.py View on Github external
def test_add_second(self):
        c = self.dt + Interval(seconds=1)

        self.assertEqual("dt+INTERVAL 1 SECOND", str(c))
github kayak / pypika / test / test_functions.py View on Github external
def test_add_day_hour(self):
        c = self.dt + Interval(days=1, hours=1)

        self.assertEqual("dt+INTERVAL 1 1 DAY_HOUR", str(c))
github kayak / pypika / test / test_functions.py View on Github external
def test_add_quarter(self):
        c = self.dt + Interval(quarters=1)

        self.assertEqual("dt+INTERVAL 1 QUARTER", str(c))