{"id":19429168,"url":"https://github.com/bytebaker/from-psqlrow-rs","last_synced_at":"2025-08-05T10:33:29.251Z","repository":{"id":196912287,"uuid":"697424997","full_name":"ByteBaker/from-psqlrow-rs","owner":"ByteBaker","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-21T02:54:41.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-25T05:30:52.952Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ByteBaker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-27T17:47:26.000Z","updated_at":"2023-09-27T18:44:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"b53b5d25-21df-4051-9991-99a174bd9b00","html_url":"https://github.com/ByteBaker/from-psqlrow-rs","commit_stats":null,"previous_names":["bytebaker/from-psqlrow-rs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ByteBaker/from-psqlrow-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteBaker%2Ffrom-psqlrow-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteBaker%2Ffrom-psqlrow-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteBaker%2Ffrom-psqlrow-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteBaker%2Ffrom-psqlrow-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ByteBaker","download_url":"https://codeload.github.com/ByteBaker/from-psqlrow-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteBaker%2Ffrom-psqlrow-rs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268879981,"owners_count":24322781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-05T02:00:12.334Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T14:18:15.010Z","updated_at":"2025-08-05T10:33:29.187Z","avatar_url":"https://github.com/ByteBaker.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# from-psql-row\n\n_A simple crate to convert from [tokio_postgres::Row](https://docs.rs/tokio-postgres/latest/tokio_postgres/row/struct.Row.html) to a struct_. It's practically like [serde_postgres](https://docs.rs/serde_postgres/latest/serde_postgres/), except **dumber**, and **simpler**.\n\n---\n\n\n**What does it do?**\n\nNothing fancy, just creates an `impl TryFrom\u003ctokio_postgres::Row\u003e for MyStruct` if `MyStruct` is what you started with.\n\n**Why should I use this, if `serde_postgres` is available?**\n\nBecause it's so SIMPLE. `serde_postgres` needs your struct to have `#[derive(Deserialize)]`, meaning `serde` is needed. If for some reason all you want is to create a struct from `Row` without having to manually populate fields using `row.get::\u003c_, T\u003e(\"columnName\")` for each column, while avoiding `serde` (and keeping a minimal dependency footprint), you're in the right place.\n\n#### Features\n- First off, the `impl`. (Duh!) \n- Works for any data type that implements [tokio_postgres::FromSql](https://docs.rs/tokio-postgres/latest/tokio_postgres/types/trait.FromSql.html) trait.\n- Can handle fields with reserved keyword names. E.g., `r#type` maps to column \"**type**\" inside the `Row`.\n- Struct fields can be aliased to different column names. E.g., `user_name` can be aliased to column `user`. Check usage.\n\n#### Usage\n```rust\nuse from_psql_row::FromPsql;\n\n#[derive(FromPsql)]\nstruct MyStruct {\n    #[sqlfield(\"userId\")] // Maps to column 'userId', not 'user_name'\n    user_name: Uuid,\n    r#type: Option\u003cString\u003e, // Maps to column 'type'\n    age: u8,\n}\n```\n---\nTo use it in your project, run\n```\ncargo add from-psql-row --git https://github.com/ByteBaker/from-psqlrow-rs\n```\nor just add the following line to your `Cargo.toml`\n```toml\nfrom-psql-row = { version = \"0.1.0\", git = \"https://github.com/ByteBaker/from-psqlrow-rs\" }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytebaker%2Ffrom-psqlrow-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbytebaker%2Ffrom-psqlrow-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytebaker%2Ffrom-psqlrow-rs/lists"}