-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtypes.py
More file actions
26 lines (23 loc) · 549 Bytes
/
types.py
File metadata and controls
26 lines (23 loc) · 549 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import datetime
sqlalchemy_types_map = {
"INTEGER": int,
"BIGINT": int,
"SMALLINT": int,
"VARCHAR": str,
"FLOAT": float,
"DECIMAL": float,
"NUMERIC": float,
"CHAR": str,
"TEXT": str,
"TIMESTAMP": datetime.datetime,
"DATETIME": datetime.datetime,
"DATE": datetime.date,
"BOOLEAN": bool,
"JSONB": (str, "json"),
"JSON": (str, "json"),
"TIME": datetime.time,
"SMALLINT[]": (list, int),
"VARCHAR[]": (list, str),
"INTEGER[]": (list, int),
}
types_map = sqlalchemy_types_map