Skip to content

Commit ad5bf2e

Browse files
authored
Merge pull request #41 from BolshakovNO/add-uuid-type
add uuid type
2 parents a634e5a + 2ec1aa8 commit ad5bf2e

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
__pycache__/
33
*.py[cod]
44
*$py.class
5+
.idea
56

67
# C extensions
78
*.so

clickhouse_sqlalchemy/drivers/base.py

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
'Float64': FLOAT,
3333
'Float32': FLOAT,
3434
'String': types.String,
35+
'UUID': types.UUID,
3536
'FixedString': types.String,
3637
'Enum8': types.Enum8,
3738
'Enum16': types.Enum16,
@@ -398,6 +399,9 @@ def visit_enum8(self, type_, **kw):
398399
def visit_enum16(self, type_, **kw):
399400
return self._render_enum('Enum16', type_, **kw)
400401

402+
def visit_uuid(self, type_, **kw):
403+
return 'UUID'
404+
401405

402406
class ClickHouseExecutionContextBase(default.DefaultExecutionContext):
403407
@sa_util.memoized_property

clickhouse_sqlalchemy/types.py

+4
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ def __init__(self, nested_type):
4343
super(Nullable, self).__init__()
4444

4545

46+
class UUID(String):
47+
__visit_name__ = 'uuid'
48+
49+
4650
class Int8(Int):
4751
__visit_name__ = 'int8'
4852

0 commit comments

Comments
 (0)