{"id":17242443,"url":"https://github.com/groue/grdbsnapshottesting","last_synced_at":"2025-03-17T11:30:33.233Z","repository":{"id":200099985,"uuid":"704230474","full_name":"groue/GRDBSnapshotTesting","owner":"groue","description":"The snapshot testing library for GRDB","archived":false,"fork":false,"pushed_at":"2024-09-29T15:29:05.000Z","size":48,"stargazers_count":34,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-27T23:05:12.061Z","etag":null,"topics":["database","grdb","snapshot-testing","sqlite","testing"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/groue.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["groue"]}},"created_at":"2023-10-12T20:19:16.000Z","updated_at":"2025-02-17T19:05:20.000Z","dependencies_parsed_at":"2024-10-27T12:52:08.347Z","dependency_job_id":"c21f163f-e5e4-4e6f-a183-35e69a229cc9","html_url":"https://github.com/groue/GRDBSnapshotTesting","commit_stats":null,"previous_names":["groue/grdbsnapshottesting"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groue%2FGRDBSnapshotTesting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groue%2FGRDBSnapshotTesting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groue%2FGRDBSnapshotTesting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groue%2FGRDBSnapshotTesting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/groue","download_url":"https://codeload.github.com/groue/GRDBSnapshotTesting/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243858056,"owners_count":20359271,"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":["database","grdb","snapshot-testing","sqlite","testing"],"created_at":"2024-10-15T06:13:17.705Z","updated_at":"2025-03-17T11:30:32.828Z","avatar_url":"https://github.com/groue.png","language":"Swift","funding_links":["https://github.com/sponsors/groue"],"categories":[],"sub_categories":[],"readme":"# GRDBSnapshotTesting\n\n**The snapshot testing library for GRDB**\n\n**Requirements**: iOS 13.0+ / macOS 10.15+ / tvOS 13.0+ / watchOS 7.0+ \u0026bull; Swift 6+ / Xcode 16+\n\n📖 **[Documentation]**\n\n---\n\nThis package makes it possible to test [GRDB] databases with [SnapshotTesting].\n\nSee the [Documentation] for usage tips and case studies (testing a fresh install, testing a specific migration, etc).\n\n## Usage\n\n```swift\nimport GRDB\nimport GRDBSnapshotTesting\nimport InlineSnapshotTesting\nimport XCTest\n\nclass MyDatabaseTests: XCTestCase {\n    func test_full_database_content() throws {\n        let dbQueue = try makeMyDatabase()\n        assertInlineSnapshot(of: dbQueue, as: .dumpContent()) {\n            \"\"\"\n            sqlite_master\n            CREATE TABLE player (\n              id INTEGER PRIMARY KEY,\n              name TEXT NOT NULL,\n              score INTEGER NOT NULL);\n\n            player\n            - id: 1\n              name: 'Arthur'\n              score: 500\n            - id: 2\n              name: 'Barbara'\n              score: 1000\n            \"\"\"\n        }\n    }\n    \n    func test_tables() throws {\n        let dbQueue = try makeMyDatabase()\n        assertSnapshot(of: dbQueue, as: .dumpTables([\"player\", \"team\"]))\n    }\n    \n    func test_request() throws {\n        let dbQueue = try makeMyDatabase()\n        try dbQueue.read { db in\n            assertSnapshot(of: Player.all(), as: .dump(db))\n        }\n    }\n    \n    func test_sql() throws {\n        let dbQueue = try makeMyDatabase()\n        try dbQueue.read { db in\n            assertSnapshot(of: \"SELECT * FROM player ORDER BY id\", as: .dump(db))\n        }\n    }\n}\n```\n\n[GRDB]: http://github.com/groue/GRDB.swift\n[SnapshotTesting]: https://github.com/pointfreeco/swift-snapshot-testing\n[Documentation]: https://swiftpackageindex.com/groue/GRDBSnapshotTesting/documentation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgroue%2Fgrdbsnapshottesting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgroue%2Fgrdbsnapshottesting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgroue%2Fgrdbsnapshottesting/lists"}