{"id":30490492,"url":"https://github.com/nutshell-lab/aurora-store","last_synced_at":"2026-05-18T03:34:36.815Z","repository":{"id":42792782,"uuid":"272934120","full_name":"nutshell-lab/aurora-store","owner":"nutshell-lab","description":"Nutshell connector for serverless Aurora Postgres","archived":false,"fork":false,"pushed_at":"2023-01-11T03:05:46.000Z","size":266,"stargazers_count":1,"open_issues_count":11,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-09-25T23:24:03.732Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/nutshell-lab.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}},"created_at":"2020-06-17T09:34:44.000Z","updated_at":"2021-01-26T10:37:35.000Z","dependencies_parsed_at":"2023-02-09T00:16:38.354Z","dependency_job_id":null,"html_url":"https://github.com/nutshell-lab/aurora-store","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/nutshell-lab/aurora-store","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nutshell-lab%2Faurora-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nutshell-lab%2Faurora-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nutshell-lab%2Faurora-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nutshell-lab%2Faurora-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nutshell-lab","download_url":"https://codeload.github.com/nutshell-lab/aurora-store/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nutshell-lab%2Faurora-store/sbom","scorecard":{"id":698974,"data":{"date":"2025-08-11","repo":{"name":"github.com/nutshell-lab/aurora-store","commit":"21b08904b561e4ae8e043aebad678df29372e98a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":0,"reason":"26 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-4jv9-3563-23j3","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-px4h-xg32-q955","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7","Warn: Project is vulnerable to: GHSA-v4rh-8p82-6h5w","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T04:38:33.081Z","repository_id":42792782,"created_at":"2025-08-22T04:38:33.081Z","updated_at":"2025-08-22T04:38:33.081Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33163765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"online","status_checked_at":"2026-05-18T02:00:06.436Z","response_time":71,"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":"2025-08-24T18:02:59.538Z","updated_at":"2026-05-18T03:34:36.802Z","avatar_url":"https://github.com/nutshell-lab.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Goal\nThis repo was originaly made to provide a serverless aurora postgresql connector to be used in Keyro Login with a strong retro-compatibility with our [dynamodb connector](https://github.com/nutshell-lab/dynamodb-table) in mind.\nBy implementing the same API, it offers the opportunity to easily switch between Aurora and Dynamo.\n\n## Usage\n\n### Installation\n```bash\nyarn add @nutshelllab/aurora-store\n```\nThis module allows you to run your code on a local database. To do so, you will also need to have a proper\npostgresql installation running.\n\n## Configuration\n\nConfig is done through env variables so that you can use your serverless environnement to handle it as code :\n\n### Access to the database\n\nVariable | description\n---------|------------\nDB_HOST | The ip adress/domain where the SGBD runs. It may be an aws aurora cluster.\nDB_PORT | Default is postgres's default (5432)\nDB_NAME | The name of your postgresql database\nDB_USER | Username who has been given the proper privileges in your db\nDB_PASSWD | Password of the above user\nSLS_STAGE | **If `local` is passed, the variables below will be used instead of above.**\nLOCAL_DB_HOST | The ip adress/domain where the SGBD runs. It may be 127.0.0.1.\nLOCAL_DB_PORT | Default is postgres's default (5432)\nLOCAL_DB_NAME | The name of your postgresql database\nLOCAL_DB_USER | Username who has been given the proper privileges in your db\nLOCAL_DB_PASSWD | Password of the above user\n\n### Migrations\nYou can easily configure a migration source to handle your database schema. Migration are internally done through Knex, so that the configuration is identical. Here's an example with webpack context :\n\n```js\nimport { configure } from '@nutshelllab/aurora-store' //The module expose a simple configure method\n\nconst context = require.context('../../migrations', false, /\\.js$/)\n\nconst makeMigrationSource = context =\u003e {\n  return {\n    getMigrations() {\n      return Promise.resolve(context.keys().sort())\n    },\n    getMigrationName(migration) {\n      return migration\n    },\n    getMigration(migration) {\n      return context(migration)\n    }\n  }\n}\n\nconfigure({\n  migrationSource: makeMigrationSource(context) // Configuration is mutating the state, keep it for initialization as much as possible.\n})\n```\n\n### Initialize a store\nTo initialize a store, just call default function of the module :\n\n```js\nimport createStore from '@nutshelllab/aurora-store'\n\n//[...] configuration has been done at this point\n\nconst teamStore = createStore({ kind: 'teams', validate: makeTeam })\nconst result = await teamStore.find({ id: 'team-00007'})\n```\n\nOptions you can pass to the default store builder function are :\n\nOption | description | default\n---------|------------|-------\nkind | The table name you want to manipulate | No default, must be set\nvalidate | A validator function to be called on data before writing and after reading | [id function](https://en.wikipedia.org/wiki/Identity_function) (nothing happen)\nidField | Handle PK with this option as an array of columns names | ['id']\n\n\n### Features\n* [findIn](https://github.com/nutshell-lab/aurora-store#findInfield-values)\n* [findAll](https://github.com/nutshell-lab/aurora-store#findAllfilters)\n* [find](https://github.com/nutshell-lab/aurora-store#findfilters)\n* [put](https://github.com/nutshell-lab/aurora-store#putdata)\n* [update](https://github.com/nutshell-lab/aurora-store#updatedata)\n* [create](https://github.com/nutshell-lab/aurora-store#createdata)\n* [findOrCreate](https://github.com/nutshell-lab/aurora-store#findOrCreatefilters-data)\n* [remove](https://github.com/nutshell-lab/aurora-store#removefilters)\n* [truncate](https://github.com/nutshell-lab/aurora-store#truncateoptions)\n* [knexClient](https://github.com/nutshell-lab/aurora-store#knexClient)\n\n#### findIn(field, values)\n\nReturns all the records having a field's value intercecting with a predefined array of value.\n\n```js\nstore.findIn('id', ['001', '002', '003'])\n```\n\n#### findAll(filters)\n\nReturns all the records matching a pattern\n\n```js\nstore.findAll({ contracted: true })\n```\n\n#### find(filters)\nReturns exactly one record matching a pattern or throw an error with name attribute set to 'NOT_FOUND'.\n\n```js\nstore.find({ id: '001' })\n```\n\n#### put(data)\nWrite an object with the store. If it does not exist, it will be created.\n\n```js\nstore.put({ id: 'movie-0001', name: 'Black Widow' })\n```\n\n#### update(data)\nUpdate the record matching with data id (default is 'id' field, see idField configuration to change it).\n\n```js\nstore.update({id: 'movie-0001', name: 'Black Windows' })\n```\n\n#### create(data)\nInsert a new record with the given object values. AlreadyExisting will throw.\n\n```js\nstore.create({id: 'movie-0002', name: 'Black Windows' })\n```\n\n#### findOrCreate(filters, data)\nFetch a record with filters. A creation attempt is made it nothing is found. Bad filtering may result in throwing already exist error.\n\n```js\nstore.create({name: 'Black Windows'}, { id: 'newId-002', name: 'Black Windows', company: 'marvelcrosoft'})\n```\n\n#### remove(filters)\nDestroy all records with filters forever.\n\n```js\nstore.remove({name: 'Black Windows'})\n```\n\n#### truncate(options)\nDestroy all records of a table forever. You must pass force attribute to true to execute this as a way to make it\nclear that you know what you're doing.\n\n```js\nstore.truncate() // won't work\nstore.truncate({ force: true })\n```\n\n#### knexClient()\nObviously the point of using a relational database was to go beyond dynamo key-values restriction. This function gives you a Knex querybuilder. You can use that to manipulate any table in a sql-query manner :\n\n```js\nstore.knexClient().then(db =\u003e\n  db('movies').innerjoin('authors', 'authors.id', 'movies.authorId').where('authors.name', 'marvelcrosoft').select('movies.*')\n)\n```\n\nSee [knex documentation](https://knexjs.org/) for further features.\n\n\n### Combine with [serverless-offline](https://github.com/dherault/serverless-offline)\nWith serverless-offline, this module can be used to provide a 100% local execution which may **greatly** increase your productivity. Keyro Login has been tested and successfully run on a localhost with a local duplicated database of our remote dev environement.\n\n## Contribute\n\n1. Install postgresql\n2. Create a `pguser` user with a `pguser` password\n3. `yarn`\n4. Check integration tests `yarn test`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnutshell-lab%2Faurora-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnutshell-lab%2Faurora-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnutshell-lab%2Faurora-store/lists"}