Repository: ariga/atlas
Pull request #963 (2022-07-19 12:33:36)

doc: refactor column types page


Patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 69d94b89..1cab0300 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -35,9 +35,6 @@ jobs:
             ${{ runner.os }}-go-
       - name: run "go generate ./..."
         run: go generate ./...
-      - name: run "go generate internal/typedoc"
-        working-directory: internal/typedoc
-        run: go generate ./...
       - name: go generate cmd/atlas
         working-directory: cmd/atlas
         run: go generate ./...
diff --git a/doc/md/ddl/sql-types.md b/doc/md/ddl/sql-types.md
new file mode 100644
index 00000000..fe86e93e
--- /dev/null
+++ b/doc/md/ddl/sql-types.md
@@ -0,0 +1,322 @@
+---
+id: ddl-sql-types
+title: SQL Column Types
+slug: /ddl/sql-types
+---
+
+## MySQL
+
+### Bit
+
+The `bit` type allows creating [BIT](https://dev.mysql.com/doc/refman/8.0/en/bit-type.html) columns.
+An optional size attribute allows controlling the number of bits stored in a column, ranging from 1 to 64.
+
+```hcl
+table "t" {
+  schema = schema.test
+  column "c1" {
+    type = bit
+  }
+  column "c2" {
+    type = bit(4)
+  }
+}
+```
+
+### Binary
+
+The `varbinary` and `binary` types allow storing binary byte strings.
+
+```hcl
+table "t" {
+  schema = schema.test
+  column "c1" {
+    // Equals to binary(1).
+    type = binary
+  }
+  column "c2" {
+    type = binary(10)
+  }
+  column "c3" {
+    type = varbinary(255)
+  }
+}
+```
+
+### Blob
+
+The `tinyblob`, `mediumblob`, `blob` and `longblob` types allow storing binary large objects.
+
+```hcl
+table "t" {
+  schema = schema.test
+  column "c1" {
+    type = tinyblob
+  }
+  column "c2" {
+    type = mediumblob
+  }
+  column "c3" {
+    type = blob
+  }
+  column "c4" {
+    type = longblob
+  }
+}
+```
+
+### Boolean
+
+The `bool` and `boolean` types are mapped to `tinyint(1)` in MySQL. Still, Atlas allows maintaining columns of type `bool`
+in the schema for simplicity reasons.
+
+```hcl
+table "t" {
+  schema = schema.test
+  column "c1" {
+    type = bool
+  }
+  column "c2" {
+    type = boolean
+  }
+}
+```
+
+Learn more about the motivation for these types in the
+[MySQL website](https://dev.mysql.com/doc/refman/8.0/en/other-vendor-data-types.html).
+
+### Date and Time
+
+Atlas supports the standard MySQL types for storing date and time values: `time`, `timestamp`, `date`, `datetime`,
+and `year`.
+
+```hcl
+table "t" {
+  schema = schema.test
+  column "c1" {
+    type = time
+  }
+  column "c2" {
+    type = timestamp
+  }
+  column "c3" {
+    type = date
+  }
+  column "c4" {
+    type = datetime
+  }
+  column "c5" {
+    type = year
+  }
+  column "c6" {
+    type = time(1)
+  }
+  column "c7" {
+    type = timestamp(2)
+  }
+  column "c8" {
+    type = datetime(4)
+  }
+}
+```
+
+### Fixed Point
+
+The `decimal` and `numeric` types are supported for storing exact numeric values. Note that in MySQL the two types
+are identical.
+
+```hcl
+table "t" {
+  schema = schema.test
+  column "c1" {
+    // Equals to decimal(10) as the
+    // default precision is 10.
+    type = decimal
+  }
+  column "c2" {
+    // Equals to decimal(5,0).
+    type = decimal(5)
+  }
+  column "c3" {
+    type = decimal(5,2)
+  }
+  column "c4" {
+    type     = numeric
+    unsigned = true
+  }
+}
+```
+
+### Floating Point
+
+The `float` and `double` types are supported for storing approximate numeric values.
+
+```hcl
+table "t" {
+  schema = schema.test
+  column "c1" {
+    type = float
+  }
+  column "c2" {
+    type = double
+  }
+  column "c3" {
+    type     = float
+    unsigned = true
+  }
+  column "c4" {
+    type     = double
+    unsigned = true
+  }
+}
+```
+
+### Enum
+
+The `enum` type allows storing a set of enumerated values.
+
+```hcl
+table "t" {
+  schema = schema.test
+  column "c1" {
+    type = enum("a", "b")
+  }
+  column "c2" {
+    type = enum(
+      "c",
+      "d",
+    )
+  }
+}
+```
+
+### Integer
+
+The `tinyint`, `smallint`, `int`, `mediumint`, `bigint` integer types are support by Atlas.
+
+```hcl
+table "t" {
+  schema = schema.test
+  column "c1" {
+    type = int
+  }
+  column "c2" {
+    type = tinyint
+  }
+  column "c3" {
+    type = smallint
+  }
+  column "c4" {
+    type = mediumint
+  }
+  column "c5" {
+    type = bigint
+  }
+}
+```
+
+#### Integer Attributes
+
+The [`auto_increment`](https://dev.mysql.com/doc/refman/8.0/en/numeric-type-attributes.html), and `unsigned` attributes
+are also supported by integer types.
+
+```hcl
+table "t" {
+  schema = schema.test
+  column "c1" {
+    type     = tinyint
+    unsigned = true
+  }
+  column "c2" {
+    type           = smallint
+    auto_increment = true
+  }
+  primary_key {
+    columns = [column.c2]
+  }
+}
+```
+
+### JSON
+
+The `json` type allows storing JSON objects.
+
+```hcl
+table "t" {
+  schema = schema.test
+  column "c1" {
+    type = json
+  }
+}
+```
+
+### Set
+
+The `set` type allows storing a set of values.
+
+```hcl
+table "t" {
+  schema = schema.test
+  column "c1" {
+    type = set("a", "b")
+  }
+  column "c2" {
+    type = set(
+      "c",
+      "d",
+    )
+  }
+}
+```
+
+### String
+
+Atlas supports the standard MySQL types for storing string values. `varchar`, `char`, `tinytext`, `mediumtext`, `text`
+and `longtext`.
+
+```hcl
+table "t" {
+  schema = schema.test
+  column "c1" {
+    type = varchar(255)
+  }
+  column "c2" {
+    type = char(1)
+  }
+  column "c3" {
+    type = tinytext
+  }
+  column "c4" {
+    type = mediumtext
+  }
+  column "c5" {
+    type = text
+  }
+  column "c6" {
+    type = longtext
+  }
+}
+```
+
+### Spatial
+
+The `geometry`, `point`, `multipoint`, `linestring` and the rest of the
+[MySQL spatial types](https://dev.mysql.com/doc/refman/8.0/en/spatial-type-overview.html) are supported by Atlas.
+
+```hcl
+table "t" {
+  schema = schema.test
+  column "c1" {
+    type = geometry
+  }
+  column "c2" {
+    type = point
+  }
+  column "c3" {
+    type = multipoint
+  }
+  column "c4" {
+    type = linestring
+  }
+}
+```
\ No newline at end of file
diff --git a/doc/md/ddl/sql.mdx b/doc/md/ddl/sql.mdx
index afe0ab67..c75e2d5d 100644
--- a/doc/md/ddl/sql.mdx
+++ b/doc/md/ddl/sql.mdx
@@ -309,7 +309,7 @@ are tied to a specific database engine and version. This may change in a future
 of Atlas as we plan to add "Virtual Types" support. This section lists the various
 types that are supported in each database.
 
-For a full list of supported column types, [click here](sql_types.md).
+For a full list of supported column types, [click here](sql-types.md).
 
 ## Primary Key
 
diff --git a/doc/md/ddl/sql_types.md b/doc/md/ddl/sql_types.md
deleted file mode 100644
index fe50a4ea..00000000
--- a/doc/md/ddl/sql_types.md
+++ /dev/null
@@ -1,2500 +0,0 @@
----
-id: ddl-sql-types
-title: SQL Column Types
-slug: /ddl/sql-types
----
-
-### MySQL/MariaDB
-
-<table>
-    <thead>
-    <tr>
-        <th>HCL</th>
-        <th>SQL</th>
-        <th>Attributes</th>
-        <th>Example</th>
-    </tr>
-    </thead>
-    <tbody>
-        
-        <tr>
-            <td>bigint</td>
-            <td>bigint</td>
-            <td>
-                <ul>
-                        <li>unsigned (bool)</li>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = bigint(255)
-                </pre>
-                
-                <pre>
-                    unsigned = true
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>binary</td>
-            <td>binary</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = binary(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>bit</td>
-            <td>bit</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = bit(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>blob</td>
-            <td>blob</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = blob(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>bool</td>
-            <td>bool</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = bool
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>boolean</td>
-            <td>boolean</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = boolean
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>char</td>
-            <td>char</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = char(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>date</td>
-            <td>date</td>
-            <td>
-                <ul>
-                        <li>precision (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = date(6)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>datetime</td>
-            <td>datetime</td>
-            <td>
-                <ul>
-                        <li>precision (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = datetime(6)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>decimal</td>
-            <td>decimal</td>
-            <td>
-                <ul>
-                        <li>unsigned (bool)</li>
-                        <li>precision (int)</li>
-                        <li>scale (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = decimal(6,2)
-                </pre>
-                
-                <pre>
-                    unsigned = true
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>double</td>
-            <td>double</td>
-            <td>
-                <ul>
-                        <li>unsigned (bool)</li>
-                        <li>precision (int)</li>
-                        <li>scale (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = double(6,2)
-                </pre>
-                
-                <pre>
-                    unsigned = true
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>enum</td>
-            <td>enum</td>
-            <td>
-                <ul>
-                        <li>values (slice)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = enum("a","b")
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>float</td>
-            <td>float</td>
-            <td>
-                <ul>
-                        <li>unsigned (bool)</li>
-                        <li>precision (int)</li>
-                        <li>scale (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = float(6,2)
-                </pre>
-                
-                <pre>
-                    unsigned = true
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>geometry</td>
-            <td>geometry</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = geometry
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>geometrycollection</td>
-            <td>geometrycollection</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = geometrycollection
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>int</td>
-            <td>int</td>
-            <td>
-                <ul>
-                        <li>unsigned (bool)</li>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = int(255)
-                </pre>
-                
-                <pre>
-                    unsigned = true
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>json</td>
-            <td>json</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = json
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>linestring</td>
-            <td>linestring</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = linestring
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>longblob</td>
-            <td>longblob</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = longblob
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>longtext</td>
-            <td>longtext</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = longtext
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>mediumblob</td>
-            <td>mediumblob</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = mediumblob
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>mediumint</td>
-            <td>mediumint</td>
-            <td>
-                <ul>
-                        <li>unsigned (bool)</li>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = mediumint(255)
-                </pre>
-                
-                <pre>
-                    unsigned = true
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>mediumtext</td>
-            <td>mediumtext</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = mediumtext
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>multilinestring</td>
-            <td>multilinestring</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = multilinestring
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>multipoint</td>
-            <td>multipoint</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = multipoint
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>multipolygon</td>
-            <td>multipolygon</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = multipolygon
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>numeric</td>
-            <td>numeric</td>
-            <td>
-                <ul>
-                        <li>unsigned (bool)</li>
-                        <li>precision (int)</li>
-                        <li>scale (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = numeric(6,2)
-                </pre>
-                
-                <pre>
-                    unsigned = true
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>point</td>
-            <td>point</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = point
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>polygon</td>
-            <td>polygon</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = polygon
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>real</td>
-            <td>real</td>
-            <td>
-                <ul>
-                        <li>unsigned (bool)</li>
-                        <li>precision (int)</li>
-                        <li>scale (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = real(6,2)
-                </pre>
-                
-                <pre>
-                    unsigned = true
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>set</td>
-            <td>set</td>
-            <td>
-                <ul>
-                        <li>values (slice)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = set("a","b")
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>smallint</td>
-            <td>smallint</td>
-            <td>
-                <ul>
-                        <li>unsigned (bool)</li>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = smallint(255)
-                </pre>
-                
-                <pre>
-                    unsigned = true
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>text</td>
-            <td>text</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = text(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>time</td>
-            <td>time</td>
-            <td>
-                <ul>
-                        <li>precision (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = time(6)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>timestamp</td>
-            <td>timestamp</td>
-            <td>
-                <ul>
-                        <li>precision (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = timestamp(6)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>tinyblob</td>
-            <td>tinyblob</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = tinyblob
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>tinyint</td>
-            <td>tinyint</td>
-            <td>
-                <ul>
-                        <li>unsigned (bool)</li>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = tinyint(255)
-                </pre>
-                
-                <pre>
-                    unsigned = true
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>tinytext</td>
-            <td>tinytext</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = tinytext
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>varbinary</td>
-            <td>varbinary</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = varbinary(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>varchar</td>
-            <td>varchar</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = varchar(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>year</td>
-            <td>year</td>
-            <td>
-                <ul>
-                        <li>precision (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = year(6)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-    </tbody>
-</table>
-
-### Postgres
-
-<table>
-    <thead>
-    <tr>
-        <th>HCL</th>
-        <th>SQL</th>
-        <th>Attributes</th>
-        <th>Example</th>
-    </tr>
-    </thead>
-    <tbody>
-        
-        <tr>
-            <td>bigint</td>
-            <td>bigint</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = bigint
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>bigserial</td>
-            <td>bigserial</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = bigserial
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>bit</td>
-            <td>bit</td>
-            <td>
-                <ul>
-                        <li>len (int64)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = bit(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>bit_varying</td>
-            <td>bit varying</td>
-            <td>
-                <ul>
-                        <li>len (int64)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = bit_varying(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>bool</td>
-            <td>bool</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = bool
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>boolean</td>
-            <td>boolean</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = boolean
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>box</td>
-            <td>box</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = box
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>bytea</td>
-            <td>bytea</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = bytea
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>char</td>
-            <td>char</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = char(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>character</td>
-            <td>character</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = character(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>character_varying</td>
-            <td>character varying</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = character_varying(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>cidr</td>
-            <td>cidr</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = cidr
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>circle</td>
-            <td>circle</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = circle
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>date</td>
-            <td>date</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = date
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>day</td>
-            <td>day</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = day
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>day_to_hour</td>
-            <td>day_to_hour</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = day_to_hour
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>day_to_minute</td>
-            <td>day_to_minute</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = day_to_minute
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>day_to_second</td>
-            <td>day_to_second</td>
-            <td>
-                <ul>
-                        <li>precision (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = day_to_second(6)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>decimal</td>
-            <td>decimal</td>
-            <td>
-                <ul>
-                        <li>precision (int)</li>
-                        <li>scale (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = decimal(6,2)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>double_precision</td>
-            <td>double precision</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = double_precision
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>enum</td>
-            <td>my_enum</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    enum = enum.my_enum
-                </pre>
-                
-                In Postgres an enum type is created as a custom type and can then be referenced in a column 
-definition. Therefore, you have to add an enum block to your HCL schema like below:
-<pre>
-enum "my_enum" &#123;
-	values = ["on", "off"]
-&#125;
-</pre>
-            </td>
-        </tr>
-        
-        <tr>
-            <td>float4</td>
-            <td>float4</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = float4
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>float8</td>
-            <td>float8</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = float8
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>hour</td>
-            <td>hour</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = hour
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>hour_to_minute</td>
-            <td>hour_to_minute</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = hour_to_minute
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>hour_to_second</td>
-            <td>hour_to_second</td>
-            <td>
-                <ul>
-                        <li>precision (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = hour_to_second(6)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>hstore</td>
-            <td>hstore</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = hstore
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>inet</td>
-            <td>inet</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = inet
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>int</td>
-            <td>int</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = int
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>int2</td>
-            <td>int2</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = int2
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>int4</td>
-            <td>int4</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = int4
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>int8</td>
-            <td>int8</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = int8
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>integer</td>
-            <td>integer</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = integer
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>interval</td>
-            <td>interval</td>
-            <td>
-                <ul>
-                        <li>precision (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = interval(6)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>json</td>
-            <td>json</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = json
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>jsonb</td>
-            <td>jsonb</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = jsonb
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>line</td>
-            <td>line</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = line
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>lseg</td>
-            <td>lseg</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = lseg
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>macaddr</td>
-            <td>macaddr</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = macaddr
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>macaddr8</td>
-            <td>macaddr8</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = macaddr8
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>minute</td>
-            <td>minute</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = minute
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>minute_to_second</td>
-            <td>minute_to_second</td>
-            <td>
-                <ul>
-                        <li>precision (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = minute_to_second(6)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>money</td>
-            <td>money</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = money
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>month</td>
-            <td>month</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = month
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>numeric</td>
-            <td>numeric</td>
-            <td>
-                <ul>
-                        <li>precision (int)</li>
-                        <li>scale (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = numeric(6,2)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>path</td>
-            <td>path</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = path
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>point</td>
-            <td>point</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = point
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>real</td>
-            <td>real</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = real
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>second</td>
-            <td>second</td>
-            <td>
-                <ul>
-                        <li>precision (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = second(6)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>serial</td>
-            <td>serial</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = serial
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>serial2</td>
-            <td>serial2</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = serial2
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>serial4</td>
-            <td>serial4</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = serial4
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>serial8</td>
-            <td>serial8</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = serial8
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>smallint</td>
-            <td>smallint</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = smallint
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>smallserial</td>
-            <td>smallserial</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = smallserial
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>sql</td>
-            <td>sql</td>
-            <td>
-                <ul>
-                        <li>def (string)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = sql("a")
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>text</td>
-            <td>text</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = text
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>time</td>
-            <td>time</td>
-            <td>
-                <ul>
-                        <li>precision (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = time
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>timestamp</td>
-            <td>timestamp</td>
-            <td>
-                <ul>
-                        <li>precision (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = timestamp
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>timestamptz</td>
-            <td>timestamptz</td>
-            <td>
-                <ul>
-                        <li>precision (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = timestamptz
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>timetz</td>
-            <td>timetz</td>
-            <td>
-                <ul>
-                        <li>precision (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = timetz
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>uuid</td>
-            <td>uuid</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = uuid
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>varchar</td>
-            <td>varchar</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = varchar(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>xml</td>
-            <td>xml</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = xml
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>year</td>
-            <td>year</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = year
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>year_to_month</td>
-            <td>year_to_month</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = year_to_month
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-    </tbody>
-</table>
-
-### SQLite
-
-<table>
-    <thead>
-    <tr>
-        <th>HCL</th>
-        <th>SQL</th>
-        <th>Attributes</th>
-        <th>Example</th>
-    </tr>
-    </thead>
-    <tbody>
-        
-        <tr>
-            <td>bigint</td>
-            <td>bigint</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = bigint(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>blob</td>
-            <td>blob</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = blob(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>boolean</td>
-            <td>boolean</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = boolean
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>character</td>
-            <td>character</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = character(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>clob</td>
-            <td>clob</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = clob(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>date</td>
-            <td>date</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = date
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>datetime</td>
-            <td>datetime</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = datetime
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>decimal</td>
-            <td>decimal</td>
-            <td>
-                <ul>
-                        <li>precision (int)</li>
-                        <li>scale (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = decimal(6,2)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>double</td>
-            <td>double</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = double(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>double_precision</td>
-            <td>double precision</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = double_precision(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>float</td>
-            <td>float</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = float(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>int</td>
-            <td>int</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = int(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>int2</td>
-            <td>int2</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = int2(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>int8</td>
-            <td>int8</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = int8(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>integer</td>
-            <td>integer</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = integer(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>json</td>
-            <td>json</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = json
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>mediumint</td>
-            <td>mediumint</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = mediumint(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>native_character</td>
-            <td>native character</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = native_character(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>nchar</td>
-            <td>nchar</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = nchar(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>numeric</td>
-            <td>numeric</td>
-            <td>
-                <ul>
-                        <li>precision (int)</li>
-                        <li>scale (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = numeric(6,2)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>nvarchar</td>
-            <td>nvarchar</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = nvarchar(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>real</td>
-            <td>real</td>
-            <td>
-                <ul>
-                        <li>precision (int)</li>
-                        <li>scale (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = real(6,2)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>smallint</td>
-            <td>smallint</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = smallint(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>text</td>
-            <td>text</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = text(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>tinyint</td>
-            <td>tinyint</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = tinyint(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>unsigned_big_int</td>
-            <td>unsigned big int</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = unsigned_big_int(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>uuid</td>
-            <td>uuid</td>
-            <td>
-                <ul>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = uuid
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>varchar</td>
-            <td>varchar</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = varchar(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-        <tr>
-            <td>varying_character</td>
-            <td>varying character</td>
-            <td>
-                <ul>
-                        <li>size (int)</li>
-                </ul>
-            </td>
-            <td>
-                
-                <pre>
-                    type = varying_character(255)
-                </pre>
-                
-                
-            </td>
-        </tr>
-        
-    </tbody>
-</table>
-
-
-
diff --git a/doc/md/getting-started/02-inspecting.mdx b/doc/md/getting-started/02-inspecting.mdx
index bf82ac70..fd2935b8 100644
--- a/doc/md/getting-started/02-inspecting.mdx
+++ b/doc/md/getting-started/02-inspecting.mdx
@@ -191,7 +191,7 @@ the primary key for the table. In SQL databases, columns usually have a type att
 that defines the kind of data that can be stored in that column. Atlas strives to 
 mimic the syntax of the database that the user is working against. In this case, the
 type for the `id` column is `int`, and `varchar(100)` for the `name` column. To
-see the full list of supported types, [click here](../ddl/sql_types.md).
+see the full list of supported types, [click here](../ddl/sql-types.md).
 
 
 Next, consider this block:
diff --git a/internal/ci/ci.tmpl b/internal/ci/ci.tmpl
index c55dd4ee..ed7d11d5 100644
--- a/internal/ci/ci.tmpl
+++ b/internal/ci/ci.tmpl
@@ -35,9 +35,6 @@ jobs:
             {{ "${{ runner.os }}-go-" }}
       - name: run "go generate ./..."
         run: go generate ./...
-      - name: run "go generate internal/typedoc"
-        working-directory: internal/typedoc
-        run: go generate ./...
       - name: go generate cmd/atlas
         working-directory: cmd/atlas
         run: go generate ./...
diff --git a/internal/typedoc/go.mod b/internal/typedoc/go.mod
deleted file mode 100644
index 31bbef35..00000000
--- a/internal/typedoc/go.mod
+++ /dev/null
@@ -1,20 +0,0 @@
-module ariga.io/atlas/internal/typedoc
-
-go 1.17
-
-replace ariga.io/atlas => ../../
-
-require ariga.io/atlas v0.3.8-0.20220502090649-c495296ad28c
-
-require (
-	github.com/agext/levenshtein v1.2.1 // indirect
-	github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
-	github.com/go-openapi/inflect v0.19.0 // indirect
-	github.com/google/go-cmp v0.5.6 // indirect
-	github.com/hashicorp/hcl/v2 v2.10.0 // indirect
-	github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 // indirect
-	github.com/zclconf/go-cty v1.8.0 // indirect
-	golang.org/x/mod v0.5.1 // indirect
-	golang.org/x/text v0.3.7 // indirect
-	golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
-)
diff --git a/internal/typedoc/go.sum b/internal/typedoc/go.sum
deleted file mode 100644
index fc9efc2f..00000000
--- a/internal/typedoc/go.sum
+++ /dev/null
@@ -1,69 +0,0 @@
-github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
-github.com/agext/levenshtein v1.2.1 h1:QmvMAjj2aEICytGiWzmxoE0x2KZvE0fvmqMOfy2tjT8=
-github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
-github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM=
-github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk=
-github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw=
-github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo=
-github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
-github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4=
-github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4=
-github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68=
-github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
-github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
-github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
-github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
-github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/hashicorp/hcl/v2 v2.10.0 h1:1S1UnuhDGlv3gRFV4+0EdwB+znNP5HmcGbIqwnSCByg=
-github.com/hashicorp/hcl/v2 v2.10.0/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg=
-github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
-github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
-github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
-github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
-github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
-github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4=
-github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
-github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 h1:DpOJ2HYzCv8LZP15IdmG+YdwD2luVPHITV96TkirNBM=
-github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
-github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
-github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
-github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
-github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
-github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
-github.com/stretchr/testify v1.7.1-0.20210427113832-6241f9ab9942 h1:t0lM6y/M5IiUZyvbBTcngso8SZEZICH7is9B6g/obVU=
-github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
-github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4=
-github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI=
-github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8=
-github.com/zclconf/go-cty v1.8.0 h1:s4AvqaeQzJIu3ndv4gVIhplVD0krU+bgrcLSVUnaWuA=
-github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk=
-github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8=
-golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
-golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38=
-golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
-golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
-golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
-golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
-golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
-golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
-golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
-google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
-gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
diff --git a/internal/typedoc/main.go b/internal/typedoc/main.go
deleted file mode 100644
index af4eada6..00000000
--- a/internal/typedoc/main.go
+++ /dev/null
@@ -1,176 +0,0 @@
-// Copyright 2021-present The Atlas Authors. All rights reserved.
-// This source code is licensed under the Apache 2.0 license found
-// in the LICENSE file in the root directory of this source tree.
-
-package main
-
-import (
-	_ "embed"
-	"log"
-	"os"
-	"reflect"
-	"sort"
-	"strconv"
-	"strings"
-	"text/template"
-
-	"ariga.io/atlas/schemahcl"
-	"ariga.io/atlas/sql/mysql"
-	"ariga.io/atlas/sql/postgres"
-	"ariga.io/atlas/sql/sqlite"
-	"ariga.io/atlas/sql/sqlspec"
-)
-
-//go:embed output.tmpl
-var tmpl string
-
-type (
-	Driver struct {
-		Name  string
-		Types []Type
-	}
-	Type struct {
-		*schemahcl.TypeSpec
-		Info            string
-		MarshalOverride string
-	}
-)
-
-//go:generate go run main.go
-func main() {
-	drivers := []*Driver{
-		{Name: "MySQL/MariaDB", Types: wrap(mysql.TypeRegistry.Specs())},
-		{Name: "Postgres", Types: append(wrap(postgres.TypeRegistry.Specs()), Type{
-			TypeSpec: &schemahcl.TypeSpec{
-				Name: "enum",
-				T:    "my_enum",
-			},
-			Info: `In Postgres an enum type is created as a custom type and can then be referenced in a column 
-definition. Therefore, you have to add an enum block to your HCL schema like below:
-<pre>
-enum "my_enum" &#123;
-	values = ["on", "off"]
-&#125;
-</pre>`,
-			MarshalOverride: "enum = enum.my_enum",
-		})},
-		{Name: "SQLite", Types: wrap(sqlite.TypeRegistry.Specs())},
-	}
-	parse, err := template.New("tmp").Funcs(template.FuncMap{
-		"col_hcl": colHcl,
-	}).Parse(tmpl)
-	if err != nil {
-		log.Fatalf("error: %s", err)
-	}
-	for _, drv := range drivers {
-		sort.Slice(drv.Types, func(i, j int) bool {
-			return drv.Types[i].Name < drv.Types[j].Name
-		})
-	}
-	f, err := os.Create("../../doc/md/ddl/sql_types.md")
-	if err != nil {
-		log.Fatalf("error: %s", err)
-	}
-	defer f.Close()
-	if err := parse.Execute(f, drivers); err != nil {
-		log.Fatalf("error: %s", err)
-	}
-}
-
-func colHcl(ts *Type, d *Driver) []string {
-	td := ts.MarshalOverride
-	if ts.MarshalOverride == "" {
-		dt := dummyType(ts.TypeSpec)
-		col := &sqlspec.Column{
-			Name: "column",
-			Type: dt,
-		}
-		spec, err := schemahcl.New(schemahcl.WithTypes(unwrap(d.Types))).MarshalSpec(col)
-		if err != nil {
-			log.Fatalf("failed: %s", err)
-		}
-		split := strings.Split(string(spec), "\n")
-		td = split[1]
-	}
-	res := []string{td}
-	for _, attr := range ts.Attributes {
-		if attr.Name == "unsigned" {
-			res = append(res, "unsigned = true")
-		}
-	}
-	return res
-}
-
-func dummyType(ts *schemahcl.TypeSpec) *schemahcl.Type {
-	spec := &schemahcl.Type{T: ts.T}
-	for _, attr := range ts.Attributes {
-		var a *schemahcl.Attr
-		switch attr.Kind {
-		case reflect.Int, reflect.Int64:
-			n := "255"
-			if attr.Name == "precision" {
-				n = "6"
-			}
-			if attr.Name == "scale" {
-				n = "2"
-			}
-			a = LitAttr(attr.Name, n)
-		case reflect.String:
-			a = LitAttr(attr.Name, `"a"`)
-		case reflect.Slice:
-			a = ListAttr(attr.Name, `"a"`, `"b"`)
-		case reflect.Bool:
-			a = LitAttr(attr.Name, "false")
-		default:
-			log.Fatalf("unsupported kind: %s", attr.Kind)
-		}
-		spec.Attrs = append(spec.Attrs, a)
-	}
-	return spec
-}
-
-// StrAttr is a helper method for constructing *schemahcl.Attr of type string.
-func StrAttr(k, v string) *schemahcl.Attr {
-	return &schemahcl.Attr{
-		K: k,
-		V: &schemahcl.LiteralValue{V: strconv.Quote(v)},
-	}
-}
-
-// LitAttr is a helper method for constructing *schemahcl.Attr instances that contain literal values.
-func LitAttr(k, v string) *schemahcl.Attr {
-	return &schemahcl.Attr{
-		K: k,
-		V: &schemahcl.LiteralValue{V: v},
-	}
-}
-
-// ListAttr is a helper method for constructing *schemahcl.Attr instances that contain list values.
-func ListAttr(k string, litValues ...string) *schemahcl.Attr {
-	lv := &schemahcl.ListValue{}
-	for _, v := range litValues {
-		lv.V = append(lv.V, &schemahcl.LiteralValue{V: v})
-	}
-	return &schemahcl.Attr{
-		K: k,
-		V: lv,
-	}
-}
-
-// wrap iterates over the given slice of schemahcl.TypeSpec and wraps them with Type.
-func wrap(tss []*schemahcl.TypeSpec) []Type {
-	res := make([]Type, len(tss))
-	for i, ts := range tss {
-		res[i] = Type{TypeSpec: ts}
-	}
-	return res
-}
-
-// unwrap undoes wrap.
-func unwrap(tss []Type) []*schemahcl.TypeSpec {
-	res := make([]*schemahcl.TypeSpec, len(tss))
-	for i, ts := range tss {
-		res[i] = ts.TypeSpec
-	}
-	return res
-}
diff --git a/internal/typedoc/output.tmpl b/internal/typedoc/output.tmpl
deleted file mode 100644
index c651844c..00000000
--- a/internal/typedoc/output.tmpl
+++ /dev/null
@@ -1,48 +0,0 @@
----
-id: ddl-sql-types
-title: SQL Column Types
-slug: /ddl/sql-types
----
-
-{{ range . }}
-{{- $d := .}}
-    {{- /*gotype: ariga.io/atlas/integration/typedoc.Driver */ -}}
-
-### {{ .Name }}
-
-<table>
-    <thead>
-    <tr>
-        <th>HCL</th>
-        <th>SQL</th>
-        <th>Attributes</th>
-        <th>Example</th>
-    </tr>
-    </thead>
-    <tbody>
-        {{ range .Types }}
-        <tr>
-            <td>{{ .Name }}</td>
-            <td>{{ .T }}</td>
-            <td>
-                <ul>
-                    {{- range .Attributes }}
-                        <li>{{ .Name }} ({{ .Kind }})</li>
-                    {{- end }}
-                </ul>
-            </td>
-            <td>
-                {{ range col_hcl . $d }}
-                <pre>
-                    {{ . }}
-                </pre>
-                {{end }}
-                {{ with .Info }}{{ . }}{{ end }}
-            </td>
-        </tr>
-        {{ end }}
-    </tbody>
-</table>
-
-{{ end }}
-
diff --git a/schemahcl/hcl.go b/schemahcl/hcl.go
index 6dfb58cc..4f2fb77c 100644
--- a/schemahcl/hcl.go
+++ b/schemahcl/hcl.go
@@ -151,7 +151,6 @@ func (r addrRef) patch(resource *Resource) error {
 		if ref, ok := attr.V.(*Ref); ok {
 			referenced, ok := cp[ref.V]
 			if !ok {
-				fmt.Println(cp)
 				return fmt.Errorf("broken reference to %q", ref.V)
 			}
 			if name, err := referenced.FinalName(); err == nil {
@@ -251,7 +250,7 @@ func (s *State) toAttrs(ctx *hcl.EvalContext, hclAttrs hclsyntax.Attributes, sco
 		at := &Attr{K: hclAttr.Name}
 		value, diag := hclAttr.Expr.Value(ctx)
 		if diag.HasErrors() {
-			return nil, diag
+			return nil, s.typeError(diag)
 		}
 		var err error
 		switch {
@@ -278,6 +277,29 @@ func (s *State) toAttrs(ctx *hcl.EvalContext, hclAttrs hclsyntax.Attributes, sco
 	return attrs, nil
 }
 
+// typeError improves diagnostic reporting in case of parse error.
+func (s *State) typeError(diag hcl.Diagnostics) error {
+	for _, d := range diag {
+		switch e := d.Expression.(type) {
+		case *hclsyntax.FunctionCallExpr:
+			if d.Summary != "Call to unknown function" {
+				continue
+			}
+			if t, ok := s.findTypeSpec(e.Name); ok && len(t.Attributes) == 0 {
+				d.Detail = fmt.Sprintf("Type %q does not accept attributes", t.Name)
+			}
+		case *hclsyntax.ScopeTraversalExpr:
+			if d.Summary != "Unknown variable" {
+				continue
+			}
+			if t, ok := s.findTypeSpec(e.Traversal.RootName()); ok && len(t.Attributes) > 0 {
+				d.Detail = fmt.Sprintf("Type %q requires at least 1 argument", t.Name)
+			}
+		}
+	}
+	return diag
+}
+
 func isRef(v cty.Value) bool {
 	return v.Type().IsObjectType() && v.Type().HasAttribute("__ref")
 }
diff --git a/sql/mysql/convert.go b/sql/mysql/convert.go
index 0c0edec7..1be90417 100644
--- a/sql/mysql/convert.go
+++ b/sql/mysql/convert.go
@@ -33,9 +33,9 @@ func FormatType(t schema.Type) (string, error) {
 		}
 	case *schema.BinaryType:
 		f = strings.ToLower(t.T)
-		if f == TypeVarBinary {
-			// Zero is also a valid length.
-			f = fmt.Sprintf("%s(%d)", f, t.Size)
+		// Accept 0 as a valid size, and avoid appending the default size of type BINARY.
+		if f == TypeVarBinary && t.Size != nil || f == TypeBinary && t.Size != nil && *t.Size != 1 {
+			f = fmt.Sprintf("%s(%d)", f, *t.Size)
 		}
 	case *schema.DecimalType:
 		if f = strings.ToLower(t.T); f != TypeDecimal && f != TypeNumeric {
@@ -144,7 +144,7 @@ func ParseType(raw string) (schema.Type, error) {
 		if attr := parts[len(parts)-1]; attr == "zerofill" && size != 0 {
 			ft.Attrs = []schema.Attr{
 				&DisplayWidth{
-					N: int(size),
+					N: size,
 				},
 				&ZeroFill{
 					A: attr,
@@ -158,18 +158,14 @@ func ParseType(raw string) (schema.Type, error) {
 			Unsigned: unsigned,
 		}
 		if len(parts) > 1 && parts[1] != "unsigned" {
-			p, err := strconv.ParseInt(parts[1], 10, 64)
-			if err != nil {
+			if dt.Precision, err = strconv.Atoi(parts[1]); err != nil {
 				return nil, fmt.Errorf("parse precision %q", parts[1])
 			}
-			dt.Precision = int(p)
 		}
 		if len(parts) > 2 && parts[2] != "unsigned" {
-			s, err := strconv.ParseInt(parts[2], 10, 64)
-			if err != nil {
+			if dt.Scale, err = strconv.Atoi(parts[2]); err != nil {
 				return nil, fmt.Errorf("parse scale %q", parts[1])
 			}
-			dt.Scale = int(s)
 		}
 		return dt, nil
 	case TypeFloat, TypeDouble, TypeReal:
@@ -178,18 +174,17 @@ func ParseType(raw string) (schema.Type, error) {
 			Unsigned: unsigned,
 		}
 		if len(parts) > 1 && parts[1] != "unsigned" {
-			p, err := strconv.ParseInt(parts[1], 10, 64)
-			if err != nil {
+			if ft.Precision, err = strconv.Atoi(parts[1]); err != nil {
 				return nil, fmt.Errorf("parse precision %q", parts[1])
 			}
-			ft.Precision = int(p)
 		}
 		return ft, nil
 	case TypeBinary, TypeVarBinary:
-		return &schema.BinaryType{
-			T:    t,
-			Size: int(size),
-		}, nil
+		bt := &schema.BinaryType{T: t}
+		if len(parts) > 1 {
+			bt.Size = &size
+		}
+		return bt, nil
 	case TypeTinyBlob, TypeMediumBlob, TypeBlob, TypeLongBlob:
 		return &schema.BinaryType{
 			T: t,
@@ -197,7 +192,7 @@ func ParseType(raw string) (schema.Type, error) {
 	case TypeChar, TypeVarchar:
 		return &schema.StringType{
 			T:    t,
-			Size: int(size),
+			Size: size,
 		}, nil
 	case TypeTinyText, TypeMediumText, TypeText, TypeLongText:
 		return &schema.StringType{
diff --git a/sql/mysql/inspect.go b/sql/mysql/inspect.go
index 37162efa..f6c579fc 100644
--- a/sql/mysql/inspect.go
+++ b/sql/mysql/inspect.go
@@ -589,7 +589,7 @@ func (i *inspect) myDefaultExpr(c *schema.Column, x string, attr *extraAttr) sch
 }
 
 // parseColumn returns column parts, size and signed-info from a MySQL type.
-func parseColumn(typ string) (parts []string, size int64, unsigned bool, err error) {
+func parseColumn(typ string) (parts []string, size int, unsigned bool, err error) {
 	switch parts = strings.FieldsFunc(typ, func(r rune) bool {
 		return r == '(' || r == ')' || r == ' ' || r == ','
 	}); parts[0] {
@@ -599,11 +599,11 @@ func parseColumn(typ string) (parts []string, size int64, unsigned bool, err err
 			unsigned = true
 		}
 		if len(parts) > 2 || len(parts) == 2 && !unsigned {
-			size, err = strconv.ParseInt(parts[1], 10, 64)
+			size, err = strconv.Atoi(parts[1])
 		}
 	case TypeBit, TypeBinary, TypeVarBinary, TypeChar, TypeVarchar:
 		if len(parts) > 1 {
-			size, err = strconv.ParseInt(parts[1], 10, 64)
+			size, err = strconv.Atoi(parts[1])
 		}
 	}
 	if err != nil {
diff --git a/sql/mysql/sqlspec.go b/sql/mysql/sqlspec.go
index 6e5f917a..50a3673d 100644
--- a/sql/mysql/sqlspec.go
+++ b/sql/mysql/sqlspec.go
@@ -393,13 +393,13 @@ var TypeRegistry = schemahcl.NewRegistry(
 		schemahcl.NewTypeSpec(TypeDouble, schemahcl.WithAttributes(unsignedTypeAttr(), &schemahcl.TypeAttr{Name: "precision", Kind: reflect.Int, Required: false}, &schemahcl.TypeAttr{Name: "scale", Kind: reflect.Int, Required: false})),
 		schemahcl.NewTypeSpec(TypeReal, schemahcl.WithAttributes(unsignedTypeAttr(), &schemahcl.TypeAttr{Name: "precision", Kind: reflect.Int, Required: false}, &schemahcl.TypeAttr{Name: "scale", Kind: reflect.Int, Required: false})),
 		schemahcl.NewTypeSpec(TypeTimestamp, schemahcl.WithAttributes(&schemahcl.TypeAttr{Name: "precision", Kind: reflect.Int, Required: false})),
-		schemahcl.NewTypeSpec(TypeDate, schemahcl.WithAttributes(&schemahcl.TypeAttr{Name: "precision", Kind: reflect.Int, Required: false})),
+		schemahcl.NewTypeSpec(TypeDate),
 		schemahcl.NewTypeSpec(TypeTime, schemahcl.WithAttributes(&schemahcl.TypeAttr{Name: "precision", Kind: reflect.Int, Required: false})),
 		schemahcl.NewTypeSpec(TypeDateTime, schemahcl.WithAttributes(&schemahcl.TypeAttr{Name: "precision", Kind: reflect.Int, Required: false})),
 		schemahcl.NewTypeSpec(TypeYear, schemahcl.WithAttributes(&schemahcl.TypeAttr{Name: "precision", Kind: reflect.Int, Required: false})),
 		schemahcl.NewTypeSpec(TypeVarchar, schemahcl.WithAttributes(schemahcl.SizeTypeAttr(true))),
 		schemahcl.NewTypeSpec(TypeChar, schemahcl.WithAttributes(schemahcl.SizeTypeAttr(false))),
-		schemahcl.NewTypeSpec(TypeVarBinary, schemahcl.WithAttributes(schemahcl.SizeTypeAttr(false))),
+		schemahcl.NewTypeSpec(TypeVarBinary, schemahcl.WithAttributes(schemahcl.SizeTypeAttr(true))),
 		schemahcl.NewTypeSpec(TypeBinary, schemahcl.WithAttributes(schemahcl.SizeTypeAttr(false))),
 		schemahcl.NewTypeSpec(TypeBlob, schemahcl.WithAttributes(schemahcl.SizeTypeAttr(false))),
 		schemahcl.NewTypeSpec(TypeTinyBlob),
diff --git a/sql/postgres/convert.go b/sql/postgres/convert.go
index 8aaf93dd..9193588c 100644
--- a/sql/postgres/convert.go
+++ b/sql/postgres/convert.go
@@ -23,9 +23,10 @@ func FormatType(t schema.Type) (string, error) {
 		f = strings.ToLower(t.T)
 	case *BitType:
 		f = strings.ToLower(t.T)
-		// BIT without a length is equivalent to BIT(1).
-		if f == TypeBit && t.Len == 0 {
-			f = fmt.Sprintf("%s(1)", f)
+		// BIT without a length is equivalent to BIT(1),
+		// BIT VARYING has unlimited length.
+		if f == TypeBit && t.Len > 1 || f == TypeBitVar && t.Len > 0 {
+			f = fmt.Sprintf("%s(%d)", f, t.Len)
 		}
 	case *schema.BoolType:
 		// BOOLEAN can be abbreviated as BOOL.
diff --git a/sql/schema/dsl.go b/sql/schema/dsl.go
index 2c9e2fa5..6456f806 100644
--- a/sql/schema/dsl.go
+++ b/sql/schema/dsl.go
@@ -289,7 +289,7 @@ type BinaryOption func(*BinaryType)
 // BinarySize configures the size of the binary type.
 func BinarySize(size int) BinaryOption {
 	return func(b *BinaryType) {
-		b.Size = size
+		b.Size = &size
 	}
 }
 
diff --git a/sql/schema/schema.go b/sql/schema/schema.go
index 19646f00..18578304 100644
--- a/sql/schema/schema.go
+++ b/sql/schema/schema.go
@@ -194,7 +194,7 @@ type (
 	// BinaryType represents a type that stores a binary data.
 	BinaryType struct {
 		T    string
-		Size int
+		Size *int
 	}
 
 	// StringType represents a string type.


Test patch:
diff --git a/internal/integration/mysql_test.go b/internal/integration/mysql_test.go
index c16ecc50..bfb72dab 100644
--- a/internal/integration/mysql_test.go
+++ b/internal/integration/mysql_test.go
@@ -1014,34 +1014,34 @@ create table atlas_types_sanity
 					},
 					{
 						Name: "tVarBinary",
-						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "varbinary", Size: 30},
+						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "varbinary", Size: intp(30)},
 							Raw: "varbinary(30)", Null: true},
 						Default: &schema.Literal{V: t.valueByVersion(map[string]string{"mysql8": "0x546974616E"}, t.quoted("Titan"))},
 					},
 					{
 						Name: "tBinary",
-						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "binary", Size: 5},
+						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "binary", Size: intp(5)},
 							Raw: "binary(5)", Null: true},
 						Default: &schema.Literal{V: t.valueByVersion(map[string]string{"mysql8": "0x546974616E"}, t.quoted("Titan"))},
 					},
 					{
 						Name: "tBlob",
-						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "tinyblob", Size: 0},
+						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "tinyblob"},
 							Raw: "tinyblob", Null: true},
 					},
 					{
 						Name: "tTinyBlob",
-						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "tinyblob", Size: 0},
+						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "tinyblob"},
 							Raw: "tinyblob", Null: true},
 					},
 					{
 						Name: "tMediumBlob",
-						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "mediumblob", Size: 0},
+						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "mediumblob"},
 							Raw: "mediumblob", Null: true},
 					},
 					{
 						Name: "tLongBlob",
-						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "longblob", Size: 0},
+						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "longblob"},
 							Raw: "longblob", Null: true},
 					},
 					{
diff --git a/internal/integration/sqlite_test.go b/internal/integration/sqlite_test.go
index d871f51b..066a0b20 100644
--- a/internal/integration/sqlite_test.go
+++ b/internal/integration/sqlite_test.go
@@ -749,7 +749,7 @@ create table atlas_types_sanity
 				},
 				{
 					Name: "tBlob",
-					Type: &schema.ColumnType{Type: &schema.BinaryType{T: "blob", Size: 0}, Raw: "blob(10)", Null: false},
+					Type: &schema.ColumnType{Type: &schema.BinaryType{T: "blob"}, Raw: "blob(10)", Null: false},
 					Default: &schema.Literal{
 						V: "'A'",
 					},
diff --git a/internal/integration/testdata/postgres/column-bit.txt b/internal/integration/testdata/postgres/column-bit.txt
new file mode 100644
index 00000000..739025eb
--- /dev/null
+++ b/internal/integration/testdata/postgres/column-bit.txt
@@ -0,0 +1,69 @@
+apply 1.hcl
+cmpshow t 1.sql
+
+# Change size of the underlying type.
+apply 2.hcl
+cmpshow t 2.sql
+
+-- 1.hcl --
+schema "$db" {}
+
+table "t" {
+  schema = schema.$db
+  column "c1" {
+    // Equals to bit(1).
+    type = bit
+  }
+  column "c2" {
+    type = bit(2)
+  }
+  column "c3" {
+    // Unlimited length.
+    type = bit_varying
+  }
+  column "c4" {
+    type = bit_varying(1)
+  }
+}
+
+-- 1.sql --
+               Table "script_column_bit.t"
+ Column |      Type      | Collation | Nullable | Default
+--------+----------------+-----------+----------+---------
+ c1     | bit(1)         |           | not null |
+ c2     | bit(2)         |           | not null |
+ c3     | bit varying    |           | not null |
+ c4     | bit varying(1) |           | not null |
+
+-- 2.hcl --
+schema "$db" {}
+
+table "t" {
+  schema = schema.$db
+  column "c1" {
+    // No change.
+    type = bit(1)
+  }
+  column "c2" {
+    // Reduce size.
+    type = bit(1)
+  }
+  column "c3" {
+    // Add size.
+    type = bit_varying(4)
+  }
+  column "c4" {
+    // Increase size.
+    type = bit_varying(64)
+  }
+}
+
+-- 2.sql --
+               Table "script_column_bit.t"
+ Column |      Type       | Collation | Nullable | Default
+--------+-----------------+-----------+----------+---------
+ c1     | bit(1)          |           | not null |
+ c2     | bit(1)          |           | not null |
+ c3     | bit varying(4)  |           | not null |
+ c4     | bit varying(64) |           | not null |
+
diff --git a/internal/integration/tidb_test.go b/internal/integration/tidb_test.go
index b20483d7..cd3e2466 100644
--- a/internal/integration/tidb_test.go
+++ b/internal/integration/tidb_test.go
@@ -917,39 +917,39 @@ create table atlas_types_sanity
 					},
 					{
 						Name: "tVarBinary",
-						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "varbinary", Size: 30},
+						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "varbinary", Size: intp(30)},
 							Raw: "varbinary(30)", Null: true},
 						Default: &schema.Literal{V: t.valueByVersion(map[string]string{"mysql8": "0x546974616E"}, t.quoted("Titan"))},
 					},
 					{
 						Name: "tBinary",
-						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "binary", Size: 5},
+						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "binary", Size: intp(5)},
 							Raw: "binary(5)", Null: true},
 						Default: &schema.Literal{V: t.valueByVersion(map[string]string{"mysql8": "0x546974616E"}, t.quoted("Titan"))},
 					},
 					{
 						Name: "tBlob",
-						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "tinyblob", Size: 0},
+						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "tinyblob"},
 							Raw: "tinyblob", Null: true},
 					},
 					{
 						Name: "tTinyBlob",
-						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "tinyblob", Size: 0},
+						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "tinyblob"},
 							Raw: "tinyblob", Null: true},
 					},
 					{
 						Name: "tMediumBlob",
-						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "mediumblob", Size: 0},
+						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "mediumblob"},
 							Raw: "mediumblob", Null: true},
 					},
 					{
 						Name: "tLongBlob",
-						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "longblob", Size: 0},
+						Type: &schema.ColumnType{Type: &schema.BinaryType{T: "longblob"},
 							Raw: "longblob", Null: true},
 					},
 					{
 						Name: "tText",
-						Type: &schema.ColumnType{Type: &schema.StringType{T: "tinytext", Size: 0},
+						Type: &schema.ColumnType{Type: &schema.StringType{T: "tinytext"},
 							Raw: "tinytext", Null: true},
 						Attrs: []schema.Attr{
 							&schema.Charset{V: "latin1"},
@@ -958,7 +958,7 @@ create table atlas_types_sanity
 					},
 					{
 						Name: "tTinyText",
-						Type: &schema.ColumnType{Type: &schema.StringType{T: "tinytext", Size: 0},
+						Type: &schema.ColumnType{Type: &schema.StringType{T: "tinytext"},
 							Raw: "tinytext", Null: true},
 						Attrs: []schema.Attr{
 							&schema.Charset{V: "latin1"},
diff --git a/sql/mysql/inspect_test.go b/sql/mysql/inspect_test.go
index e50d2939..0fef435a 100644
--- a/sql/mysql/inspect_test.go
+++ b/sql/mysql/inspect_test.go
@@ -285,9 +285,10 @@ func TestDriver_InspectTable(t *testing.T) {
 			expect: func(require *require.Assertions, t *schema.Table, err error) {
 				require.NoError(err)
 				require.Equal("users", t.Name)
+				p := func(i int) *int { return &i }
 				require.EqualValues([]*schema.Column{
-					{Name: "c1", Type: &schema.ColumnType{Raw: "binary(20)", Type: &schema.BinaryType{T: "binary", Size: 20}}},
-					{Name: "c2", Type: &schema.ColumnType{Raw: "varbinary(30)", Type: &schema.BinaryType{T: "varbinary", Size: 30}}},
+					{Name: "c1", Type: &schema.ColumnType{Raw: "binary(20)", Type: &schema.BinaryType{T: "binary", Size: p(20)}}},
+					{Name: "c2", Type: &schema.ColumnType{Raw: "varbinary(30)", Type: &schema.BinaryType{T: "varbinary", Size: p(30)}}},
 					{Name: "c3", Type: &schema.ColumnType{Raw: "tinyblob", Type: &schema.BinaryType{T: "tinyblob"}}},
 					{Name: "c4", Type: &schema.ColumnType{Raw: "mediumblob", Type: &schema.BinaryType{T: "mediumblob"}}},
 					{Name: "c5", Type: &schema.ColumnType{Raw: "blob", Type: &schema.BinaryType{T: "blob"}}},
diff --git a/sql/mysql/sqlspec_test.go b/sql/mysql/sqlspec_test.go
index e988d569..5e26c466 100644
--- a/sql/mysql/sqlspec_test.go
+++ b/sql/mysql/sqlspec_test.go
@@ -633,7 +633,7 @@ func TestMarshalSpec_TimePrecision(t *testing.T) {
 					schema.NewTimeColumn("tTimestamp", TypeTimestamp, schema.TimePrecision(3)).
 						SetDefault(&schema.RawExpr{X: "current_timestamp(3)"}).
 						AddAttrs(&OnUpdate{A: "current_timestamp(3)"}),
-					schema.NewTimeColumn("tDate", TypeDate, schema.TimePrecision(2)),
+					schema.NewTimeColumn("tDate", TypeDate),
 					schema.NewTimeColumn("tYear", TypeYear, schema.TimePrecision(2)),
 				),
 		)
@@ -661,7 +661,7 @@ func TestMarshalSpec_TimePrecision(t *testing.T) {
   }
   column "tDate" {
     null = false
-    type = date(2)
+    type = date
   }
   column "tYear" {
     null = false
@@ -814,6 +814,7 @@ schema "test" {
 }
 
 func TestTypes(t *testing.T) {
+	p := func(i int) *int { return &i }
 	tests := []struct {
 		typeExpr  string
 		extraAttr string
@@ -833,11 +834,11 @@ func TestTypes(t *testing.T) {
 		},
 		{
 			typeExpr: "binary(255)",
-			expected: &schema.BinaryType{T: TypeBinary, Size: 255},
+			expected: &schema.BinaryType{T: TypeBinary, Size: p(255)},
 		},
 		{
 			typeExpr: "varbinary(255)",
-			expected: &schema.BinaryType{T: TypeVarBinary, Size: 255},
+			expected: &schema.BinaryType{T: TypeVarBinary, Size: p(255)},
 		},
 		{
 			typeExpr: "int",
@@ -1004,10 +1005,6 @@ func TestTypes(t *testing.T) {
 			typeExpr: "date",
 			expected: &schema.TimeType{T: TypeDate},
 		},
-		{
-			typeExpr: "date(2)",
-			expected: typeTime(TypeDate, 2),
-		},
 		{
 			typeExpr: "time",
 			expected: &schema.TimeType{T: TypeTime},
@@ -1042,27 +1039,31 @@ func TestTypes(t *testing.T) {
 		},
 		{
 			typeExpr: "varbinary(30)",
-			expected: &schema.BinaryType{T: TypeVarBinary, Size: 30},
+			expected: &schema.BinaryType{T: TypeVarBinary, Size: p(30)},
+		},
+		{
+			typeExpr: "binary",
+			expected: &schema.BinaryType{T: TypeBinary},
 		},
 		{
 			typeExpr: "binary(5)",
-			expected: &schema.BinaryType{T: TypeBinary, Size: 5},
+			expected: &schema.BinaryType{T: TypeBinary, Size: p(5)},
 		},
 		{
 			typeExpr: "blob(5)",
-			expected: &schema.StringType{T: TypeBlob},
+			expected: &schema.BinaryType{T: TypeBlob},
 		},
 		{
 			typeExpr: "tinyblob",
-			expected: &schema.StringType{T: TypeTinyBlob},
+			expected: &schema.BinaryType{T: TypeTinyBlob},
 		},
 		{
 			typeExpr: "mediumblob",
-			expected: &schema.StringType{T: TypeMediumBlob},
+			expected: &schema.BinaryType{T: TypeMediumBlob},
 		},
 		{
 			typeExpr: "longblob",
-			expected: &schema.StringType{T: TypeLongBlob},
+			expected: &schema.BinaryType{T: TypeLongBlob},
 		},
 		{
 			typeExpr: "json",
@@ -1164,6 +1165,43 @@ func TestInputVars(t *testing.T) {
 	spectest.TestInputVars(t, EvalHCL)
 }
 
+func TestParseType_Decimal(t *testing.T) {
+	for _, tt := range []struct {
+		input   string
+		wantT   *schema.DecimalType
+		wantErr bool
+	}{
+		{
+			input: "decimal",
+			wantT: &schema.DecimalType{T: TypeDecimal},
+		},
+		{
+			input: "decimal unsigned",
+			wantT: &schema.DecimalType{T: TypeDecimal, Unsigned: true},
+		},
+		{
+			input: "decimal(10)",
+			wantT: &schema.DecimalType{T: TypeDecimal, Precision: 10},
+		},
+		{
+			input: "decimal(10) unsigned",
+			wantT: &schema.DecimalType{T: TypeDecimal, Precision: 10, Unsigned: true},
+		},
+		{
+			input: "decimal(10,2)",
+			wantT: &schema.DecimalType{T: TypeDecimal, Precision: 10, Scale: 2},
+		},
+		{
+			input: "decimal(10, 2) unsigned",
+			wantT: &schema.DecimalType{T: TypeDecimal, Precision: 10, Scale: 2, Unsigned: true},
+		},
+	} {
+		d, err := ParseType(tt.input)
+		require.Equal(t, tt.wantErr, err != nil)
+		require.Equal(t, tt.wantT, d)
+	}
+}
+
 func typeTime(t string, p int) schema.Type {
 	return &schema.TimeType{T: t, Precision: &p}
 }