@@ -18,8 +18,8 @@ This document defines a three-layer type architecture:
1818│ Core DataJoint Types (Layer 2) │
1919│ │
2020│ float32 float64 int64 uint64 int32 uint32 int16 uint16 │
21- │ int8 uint8 bool uuid json blob date datetime │
22- │ char(n) varchar(n) enum(...) │
21+ │ int8 uint8 bool uuid json bytes date datetime │
22+ │ char(n) varchar(n) enum(...) decimal(n,f) │
2323├───────────────────────────────────────────────────────────────────┤
2424│ Native Database Types (Layer 1) │
2525│ │
@@ -54,56 +54,56 @@ MySQL and PostgreSQL backends. Users should prefer these over native database ty
5454
5555### Numeric Types
5656
57- | Core Type | Description | MySQL |
58- | -----------| -------------| -------|
59- | ` int8 ` | 8-bit signed | ` TINYINT ` |
60- | ` int16 ` | 16-bit signed | ` SMALLINT ` |
61- | ` int32 ` | 32-bit signed | ` INT ` |
62- | ` int64 ` | 64-bit signed | ` BIGINT ` |
63- | ` uint8 ` | 8-bit unsigned | ` TINYINT UNSIGNED ` |
64- | ` uint16 ` | 16-bit unsigned | ` SMALLINT UNSIGNED ` |
65- | ` uint32 ` | 32-bit unsigned | ` INT UNSIGNED ` |
66- | ` uint64 ` | 64-bit unsigned | ` BIGINT UNSIGNED ` |
67- | ` float32 ` | 32-bit float | ` FLOAT ` |
68- | ` float64 ` | 64-bit float | ` DOUBLE ` |
69- | ` decimal(n,f) ` | Fixed-point | ` DECIMAL(n,f) ` |
57+ | Core Type | Description | MySQL | PostgreSQL |
58+ | -----------| -------------| -------| ------------ |
59+ | ` int8 ` | 8-bit signed | ` TINYINT ` | ` SMALLINT ` |
60+ | ` int16 ` | 16-bit signed | ` SMALLINT ` | ` SMALLINT ` |
61+ | ` int32 ` | 32-bit signed | ` INT ` | ` INTEGER ` |
62+ | ` int64 ` | 64-bit signed | ` BIGINT ` | ` BIGINT ` |
63+ | ` uint8 ` | 8-bit unsigned | ` TINYINT UNSIGNED ` | ` SMALLINT ` |
64+ | ` uint16 ` | 16-bit unsigned | ` SMALLINT UNSIGNED ` | ` INTEGER ` |
65+ | ` uint32 ` | 32-bit unsigned | ` INT UNSIGNED ` | ` BIGINT ` |
66+ | ` uint64 ` | 64-bit unsigned | ` BIGINT UNSIGNED ` | ` NUMERIC(20) ` |
67+ | ` float32 ` | 32-bit float | ` FLOAT ` | ` REAL ` |
68+ | ` float64 ` | 64-bit float | ` DOUBLE ` | ` DOUBLE PRECISION ` |
69+ | ` decimal(n,f) ` | Fixed-point | ` DECIMAL(n,f) ` | ` NUMERIC(n,f) ` |
7070
7171### String Types
7272
73- | Core Type | Description | MySQL |
74- | -----------| -------------| -------|
75- | ` char(n) ` | Fixed-length | ` CHAR(n) ` |
76- | ` varchar(n) ` | Variable-length | ` VARCHAR(n) ` |
73+ | Core Type | Description | MySQL | PostgreSQL |
74+ | -----------| -------------| -------| ------------ |
75+ | ` char(n) ` | Fixed-length | ` CHAR(n) ` | ` CHAR(n) ` |
76+ | ` varchar(n) ` | Variable-length | ` VARCHAR(n) ` | ` VARCHAR(n) ` |
7777
7878### Boolean
7979
80- | Core Type | Description | MySQL |
81- | -----------| -------------| -------|
82- | ` bool ` | True/False | ` TINYINT ` |
80+ | Core Type | Description | MySQL | PostgreSQL |
81+ | -----------| -------------| -------| ------------ |
82+ | ` bool ` | True/False | ` TINYINT ` | ` BOOLEAN ` |
8383
8484### Date/Time Types
8585
86- | Core Type | Description | MySQL |
87- | -----------| -------------| -------|
88- | ` date ` | Date only | ` DATE ` |
89- | ` datetime ` | Date and time | ` DATETIME ` |
86+ | Core Type | Description | MySQL | PostgreSQL |
87+ | -----------| -------------| -------| ------------ |
88+ | ` date ` | Date only | ` DATE ` | ` DATE ` |
89+ | ` datetime ` | Date and time | ` DATETIME ` | ` TIMESTAMP ` |
9090
9191### Binary Types
9292
93- The core ` blob ` type stores raw bytes without any serialization. Use ` <djblob> ` AttributeType
93+ The core ` bytes ` type stores raw bytes without any serialization. Use ` <djblob> ` AttributeType
9494for serialized Python objects.
9595
96- | Core Type | Description | MySQL |
97- | -----------| -------------| -------|
98- | ` blob ` | Raw bytes | ` LONGBLOB ` |
96+ | Core Type | Description | MySQL | PostgreSQL |
97+ | -----------| -------------| -------| ------------ |
98+ | ` bytes ` | Raw bytes | ` LONGBLOB ` | ` BYTEA ` |
9999
100100### Other Types
101101
102- | Core Type | Description | MySQL |
103- | -----------| -------------| -------|
104- | ` json ` | JSON document | ` JSON ` |
105- | ` uuid ` | UUID | ` BINARY(16) ` |
106- | ` enum(...) ` | Enumeration | ` ENUM(...) ` |
102+ | Core Type | Description | MySQL | PostgreSQL |
103+ | -----------| -------------| -------| ------------ |
104+ | ` json ` | JSON document | ` JSON ` | ` JSONB ` |
105+ | ` uuid ` | UUID | ` BINARY(16) ` | ` UUID ` |
106+ | ` enum(...) ` | Enumeration | ` ENUM(...) ` | ` VARCHAR ` + check |
107107
108108### Native Passthrough Types
109109
0 commit comments