SeaQL / SeaQL/sea-orm

Add try_from_sqlx_postgres_row_to_proxy_row

Open
#2,824 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
9.9k
Forks
734
Avg merge
6h 36m
Merged PRs (30d)
8

Description

First, thanks for the nice library, I enjoy using it. :)

One papercut is, as it is now, sea_orm::from_sqlx_postgres_row_to_proxy_row will panic on this line if a type is returned that doesn't find a match:
https://github.com/SeaQL/sea-orm/blob/4d0dcdc8ac279aaa09a7c78499dd946f9799f8cc/src/driver/sqlx_postgres.rs#L929

Would be nice(r) if there was a try_from_sqlx_postgres_row_to_proxy_row variant that wouldn't crash but return an error instead, where the given instance may have custom types defined from extension modules in my case.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/driver/sqlx_postgres.rs around line 929 and inspect from_sqlx_postgres_row_to_proxy_row, especially the unmatched-type panic. Add the requested try_from_sqlx_postgres_row_to_proxy_row variant so unmatched PostgreSQL types return an error instead; done means callers can use it without a panic.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, rust
Domain
databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.