{"id":20236329,"url":"https://github.com/ordermentum/sequelize-batches","last_synced_at":"2025-04-10T19:02:06.593Z","repository":{"id":65513445,"uuid":"101229613","full_name":"ordermentum/sequelize-batches","owner":"ordermentum","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-15T17:58:26.000Z","size":94,"stargazers_count":16,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T16:43:40.661Z","etag":null,"topics":["async-await","iterator","nodejs","sequelize"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ordermentum.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":"2017-08-23T22:19:47.000Z","updated_at":"2024-07-09T11:45:46.000Z","dependencies_parsed_at":"2024-11-14T08:30:50.651Z","dependency_job_id":null,"html_url":"https://github.com/ordermentum/sequelize-batches","commit_stats":{"total_commits":7,"total_committers":2,"mean_commits":3.5,"dds":0.1428571428571429,"last_synced_commit":"b549d2fb10b74cd601405afb9cc8c6be9c87d252"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ordermentum%2Fsequelize-batches","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ordermentum%2Fsequelize-batches/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ordermentum%2Fsequelize-batches/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ordermentum%2Fsequelize-batches/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ordermentum","download_url":"https://codeload.github.com/ordermentum/sequelize-batches/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247926366,"owners_count":21019500,"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":["async-await","iterator","nodejs","sequelize"],"created_at":"2024-11-14T08:20:06.184Z","updated_at":"2025-04-10T19:02:06.547Z","avatar_url":"https://github.com/ordermentum.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sequelize Batches/Iterators\n\n*Note: depends on async generators*\n\nworks with Node 8.4.0 ```node --harmony-async-iteration```\n\n## Install\n\n```bash\nyarn add sequelize-batches\n```\n\nBelow where you have imported sequelize add sequelize-batches\n\n```javascript\nconst Sequelize = require('sequelize');\nrequire('sequelize-batches');\n```\n\n## Usage\n\nBelow example queries using the new syntax\n\n```javascript\n\nfor await (const posts of Post.batch({\n  where: { userId: 1 },\n  batchSize: 1000 })) {\n  for (const post of posts) {\n    console.log(post);\n  }\n}\n\nfor await (const post of Post.iterator()) {\n  console.log(post);\n}\n\nfor await (const post of Post.iterator({\n  where: {\n    id: {\n      $gte: 900,\n    }\n  }\n})) {\n  console.log(post.title);\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fordermentum%2Fsequelize-batches","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fordermentum%2Fsequelize-batches","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fordermentum%2Fsequelize-batches/lists"}