Skip to content

Commit

Permalink
Add Enum and JSONString type
Browse files Browse the repository at this point in the history
  • Loading branch information
magnudae committed Oct 18, 2024
1 parent b010157 commit 183e2d4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions nebula_carina/ngql/schema/data_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,20 @@ def __eq__(self, other):
def value2db_str(cls, value):
return 'NULL' if value is None else f'"{value}"'

class JSONString(DataType):
python_data_type = str

@classmethod
def value2db_str(cls, value):
return "NULL" if value is None else f"'{value}'"


class EnumType(DataType):
python_data_type = str

@classmethod
def value2db_str(cls, enum_value):
return "NULL" if enum_value is None else f'"{enum_value.value}"'

class Bool(DataType):
python_data_type = bool
Expand Down

0 comments on commit 183e2d4

Please sign in to comment.