{"id":24904695,"url":"https://github.com/raihanuldev/postgresql","last_synced_at":"2025-07-23T10:31:20.557Z","repository":{"id":218908348,"uuid":"747665991","full_name":"raihanuldev/PostgreSQL","owner":"raihanuldev","description":"This repository showcases basic CRUD (Create, Read, Update, Delete) operations using PostgreSQL. It includes examples of how to interact with a PostgreSQL database, perform queries, manage data, and optimize database interactions. Ideal for developers looking to understand the essentials of database management with PostgreSQL.","archived":false,"fork":false,"pushed_at":"2024-01-29T14:58:57.000Z","size":31,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T21:16:31.627Z","etag":null,"topics":["crud-documentation","crud-operation","postgres","postgresql"],"latest_commit_sha":null,"homepage":"https://dev.to/rihanthedev/postgresql-crud-operation-3oc8","language":"JavaScript","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/raihanuldev.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-01-24T11:57:52.000Z","updated_at":"2024-12-25T13:07:37.000Z","dependencies_parsed_at":"2024-01-29T16:54:39.042Z","dependency_job_id":"29c200f5-18a9-4e39-9f0c-05fd700ccea0","html_url":"https://github.com/raihanuldev/PostgreSQL","commit_stats":null,"previous_names":["uniquecoderrihan/postgresql-book-api","raihanuldev/postgresql"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/raihanuldev/PostgreSQL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raihanuldev%2FPostgreSQL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raihanuldev%2FPostgreSQL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raihanuldev%2FPostgreSQL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raihanuldev%2FPostgreSQL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raihanuldev","download_url":"https://codeload.github.com/raihanuldev/PostgreSQL/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raihanuldev%2FPostgreSQL/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266661963,"owners_count":23964405,"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-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["crud-documentation","crud-operation","postgres","postgresql"],"created_at":"2025-02-01T23:39:31.294Z","updated_at":"2025-07-23T10:31:20.523Z","avatar_url":"https://github.com/raihanuldev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostgreSQL-CRUD OPERATION\nPostgreSQL, often referred to as \"Postgres,\" is a powerful open-source relational database management system (RDBMS). It is known for its reliability, extensibility, and compliance with SQL standards\n\n\n## Create Database \n```mysql\n-- Create database ; write it on CMd\n\nCREATE DATABASE usersDB;\n\n-- create a Table\nCREATE TABLE book (\n    id VARCHAR(255) PRIMARY KEY,\n    name VARCHAR(20),\n    role VARCHAR(20),\n    description VARCHAR(250)\n);\n\n```\n\n## GET ALL BOOK FROM book Collection\n\n```javascript\napp.get('/books', async(req,res)=\u003e{\n    try {\n        const books = await pool.query(\"SELECT * FROM book\")\n        res.status(200).json({message: \"data recived\",data:books.rows})\n    } catch (error) {\n        res.json({error: error.message})\n    }\n})\n```\n## Get Specific Book by Id\n```javascript\napp.get('/books/:id',async(req,res)=\u003e{\n    try {\n        const {id} = req.params;\n        // console.log(id)\n        const book = await pool.query(\"SELECT * FROM book WHERE id=$1\",[id])\n        res.status(200).json({text:\"book paisi\", data:book.rows})\n    } catch (error) {\n        res.json({error: error.message})\n    }\n})\n\n```\n## delete specific Book by id\n```javascript\napp.delete('/books/:id',async(req,res)=\u003e{\n    try {\n        const {id} = req.params;\n        const book = await pool.query(\"DELETE FROM book WHERE id=$1\",[id])\n        res.status(200).json({text:'Deleted'})\n        \n    } catch (error) {\n        res.json({error: error.message})\n    }\n})\n```\n## Update Book \n```javascript\napp.put('/books/:id',async(req,res)=\u003e{\n    try {\n        const {id} = req.params;\n        const {name,description} = req.body;\n        const updatedBook = await pool.query(\"UPDATE book SET name=$1,description=$2 WHERE id=$3 RETURNING *\",[name,description,id])\n        res.status(200).json({text: 'Book data Updated',data:updatedBook.rows})\n    } catch (error) {\n        res.json({error: error.message})\n    }\n})\n```\n## POST Book on book Collection\n```javascript\napp.post('/books',async(req,res)=\u003e{\n    try {\n        const {name,description} = req.body;\n        const id = uuidv4();\n        // Post on the database \n        const newBook = await pool.query(\n            \"INSERT INTO book (id,name,description) VALUES ($1,$2,$3) RETURNING *\",\n            [id,name,description]\n        )\n        res.status(201).json({data: newBook.rows})\n    } catch (error) {\n        res.json({error: error.message})\n    }\n})\n```\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first\nto discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraihanuldev%2Fpostgresql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraihanuldev%2Fpostgresql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraihanuldev%2Fpostgresql/lists"}