{"id":16683458,"url":"https://github.com/marcominerva/timemachine","last_synced_at":"2026-05-18T00:09:32.037Z","repository":{"id":175883685,"uuid":"653212782","full_name":"marcominerva/TimeMachine","owner":"marcominerva","description":"This example shows how to use the SQL Server Temporal Tables with Entity Framework Core to create a Time Machine for our data","archived":false,"fork":false,"pushed_at":"2025-06-27T10:16:14.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-01T05:37:51.683Z","etag":null,"topics":["c-sharp","efcore","entity-framework-core","net","sql-server","sql-server-database","temporal-tables"],"latest_commit_sha":null,"homepage":"","language":"C#","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/marcominerva.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null}},"created_at":"2023-06-13T16:00:17.000Z","updated_at":"2025-06-27T10:16:17.000Z","dependencies_parsed_at":"2025-06-27T11:23:23.277Z","dependency_job_id":"c14600be-1f40-4c1b-bb2a-408559f248ce","html_url":"https://github.com/marcominerva/TimeMachine","commit_stats":null,"previous_names":["marcominerva/timemachine"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/marcominerva/TimeMachine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcominerva%2FTimeMachine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcominerva%2FTimeMachine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcominerva%2FTimeMachine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcominerva%2FTimeMachine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcominerva","download_url":"https://codeload.github.com/marcominerva/TimeMachine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcominerva%2FTimeMachine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33160170,"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":"ssl_error","status_checked_at":"2026-05-17T22:39:10.741Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["c-sharp","efcore","entity-framework-core","net","sql-server","sql-server-database","temporal-tables"],"created_at":"2024-10-12T14:24:46.579Z","updated_at":"2026-05-18T00:09:32.020Z","avatar_url":"https://github.com/marcominerva.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Time Machine\n\nThis example shows how to use the SQL Server Temporal Tables with Entity Framework Core to create a Time Machine for our data.\n\n## Getting Started\n\n### 1. Clone the Repository\n\n```bash\ngit clone \u003crepository-url\u003e\ncd TimeMachine\n```\n\n### 2. Configure Database Connection\n\nUpdate the connection string in `TimeMachine/appsettings.json`:\n\n```json\n{\n    \"ConnectionStrings\": {\n        \"SqlConnection\": \"Server=(localdb)\\\\mssqllocaldb;Database=TimeMachineDb;Trusted_Connection=true;MultipleActiveResultSets=true\"\n    }\n}\n```\n\nFor other SQL Server configurations, adjust the connection string accordingly:\n- **SQL Server Express**: `Server=.\\\\SQLEXPRESS;Database=TimeMachineDb;Trusted_Connection=true;MultipleActiveResultSets=true`\n- **SQL Server with authentication**: `Server=localhost;Database=TimeMachineDb;User Id=your_username;Password=your_password;MultipleActiveResultSets=true`\n\n### 3. Populate the Database\n\n**Important**: After configuring the database connection, you must run the `Scripts.sql` file to create the temporal tables and populate the database with sample data. This script contains:\n\n- Complete table definitions with temporal table configuration\n- Sample data for Cities, People, and PhoneNumbers\n- Proper foreign key relationships\n- Commented scripts for converting existing tables to temporal tables (if needed)\n\nExecute the `Scripts.sql` file using SQL Server Management Studio, Azure Data Studio, or via command line:\n\n```bash\nsqlcmd -S (localdb)\\mssqllocaldb -d TimeMachineDb -i Scripts.sql\n```\n\nThis step is required to have test data available for the API endpoints and to see the temporal table functionality in action.\n\n## API Endpoints\n\n### Get Person by ID\n\n```\nGET /api/people/{id}\n```\n\nOptional query parameter:\n- `dateTime`: ISO 8601 formatted datetime to query historical data\n\nExamples:\n- Get current data: `GET /api/people/123e4567-e89b-12d3-a456-426614174000`\n- Get historical data: `GET /api/people/123e4567-e89b-12d3-a456-426614174000?dateTime=2023-01-01T12:00:00Z`\n\n## Database Schema\n\nThe application uses SQL Server Temporal Tables to automatically track changes to:\n- **People**: Person information with city relationship\n- **PhoneNumbers**: Phone numbers associated with people\n- **Cities**: City information\n\nEach table has corresponding history tables that store previous versions of records.\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcominerva%2Ftimemachine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcominerva%2Ftimemachine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcominerva%2Ftimemachine/lists"}