{"id":15041085,"url":"https://github.com/selvatico/go-mocket","last_synced_at":"2025-04-12T23:43:06.759Z","repository":{"id":57483302,"uuid":"93179791","full_name":"Selvatico/go-mocket","owner":"Selvatico","description":"Go GORM \u0026 SQL mocking library","archived":false,"fork":false,"pushed_at":"2022-08-03T12:22:37.000Z","size":57,"stargazers_count":221,"open_issues_count":17,"forks_count":36,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-12T23:43:02.330Z","etag":null,"topics":["db","go","golang","gorm","mocks"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/Selvatico.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":"2017-06-02T15:34:56.000Z","updated_at":"2025-03-05T09:29:12.000Z","dependencies_parsed_at":"2022-08-27T23:21:43.223Z","dependency_job_id":null,"html_url":"https://github.com/Selvatico/go-mocket","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Selvatico%2Fgo-mocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Selvatico%2Fgo-mocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Selvatico%2Fgo-mocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Selvatico%2Fgo-mocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Selvatico","download_url":"https://codeload.github.com/Selvatico/go-mocket/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647256,"owners_count":21139081,"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":["db","go","golang","gorm","mocks"],"created_at":"2024-09-24T20:45:31.370Z","updated_at":"2025-04-12T23:43:06.737Z","avatar_url":"https://github.com/Selvatico.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GoDoc](https://godoc.org/github.com/Selvatico/go-mocket?status.svg)](https://godoc.org/github.com/Selvatico/go-mocket)  [![Build Status](https://travis-ci.org/Selvatico/go-mocket.svg?branch=master)](https://travis-ci.org/Selvatico/go-mocket) [![Go Report Card](https://goreportcard.com/badge/github.com/Selvatico/go-mocket)](https://goreportcard.com/report/github.com/Selvatico/go-mocket)\n\n# Go-Mocket – Go GORM \u0026 SQL Mocking Library\n\nGo-Mocket is a library inspired by [DATA-DOG/go-sqlmock](https://github.com/DATA-DOG/go-sqlmock).\n\nAs an inspiration library, it is the implementation of [sql/driver](https://godoc.org/database/sql/driver) interface but at the same time it follows a different approach and only has a similar API.\nThis library helps to mock any DB connection with [jinzhu/gorm](https://github.com/jinzhu/gorm), as it was the created to serve this purpose.\n\nList of features in the library:\n\n* Mock `INSERT`, `UPDATE`, `SELECT`, `DELETE`\n* Support for transactions\n* 2 API's to use - `chaining` and via specifying a whole mock object\n* Matching by prepared statements arguments\n* You don't require to change anything inside your code to start using this library\n* Ability to trigger exceptions\n* Attach callbacks to mocked responses to add an additional check or modify a response\n\n**NOTE**, Please be aware that driver catches SQL without DB specifics. Generation of queries is done by *SQL* package\n\n## Install\n\n```\ngo get github.com/Selvatico/go-mocket\n```\n\n## Documentation\n\nFor detailed usage and examples, look at the [Documentation](/DOCUMENTATION.md)\n\n## License\n\nMIT License\n\nCopyright (c) 2017 Seredenko Dmitry\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselvatico%2Fgo-mocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fselvatico%2Fgo-mocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselvatico%2Fgo-mocket/lists"}