{"id":13457981,"url":"https://github.com/martincostello/sqllocaldb","last_synced_at":"2026-03-02T16:03:22.572Z","repository":{"id":17102324,"uuid":"19867837","full_name":"martincostello/sqllocaldb","owner":"martincostello","description":"SQL LocalDB Wrapper is a .NET library providing interop with the Microsoft SQL Server LocalDB Instance API","archived":false,"fork":false,"pushed_at":"2025-04-14T04:50:12.000Z","size":11726,"stargazers_count":251,"open_issues_count":1,"forks_count":45,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-04-14T22:09:22.232Z","etag":null,"topics":["c-sharp","sql-localdb","sql-server"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/martincostello.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["martincostello"],"buy_me_a_coffee":"martincostello"}},"created_at":"2014-05-16T19:14:03.000Z","updated_at":"2025-04-14T04:50:16.000Z","dependencies_parsed_at":"2024-02-05T08:42:46.529Z","dependency_job_id":"adbca2d2-39e8-4793-9e67-3a76503da5ca","html_url":"https://github.com/martincostello/sqllocaldb","commit_stats":{"total_commits":1535,"total_committers":11,"mean_commits":"139.54545454545453","dds":0.4423452768729642,"last_synced_commit":"d682b0110650a1c69cbd74bd144548cd89e0ef1d"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martincostello%2Fsqllocaldb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martincostello%2Fsqllocaldb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martincostello%2Fsqllocaldb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martincostello%2Fsqllocaldb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martincostello","download_url":"https://codeload.github.com/martincostello/sqllocaldb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248968914,"owners_count":21191162,"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":["c-sharp","sql-localdb","sql-server"],"created_at":"2024-07-31T09:00:41.312Z","updated_at":"2026-03-02T16:03:17.548Z","avatar_url":"https://github.com/martincostello.png","language":"C#","funding_links":["https://github.com/sponsors/martincostello","https://buymeacoffee.com/martincostello"],"categories":["C\\#"],"sub_categories":[],"readme":"# SQL LocalDB Wrapper\n\nSQL LocalDB Wrapper is a .NET library providing interop with the\n[Microsoft SQL Server LocalDB][sqllocaldb] Instance API from managed code using .NET APIs.\n\n[![NuGet][package-badge-version]][package-download]\n[![NuGet Downloads][package-badge-downloads]][package-download]\n\n[![Build status][build-badge]][build-status]\n[![codecov][coverage-badge]][coverage-report]\n[![OpenSSF Scorecard][scorecard-badge]][scorecard-report]\n\n## Introduction\n\nThis library exposes types that wrap the native SQL LocalDB Instance API to perform operations on\nSQL LocalDB such as for managing instances (create, delete, start, stop) and obtaining SQL\nconnection strings for existing instances.\n\nMicrosoft SQL Server LocalDB 2012 and later is supported for both x86 and x64 on Microsoft Windows.\n\n\u003e [!IMPORTANT]\n\u003e While the library can be compiled and referenced in .NET applications on non-Windows operating\n\u003e systems, SQL LocalDB is only supported on Windows. Non-Windows Operating Systems can query to\n\u003e determine that the SQL LocalDB Instance API is not installed, but other usage will cause a\n\u003e `PlatformNotSupportedException` to be thrown.\n\n### Installation\n\nTo install the library from [NuGet][package-download] using the .NET SDK run:\n\n```text\ndotnet add package MartinCostello.SqlLocalDb\n```\n\n### Basic Example\n\n```csharp\nusing MartinCostello.SqlLocalDb;\n\nusing var localDB = new SqlLocalDbApi();\n\nISqlLocalDbInstanceInfo instance = localDB.GetOrCreateInstance(\"MyInstance\");\nISqlLocalDbInstanceManager manager = instance.Manage();\n\nif (!instance.IsRunning)\n{\n    manager.Start();\n}\n\nusing SqlConnection connection = instance.CreateConnection();\nconnection.Open();\n\n// Use the SQL connection...\n\nmanager.Stop();\n```\n\n### Further Examples\n\nFurther examples of using the library can be found by following the links below:\n\n1. The [wiki][wiki-examples].\n1. The [sample application][sample-app].\n1. The [examples written as tests][test-examples].\n1. The library's [own tests][tests].\n\n## Migrating from System.Data.SqlLocalDb 1.x\n\nVersion `1.x.x` of this library was previously published as [`System.Data.SqlLocalDb`][legacy-package].\nSubsequent versions (`2.x.x` and later) have been renamed and is a breaking change to the previous\nversions, with various changes to namespaces and types.\n\n## Migrating from MartinCostello.SqlLocalDb 2.x\n\nVersion `2.x.x` of this library uses SQL types from the `System.Data.SqlClient` namespace.\n\nSubsequent versions (`3.x.x` and later) use the new [Microsoft.Data.SqlClient][sqlclient] NuGet package\nwhere the same types (such as `SqlConnection`) are now in the `Microsoft.Data.SqlClient` namespace.\n\nTo migrate a project from using the previous `2.x.x` releases, you should change usage of the `System.Data.SqlClient`\nnamespace to `Microsoft.Data.SqlClient` and recompile your project.\n\n## Feedback\n\nAny feedback or issues can be added to the issues for this project in [GitHub][issues].\n\n## Repository\n\nThe repository is hosted in [GitHub][repo]: \u003chttps://github.com/martincostello/sqllocaldb.git\u003e\n\n## License\n\nThis project is licensed under the [Apache 2.0][license] license.\n\n## Building and Testing\n\nCompiling the library yourself requires Git and the latest release of the [.NET SDK][dotnet-sdk] to be installed.\n\nFor all of the tests to be functional you must also have at least one version of [SQL LocalDB][sqllocaldb] installed.\n\nTo build and test the library locally from a terminal using PowerShell, run the following set of commands:\n\n```text\ngit clone https://github.com/martincostello/sqllocaldb.git\ncd sqllocaldb\n./build.ps1\n```\n\n\u003e [!NOTE]\n\u003e To run all the tests successfully, you must run either `build.ps1` or Visual Studio with administrative privileges.\n\u003e This is because the SQL LocalDB APIs for sharing LocalDB instances can only be used with administrative privileges.\n\u003e Not running the tests with administrative privileges will cause all tests that exercise such functionality to be skipped.\n\n\u003c!-- --\u003e\n\n\u003e [!IMPORTANT]\n\u003e Most tests are skipped on non-Windows Operating Systems as SQL LocalDB itself is only supported on Windows.\n\n## Copyright and Trademarks\n\nThis library is copyright (©) Martin Costello 2012-2025.\n\n[Microsoft SQL Server][sqlserver] is a trademark and copyright of the Microsoft Corporation.\n\n[build-badge]: https://github.com/martincostello/sqllocaldb/actions/workflows/build.yml/badge.svg?branch=main\u0026event=push\n[build-status]: https://github.com/martincostello/sqllocaldb/actions/workflows/build.yml?query=branch%3Amain+event%3Apush \"Continuous Integration for this project\"\n[coverage-badge]: https://codecov.io/gh/martincostello/sqllocaldb/branch/main/graph/badge.svg\n[coverage-report]: https://codecov.io/gh/martincostello/sqllocaldb \"Code coverage report for this project\"\n[dotnet-sdk]: https://dotnet.microsoft.com/download \"Download the .NET SDK\"\n[issues]: https://github.com/martincostello/sqllocaldb/issues \"Issues for this project on GitHub.com\"\n[legacy-package]: https://www.nuget.org/packages/System.Data.SqlLocalDb/ \"System.Data.SqlLocalDb on NuGet\"\n[license]: https://www.apache.org/licenses/LICENSE-2.0.txt \"The Apache 2.0 license\"\n[package-badge-downloads]: https://img.shields.io/nuget/dt/MartinCostello.SqlLocalDb?logo=nuget\u0026label=Downloads\u0026color=blue\n[package-badge-version]: https://img.shields.io/nuget/v/MartinCostello.SqlLocalDb?logo=nuget\u0026label=Latest\u0026color=blue\n[package-download]: https://www.nuget.org/packages/MartinCostello.SqlLocalDb \"Download MartinCostello.SqlLocalDb from NuGet\"\n[repo]: https://github.com/martincostello/sqllocaldb \"This project on GitHub.com\"\n[sample-app]: https://github.com/martincostello/sqllocaldb/tree/main/samples \"TodoApp sample\"\n[scorecard-badge]: https://api.securityscorecards.dev/projects/github.com/martincostello/sqllocaldb/badge\n[scorecard-report]: https://securityscorecards.dev/viewer/?uri=github.com/martincostello/sqllocaldb \"OpenSSF Scorecard for this project\"\n[sqlclient]: https://www.nuget.org/packages/Microsoft.Data.SqlClient/ \"Microsoft.Data.SqlClient on NuGet\"\n[sqllocaldb]: https://learn.microsoft.com/sql/relational-databases/express-localdb-instance-apis/sql-server-express-localdb-reference-instance-apis \"SQL Server Express LocalDB Reference - Instance APIs\"\n[sqlserver]: https://www.microsoft.com/sql-server/ \"Microsoft SQL Server\"\n[test-examples]: https://github.com/martincostello/sqllocaldb/blob/main/tests/SqlLocalDb.Tests/Examples.cs \"Examples as tests\"\n[tests]: https://github.com/martincostello/sqllocaldb/tree/main/tests/SqlLocalDb.Tests \"View MartinCostello.SqlLocalDb's tests\"\n[wiki-examples]: https://github.com/martincostello/sqllocaldb/wiki/Examples \"Examples in the SQL LocalDB Wrapper wiki\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartincostello%2Fsqllocaldb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartincostello%2Fsqllocaldb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartincostello%2Fsqllocaldb/lists"}