{"id":15285375,"url":"https://github.com/hsynlms/sequelize-fastify","last_synced_at":"2025-04-12T23:55:26.245Z","repository":{"id":41050210,"uuid":"271996134","full_name":"hsynlms/sequelize-fastify","owner":"hsynlms","description":"A Sequelize plugin for Fastify.","archived":false,"fork":false,"pushed_at":"2024-05-30T19:31:04.000Z","size":109,"stargazers_count":16,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T23:55:14.213Z","etag":null,"topics":["fastify","fastify-plugin","mariadb","mssql","mysql","postgresql","sequelize","sqlite"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/hsynlms.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2020-06-13T11:31:44.000Z","updated_at":"2024-04-22T15:13:33.000Z","dependencies_parsed_at":"2024-09-30T15:04:30.917Z","dependency_job_id":"b9fa24ef-fd6c-4b8c-a3a1-1003e29ff3cb","html_url":"https://github.com/hsynlms/sequelize-fastify","commit_stats":{"total_commits":61,"total_committers":2,"mean_commits":30.5,"dds":"0.016393442622950838","last_synced_commit":"0d3a69cecb7c3a1d5ea983d7ce42d234df8d0f14"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsynlms%2Fsequelize-fastify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsynlms%2Fsequelize-fastify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsynlms%2Fsequelize-fastify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsynlms%2Fsequelize-fastify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hsynlms","download_url":"https://codeload.github.com/hsynlms/sequelize-fastify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647232,"owners_count":21139083,"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":["fastify","fastify-plugin","mariadb","mssql","mysql","postgresql","sequelize","sqlite"],"created_at":"2024-09-30T15:04:27.489Z","updated_at":"2025-04-12T23:55:26.225Z","avatar_url":"https://github.com/hsynlms.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sequelize-fastify\n\u003e A [Sequelize](https://sequelize.org/) plugin for [Fastify](https://github.com/fastify/fastify).\n\n[![Downloads](https://img.shields.io/npm/dm/sequelize-fastify.svg)](https://npmjs.com/sequelize-fastify)\n[![install size](https://packagephobia.com/badge?p=sequelize-fastify)](https://packagephobia.com/result?p=sequelize-fastify)\n\n**Note:** Fastify v4 support is shipped with v2.0.0.\n\n**Supported Sequelize versions:**\n\n- v6.x\n\n## What is Sequelize?\nSequelize is a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server. It features solid transaction support, relations, eager and lazy loading, read replication and more.\n\nPlease check [official website](https://github.com/sequelize/sequelize) for more information and developer documentation.\n\n## Installation\n```\n$ npm install sequelize-fastify --save\n```\n\n## Usage\n\n```js\nconst sequelizeFastify = require('sequelize-fastify')\n\nawait fastify.register(\n  sequelizeFastify,\n  {\n    instance: 'db',\n    sequelizeOptions: {\n      dialect: 'DIALECT_NAME', /* one of 'mysql' | 'mariadb' | 'postgres' | 'mssql' */\n      database: 'DATABASE_NAME',\n      username: 'DATABASE_USER_NAME',\n      password: 'DATABASE_USER_PASSWORD',\n      host: 'DATABASE_HOST_OR_SERVER',\n      port: 'DATABASE_PORT'\n    }\n  }\n)\n  .ready(async () =\u003e {\n    try {\n      // first connection\n      const result = await fastify.db.authenticate()\n\n      console.log(\n        chalk.green('Database connection is successfully established.')\n      )\n    } catch(err) {\n      console.log(\n        chalk.red(`Connection could not established: ${err}`)\n      )\n    } finally {\n      fastify.close()\n    }\n  })\n```\n\n## Options\n| Name               | Type       | Default          | Description                                                                       |\n| ---                | ---        | ---              | ---                                                                               |\n| instance           | string     | `sequelize`      | A decorator instance name which will be available anywhere in the fastify server. |\n| sequelizeOptions   | object     | `{}`             | Sequelize configuration object which will be passed to Sequelize instance while creating. Please see [API Reference](https://sequelize.org/master/class/lib/sequelize.js~Sequelize.html#instance-constructor-constructor) doc. |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhsynlms%2Fsequelize-fastify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhsynlms%2Fsequelize-fastify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhsynlms%2Fsequelize-fastify/lists"}