Skip to content

Commit

Permalink
✨ Add 2 new types.
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGariepy committed Apr 16, 2022
1 parent addc915 commit b666fa1
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
44 changes: 44 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ tokio-postgres = { version = "0.7.5", features = [
"with-serde_json-1",
"with-time-0_3",
"with-uuid-0_8",
"with-eui48-1",
] }
postgres-types = { version = "0.2.2", features = ["derive"] }
serde = { version = "1.0.136", features = ["derive"] }
serde_json = "1.0.79"
time = "0.3.9"
uuid = "0.8.2"
eui48 = "1.1.0"

thiserror = "1.0.30"
clap = { version = "3.1.8", features = ["derive"] }
Expand Down
5 changes: 3 additions & 2 deletions src/pg_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ impl Default for TypeRegistrar {
TypeRegistrar::from([
("bool", Type::BOOL, "bool"),
("boolean", Type::BOOL, "bool"),
("\"char\"", Type::CHAR, "i8"),
("char", Type::CHAR, "i8"),
("smallint", Type::INT2, "i16"),
("int2", Type::INT2, "i16"),
("smallserial", Type::INT2, "i16"),
Expand Down Expand Up @@ -351,10 +351,11 @@ impl Default for TypeRegistrar {
("json", Type::JSON, "serde_json::Value"),
("jsonb", Type::JSONB, "serde_json::Value"),
("uuid", Type::UUID, "uuid::Uuid"),
("inet", Type::INET, "std::net::IpAddr"),
("macaddr", Type::MACADDR, "eui48::MacAddress"),
])
}
}

pub mod error {
use postgres_types::Kind;
use thiserror::Error as ThisError;
Expand Down

0 comments on commit b666fa1

Please sign in to comment.