{"id":19227414,"url":"https://github.com/akshitvadodariya1201/rust-with-postgresql","last_synced_at":"2026-05-08T05:02:17.835Z","repository":{"id":249939677,"uuid":"824150913","full_name":"AkshitVadodariya1201/Rust-with-PostgreSQL","owner":"AkshitVadodariya1201","description":"This project is a Rust application that interacts with a PostgreSQL database to manage authors and books. It demonstrates basic CRUD operations using the postgres crate.","archived":false,"fork":false,"pushed_at":"2024-07-24T06:28:40.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-04T22:20:00.810Z","etag":null,"topics":["cargo","docker","docker-compose","postgresql","rust","sql"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AkshitVadodariya1201.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-07-04T13:15:11.000Z","updated_at":"2024-07-24T06:27:59.000Z","dependencies_parsed_at":"2024-07-24T09:01:14.121Z","dependency_job_id":null,"html_url":"https://github.com/AkshitVadodariya1201/Rust-with-PostgreSQL","commit_stats":null,"previous_names":["akshitvadodariya1201/rust-with-postgresql"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkshitVadodariya1201%2FRust-with-PostgreSQL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkshitVadodariya1201%2FRust-with-PostgreSQL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkshitVadodariya1201%2FRust-with-PostgreSQL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkshitVadodariya1201%2FRust-with-PostgreSQL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AkshitVadodariya1201","download_url":"https://codeload.github.com/AkshitVadodariya1201/Rust-with-PostgreSQL/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240301295,"owners_count":19779798,"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","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":["cargo","docker","docker-compose","postgresql","rust","sql"],"created_at":"2024-11-09T15:23:11.885Z","updated_at":"2025-10-12T15:43:20.117Z","avatar_url":"https://github.com/AkshitVadodariya1201.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DB-Data Project\n\n## Overview\n\nThis project is a Rust application that interacts with a PostgreSQL database to manage authors and books. It demonstrates basic CRUD operations using the `postgres` crate.\n\n## Prerequisites\n\n- Rust and Cargo (See [Rust Installation](https://www.rust-lang.org/tools/install))\n- Docker and Docker Compose (See [Docker Installation](https://docs.docker.com/get-docker/))\n- PostgreSQL client (Optional, for direct database interaction)\n\n## Setup\n\n1. Clone the repository:\n\n```sh\ngit clone \u003crepository-url\u003e\ncd \u003crepository-directory\u003e\n```\n\n2. Start the PostgreSQL database using Docker Compose:\n\n```sh\ndocker-compose up -d\n```\n\nThis command starts a PostgreSQL instance and an Adminer instance for database management accessible at `http://localhost:8080`.\n\n3. Run the application:\n\n```sh\ncd db-data\ncargo run\n```\n\nThis command compiles the Rust application and executes it, performing the defined database operations.\n\n## Structure \n\n- `src/main.rs`: Contains the main application logic for interacting with the PostgreSQL database.\n- `Cargo.toml`: Contains the project metadata and dependencies.\n- `docker-compose.yml`: Contains the configuration for the PostgreSQL and Adminer services.\n\n## Database Schema\n\nThe database schema consists of two tables: \n- `authors`: Contains the author information with the following columns:\n  - `id`: Unique identifier for the author.\n  - `name`: Name of the author.\n  - `country`: Country of the author.\n- `books`: Contains the book information with the following columns:\n  - `id`: Unique identifier for the book.\n  - `title`: Title of the book.\n  - `author_id`: Foreign key referencing the `authors` table.\n  \n\n## Usage\n\nThe application provides a command-line interface (CLI) to interact with the database. The available commands are:\n\n- `list-authors`: List all authors in the database.\n- `create-author \u003cname\u003e`: Create a new author with the given name.\n- `delete-author \u003cid\u003e`: Delete the author with the given ID.\n- `list-books`: List all books in the database.\n- `create-book \u003ctitle\u003e \u003cauthor_id\u003e`: Create a new book with the given title and author ID.\n- `delete-book \u003cid\u003e`: Delete the book with the given ID.\n- `help`: Display the list of available commands.\n- `exit`: Exit the application.\n  \n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakshitvadodariya1201%2Frust-with-postgresql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakshitvadodariya1201%2Frust-with-postgresql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakshitvadodariya1201%2Frust-with-postgresql/lists"}