Skip to content

Commit

Permalink
docs: db type mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Jan 24, 2024
1 parent 287df79 commit 52a062b
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/table/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,45 @@ pub struct ColumnDef {
}

/// All column types
///
/// | Database Type <br/> ([`ColumnType`](https://docs.rs/sea-query/*/sea_query/table/enum.ColumnType.html)) | SQLite <br/> datatype | MySQL <br/> datatype | PostgreSQL <br/> datatype |
/// | --------- | --------- | --------- | --------- |
/// | Char | char | char | char |
/// | String | varchar | varchar | varchar |
/// | Text | text | text | text |
/// | TinyInteger | tinyint | tinyint | smallint |
/// | SmallInteger | smallint | smallint | smallint |
/// | Integer | integer | int | integer |
/// | BigInteger | integer | bigint | bigint |
/// | TinyUnsigned | tinyint | tinyint | smallint |
/// | SmallUnsigned | smallint | smallint | smallint |
/// | Unsigned | integer | int | integer |
/// | BigUnsigned | integer | bigint | bigint |
/// | Float | float | float | real |
/// | Double | double | double | double precision |
/// | Decimal | real | decimal | decimal |
/// | DateTime | datetime_text | datetime | timestamp without time zone |
/// | Timestamp | timestamp_text | timestamp | timestamp |
/// | TimestampWithTimeZone | timestamp_with_timezone_text | timestamp | timestamp with time zone |
/// | Time | time_text | time | time |
/// | Date | date_text | date | date |
/// | Year | N/A | year | N/A |
/// | Interval | N/A | N/A | interval |
/// | Binary | blob | blob | bytea |
/// | VarBinary | varbinary_blob | varbinary | bit varying |
/// | Bit | N/A | bit | bit |
/// | VarBit | N/A | bit | varbit |
/// | Boolean | boolean | bool | bool |
/// | Money | money | money | money |
/// | Json | json_text | json | json |
/// | JsonBinary | jsonb_text | json | jsonb |
/// | Uuid | uuid_text | binary(16) | uuid |
/// | Enum | enum_text | ENUM(...) | ENUM_NAME |
/// | Array | N/A | N/A | DATA_TYPE[] |
/// | Cidr | N/A | N/A | cidr |
/// | Inet | N/A | N/A | inet |
/// | MacAddr | N/A | N/A | macaddr |
/// | LTree | N/A | N/A | ltree |
#[non_exhaustive]
#[derive(Debug, Clone)]
pub enum ColumnType {
Expand Down

0 comments on commit 52a062b

Please sign in to comment.