Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sqlalchemy_bigquery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
STRUCT,
TIME,
TIMESTAMP,
JSON,
)

from . import _versions_helpers
Expand Down Expand Up @@ -80,6 +81,7 @@
"STRUCT",
"TIME",
"TIMESTAMP",
"JSON",
]

try:
Expand Down
2 changes: 2 additions & 0 deletions sqlalchemy_bigquery/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"STRUCT": STRUCT,
"TIMESTAMP": sqlalchemy.types.TIMESTAMP,
"TIME": sqlalchemy.types.TIME,
"JSON": sqlalchemy.types.JSON,
}

# By convention, dialect-provided types are spelled with all upper case.
Expand All @@ -66,6 +67,7 @@
STRING = _type_map["STRING"]
TIMESTAMP = _type_map["TIMESTAMP"]
TIME = _type_map["TIME"]
JSON = _type_map["JSON"]

try:
_type_map["GEOGRAPHY"] = GEOGRAPHY
Expand Down
3 changes: 3 additions & 0 deletions sqlalchemy_bigquery/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,9 @@ def visit_NUMERIC(self, type_, **kw):

visit_DECIMAL = visit_NUMERIC

def visit_JSON(self, type_, **kw):
return "JSON"


class BigQueryDDLCompiler(DDLCompiler):
option_datatype_mapping = {
Expand Down