Skip to content

Commit

Permalink
support dateadd (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
roveo authored Nov 27, 2022
1 parent f46fa29 commit 265ce07
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 54 deletions.
2 changes: 1 addition & 1 deletion dictum_backend_vertica/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.4"
__version__ = "0.1.5"
4 changes: 4 additions & 0 deletions dictum_backend_vertica/vertica_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from dictum_core.backends.secret import Secret
from dictum_core.backends.sql_alchemy import SQLAlchemyBackend, SQLAlchemyCompiler
from sqlalchemy import Integer, cast
from sqlalchemy.sql import func


class VerticaCompiler(SQLAlchemyCompiler):
Expand Down Expand Up @@ -31,6 +32,9 @@ def datediff(self, part, start, end):
)
return super().datediff(part, start, end)

def dateadd(self, part, interval, value):
return func.timestampadd(part, interval, value)


class VerticaBackend(SQLAlchemyBackend):
type = "vertica"
Expand Down
63 changes: 12 additions & 51 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dictum-backend-vertica"
version = "0.1.4"
version = "0.1.5"
description = "Vertica backend for Dictum"
authors = ["Mikhail Akimov"]

Expand Down
2 changes: 1 addition & 1 deletion tests/test_dictum_backend_vertica.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


def test_version():
assert __version__ == "0.1.4"
assert __version__ == "0.1.5"


def test_entry_point():
Expand Down

0 comments on commit 265ce07

Please sign in to comment.