Skip to content

Commit

Permalink
Support Postgres jsonb in entity generation (SeaQL#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
silverlyra authored Mar 26, 2022
1 parent 253faf2 commit 08aa398
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/postgres/def/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ pub enum Type {

/// JSON data checked for validity and with additional functions
Json,
/// JSON data stored in a decomposed binary format that can be subscripted and used in indexes
JsonBinary,

/// Variable-length multidimensional array
Array,
Expand Down Expand Up @@ -186,6 +188,7 @@ impl Type {
"uuid" => Type::Uuid,
"xml" => Type::Xml,
"json" => Type::Json,
"jsonb" => Type::JsonBinary,
"array" => Type::Array,
// "" => Type::Composite,
"int4range" => Type::Int4Range,
Expand Down
3 changes: 3 additions & 0 deletions src/postgres/writer/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ impl ColumnInfo {
Type::Json => {
col_def.json();
}
Type::JsonBinary => {
col_def.json_binary();
}
Type::Array => {
col_def.custom(Alias::new("array"));
}
Expand Down

0 comments on commit 08aa398

Please sign in to comment.