Skip to content

Commit

Permalink
Embeding queries
Browse files Browse the repository at this point in the history
  • Loading branch information
Sibyx committed Dec 10, 2021
1 parent cbd566a commit 0d8ec18
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.11.0 : 2021-12-10

- **Feature**: More benevolent type nesting

## 0.10.0 : 2021-11-30

- **Feature**: `Case` introduced (without docs, there was no time, sry, let's call it Easter Egg for a while)
Expand Down
3 changes: 2 additions & 1 deletion duckql/functions/sum.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
from ..properties.property import Property
from ..structures.cast_operator import CastOperator
from ..structures.case import Case
from ..structures.operator import Operator


class Sum(BaseFunction):
obj: Literal['functions.Sum'] = 'functions.Sum'
property: Union[Property, BaseFunction, CastOperator, Case]
property: Union[Property, BaseFunction, CastOperator, Case, "Operator"]
alias: str = None

def to_sql(self) -> str:
Expand Down
11 changes: 2 additions & 9 deletions duckql/structures/operator.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
from enum import Enum
from typing import List, Union

from duckql.functions.base import BaseFunction
from typing import List

try:
from typing import Literal
except ImportError:
from typing_extensions import Literal

from ..base import BaseType
from ..properties.constant import Constant
from ..properties.property import Property
from ..properties.boolean import Boolean
from ..structures.interval import Interval
from .comparision import Comparision


class Operator(BaseType):
Expand Down Expand Up @@ -42,7 +35,7 @@ def __str__(self):

obj: Literal['structures.Operator'] = 'structures.Operator'
operation: Operation
properties: List[Union[BaseFunction, Constant, Property, Boolean, Comparision, Interval, "Operator"]]
properties: List[BaseType]
alias: str = None

def to_sql(self) -> str:
Expand Down
2 changes: 1 addition & 1 deletion duckql/structures/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Config:

obj: Literal['structures.Query'] = 'structures.Query'
entity: Union[str, 'Query']
properties: List[Union[BaseFunction, Property, Distinct, CastOperator, Case]]
properties: List[Union[BaseFunction, Property, Distinct, CastOperator, Case, Operator]]
joins: List[Join] = []
conditions: Union[Operator, Comparision] = None
having: Union[Operator, Comparision] = None
Expand Down
2 changes: 1 addition & 1 deletion duckql/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.10.0'
__version__ = '0.11.0'
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 = "duckql-python"
version = "0.10.0"
version = "0.11.0"
description = "JSON declarative SQL conversion library"
authors = ["Jakub Dubec <jakub.dubec@gmail.com>"]
license = "MIT"
Expand Down

0 comments on commit 0d8ec18

Please sign in to comment.