jaredzhou/moonpg/value does not have a README file
impl FromValue for MyType with fn from_value(v : Value) -> MyType raise ValueError {
match v {
Value::String(s) => parse_my_type(s)
_ => raise ValueError::ValueError("expected Value::String, got ...")
}
}impl ToValue for MyType with fn to_value(self) -> Value {
...
}
let val = my_val.to_value()| Variant | PG types |
|---|---|
| Null | SQL NULL |
| Bool | bool (16) |
| Int | int2 (21), int4 (23) |
| Int64 | int8 (20) |
| Float | float4 (700), float8 (701) |
| String | text, varchar, bpchar, name, uuid, … |
| Bytes | bytea (17) |
| Timestamp(Int64) | timestamp (1114), timestamptz (1184) |
| Json(Json) | json (114), jsonb (3802) |
Install
Download zipA pure MoonBit PostgreSQL client, wire protocol from scratch.