{"id":22415956,"url":"https://github.com/thales-eduardo/crud-node-pg","last_synced_at":"2026-05-05T11:35:02.585Z","repository":{"id":42502216,"uuid":"411369185","full_name":"Thales-Eduardo/CRUD-node-pg","owner":"Thales-Eduardo","description":"crud with driver native node-postgres","archived":false,"fork":false,"pushed_at":"2023-01-07T22:57:15.000Z","size":352,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-27T04:19:02.916Z","etag":null,"topics":["jest","node-pg","nodejs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Thales-Eduardo.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}},"created_at":"2021-09-28T17:00:40.000Z","updated_at":"2021-10-01T18:06:30.000Z","dependencies_parsed_at":"2023-02-08T03:15:52.580Z","dependency_job_id":null,"html_url":"https://github.com/Thales-Eduardo/CRUD-node-pg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Thales-Eduardo/CRUD-node-pg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thales-Eduardo%2FCRUD-node-pg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thales-Eduardo%2FCRUD-node-pg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thales-Eduardo%2FCRUD-node-pg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thales-Eduardo%2FCRUD-node-pg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Thales-Eduardo","download_url":"https://codeload.github.com/Thales-Eduardo/CRUD-node-pg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thales-Eduardo%2FCRUD-node-pg/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266596689,"owners_count":23953891,"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-22T02:00:09.085Z","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":["jest","node-pg","nodejs"],"created_at":"2024-12-05T15:14:13.882Z","updated_at":"2026-05-05T11:35:02.508Z","avatar_url":"https://github.com/Thales-Eduardo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [CRUD with driver native node-postgres](https://node-postgres.com/features/connecting)\n\nPara iniciar a aplicação.\n\n\u003e docker-compose up -d\n\ndeletar os contêineres.\n\n\u003e docker-compose down\n\nEssa api simples e apenas uma introdução, porem esta pronta para escalar caso queira.\n\n# Query\n\n```sql\nCREATE TABLE IF NOT EXISTS USERS(\n  ID UUID PRIMARY KEY,\n  NAME VARCHAR (255) NOT NULL,\n  EMAIL VARCHAR (255) NOT NULL,\n  DATE TIMESTAMP DEFAULT NOW()\n);\n```\n\n```js\n//Adicionando usuário.\nawait this.client.query(\n  'INSERT INTO USERS (ID, NAME, EMAIL) VALUES ($1, $2, $3)',\n  [id, name, email],\n);\n\n//Buscar usuário por id.\nawait this.client.query('SELECT * FROM USERS WHERE ID = $1 LIMIT 1', [idUser]);\n\n//Buscar todos os usuários com paginação e limitando a quantidade no retorno.\nawait this.client.query('SELECT * FROM USERS LIMIT $1 OFFSET $2', [\n  limit,\n  offset,\n]);\n\n//Atualizar dados do usuário especificado.\nawait this.client.query(\n  'UPDATE USERS SET NAME = $1, EMAIL = $2 WHERE ID = $3',\n  [name, email, id],\n);\n\n//Deletar usuário específico.\nawait this.client.query('DELETE FROM USERS WHERE ID = $1', [id]);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthales-eduardo%2Fcrud-node-pg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthales-eduardo%2Fcrud-node-pg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthales-eduardo%2Fcrud-node-pg/lists"}