{"id":22647759,"url":"https://github.com/davidhintelmann/adventureworksrestful","last_synced_at":"2026-07-01T00:32:01.990Z","repository":{"id":208175397,"uuid":"720980137","full_name":"davidhintelmann/AdventureWorksRESTful","owner":"davidhintelmann","description":"Creating a simple RESTful API using golang and AdventureWorks sample Database","archived":false,"fork":false,"pushed_at":"2023-11-20T05:59:52.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-04T00:43:51.536Z","etag":null,"topics":["adventureworks","go","golang","rest-api","restful","restful-api","sql","sqlserver"],"latest_commit_sha":null,"homepage":"","language":"Go","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/davidhintelmann.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-20T05:23:29.000Z","updated_at":"2024-09-10T05:35:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"160261cd-26e4-41ce-bc79-733c62dd3261","html_url":"https://github.com/davidhintelmann/AdventureWorksRESTful","commit_stats":null,"previous_names":["davidhintelmann/adventureworksrestful"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/davidhintelmann/AdventureWorksRESTful","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidhintelmann%2FAdventureWorksRESTful","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidhintelmann%2FAdventureWorksRESTful/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidhintelmann%2FAdventureWorksRESTful/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidhintelmann%2FAdventureWorksRESTful/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidhintelmann","download_url":"https://codeload.github.com/davidhintelmann/AdventureWorksRESTful/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidhintelmann%2FAdventureWorksRESTful/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34988712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"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":["adventureworks","go","golang","rest-api","restful","restful-api","sql","sqlserver"],"created_at":"2024-12-09T07:34:31.380Z","updated_at":"2026-07-01T00:32:01.960Z","avatar_url":"https://github.com/davidhintelmann.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RESTful API using go lang\n\nThis repo is using the [go](https://go.dev/) programming lanuage and the [Adventure Works](https://learn.microsoft.com/en-us/sql/samples/adventureworks-install-configure?view=sql-server-ver16\u0026tabs=ssms) sample database to create a RESTful API.\n\n# Prerequisites\n\nThis project assumes one is using Windows OS and has the following already installed:\n1. [Microsoft SQL Server](https://www.microsoft.com/en-ca/sql-server/sql-server-downloads)\n2. [SSMS](https://learn.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-ver16) for restoring Adventure Works database\n3. [Adventure Works](https://learn.microsoft.com/en-us/sql/samples/adventureworks-install-configure?view=sql-server-ver16\u0026tabs=ssms) 2022 OLTP sample database\n   - Download 'AdventureWorks2022.bak'\n   - Restore database using SSMS\n4. [Go](https://go.dev/dl/) programming language\n5. Installing [pure Go](https://github.com/microsoft/go-mssqldb) database driver for Go's 'database/sql' package\n\t- repo above is forked from [denisenkom](https://github.com/denisenkom/go-mssqldb)\n\n# Run App\n\nclone this repo using:\n\u003e git clone https://github.com/davidhintelmann/AdventureWorksRESTful.git\n\nnow run app using:\n\u003e go run main.go\n\nor build the app and run it:\n\u003e go build -o api.exe main.go\n\u003e \n\u003e .\\api.exe\n\nYou can now open a browser and navigate to 'localhost:3000'. Endpints are at 'localhost:3000/{endpoint}'\n\n# Endpoints\n\nAfter cloning this repo and running the app, you can access endpints at 'localhost:3000/{endpoint}'\n\nEndpoints:\n-   /people\n-   /country/{COUNTRY CODE}\n-   /ccount\n\n## people\n\nThis endpoint will return information about people's names, country, etc.\n\nThe '/people' endpoint, found at 'localhost:3000/people' will return the following SQL Query:\n\n```sql\nSELECT Person.Person.BusinessEntityID\n,Person.Person.Title\n,Person.Person.FirstName\n,Person.Person.MiddleName\n,Person.Person.LastName\n,Person.Person.Suffix\n,Person.StateProvince.StateProvinceCode\n,Person.StateProvince.CountryRegionCode\n,Person.StateProvince.Name\n,Person.CountryRegion.Name\nFROM Person.Person\nJOIN Person.BusinessEntityAddress ON Person.Person.BusinessEntityID = Person.BusinessEntityAddress.BusinessEntityID\nJOIN Person.Address ON Person.BusinessEntityAddress.AddressID = Person.Address.AddressID\nJOIN Person.StateProvince ON Person.Address.StateProvinceID = Person.StateProvince.StateProvinceID\nJOIN Person.CountryRegion ON Person.StateProvince.CountryRegionCode = Person.CountryRegion.CountryRegionCode;\n```\n\n## ccount\n\nThis endpoint will return information about how many businesses are in each country.\n\nThe '/ccount' endpoint, found at 'localhost:3000/ccount' will return the following SQL Query:\n\n```sql\nSELECT [Person].[CountryRegion].[Name] AS \"Country\"\n,COUNT([Person].[Person].[BusinessEntityID]) AS \"Business Sum\"\nFROM [Person].[Person]\nJOIN [Person].[BusinessEntityAddress] ON [Person].[BusinessEntityAddress].[BusinessEntityID] = [Person].[Person].[BusinessEntityID]\nJOIN [Person].[Address] ON [Person].[Address].[AddressID] = [Person].[BusinessEntityAddress].[AddressID]\nJOIN [Person].[StateProvince] ON [Person].[StateProvince].[StateProvinceID] = [Person].[Address].[StateProvinceID]\nJOIN [Person].[CountryRegion] ON [Person].[CountryRegion].[CountryRegionCode] = [Person].[StateProvince].[CountryRegionCode]\nGROUP BY [Person].[CountryRegion].[Name]\nORDER BY COUNT([Person].[Person].[BusinessEntityID]) DESC\n```\n\n## country\n\nThis endpoint will return similar information as the /people endpoint but it will filter based on country code.\n\nThe '/country' endpoint, found at 'localhost:3000/country/{COUNTRY CODE}' will return the following SQL Query:\n\n```sql\nSELECT Person.Person.BusinessEntityID\n,Person.Person.Title\n,Person.Person.FirstName\n,Person.Person.MiddleName\n,Person.Person.LastName\n,Person.Person.Suffix\n,Person.StateProvince.StateProvinceCode\n,Person.StateProvince.CountryRegionCode\n,Person.StateProvince.Name\n,Person.CountryRegion.Name\nFROM Person.Person\nJOIN Person.BusinessEntityAddress ON Person.Person.BusinessEntityID = Person.BusinessEntityAddress.BusinessEntityID\nJOIN Person.Address ON Person.BusinessEntityAddress.AddressID = Person.Address.AddressID\nJOIN Person.StateProvince ON Person.Address.StateProvinceID = Person.StateProvince.StateProvinceID\nJOIN Person.CountryRegion ON Person.StateProvince.CountryRegionCode = Person.CountryRegion.CountryRegionCode\nWHERE  Person.CountryRegion.CountryRegionCode = '{COUNTRY CODE}';\n```\n\n**Note:** {COUNTRY CODE} in the above SQL query is a [two letter country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)\n\nNavigating to 'localhost:3000/country/CA' will only return people from Canada.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidhintelmann%2Fadventureworksrestful","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidhintelmann%2Fadventureworksrestful","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidhintelmann%2Fadventureworksrestful/lists"}