All Projects → martincostello → Sqllocaldb

martincostello / Sqllocaldb

Licence: apache-2.0
SQL LocalDB Wrapper is a .NET library providing interop with the Microsoft SQL Server LocalDB Instance API

Projects that are alternatives of or similar to Sqllocaldb

Sql Apiconsumer
Database Project with generic procedures to consume API through GET/POST methods.
Stars: ✭ 77 (-51.27%)
Mutual labels:  sql-server
Xgenecloud
XgeneCloud is now https://github.com/nocodb/nocodb
Stars: ✭ 1,629 (+931.01%)
Mutual labels:  sql-server
Serilog Sinks Mssqlserver
A Serilog sink that writes events to Microsoft SQL Server
Stars: ✭ 141 (-10.76%)
Mutual labels:  sql-server
Dbwebapi
(Migrated from CodePlex) DbWebApi is a .Net library that implement an entirely generic Web API (RESTful) for HTTP clients to call database (Oracle & SQL Server) stored procedures or functions in a managed way out-of-the-box without any configuration or coding.
Stars: ✭ 84 (-46.84%)
Mutual labels:  sql-server
Minisqlquery
Minimalist SQL Query tool for any .NET DB Provider - SQL, SQLite, SQL CE, Oracle, Access...
Stars: ✭ 103 (-34.81%)
Mutual labels:  sql-server
Fastenshtein
The fastest .Net Levenshtein around
Stars: ✭ 115 (-27.22%)
Mutual labels:  sql-server
Aspnetcoreactivedirectorystarterkit
Starter kit to quickly create ASP.NET Core with On-Premises Active Directory Authentication.
Stars: ✭ 71 (-55.06%)
Mutual labels:  sql-server
Tiberius
TDS 7.4 (mssql / Microsoft SQL Server) async driver for rust
Stars: ✭ 154 (-2.53%)
Mutual labels:  sql-server
Sqlclient
Native Microsoft SQL Server client for iOS
Stars: ✭ 107 (-32.28%)
Mutual labels:  sql-server
Repo 2019
BERT, AWS RDS, AWS Forecast, EMR Spark Cluster, Hive, Serverless, Google Assistant + Raspberry Pi, Infrared, Google Cloud Platform Natural Language, Anomaly detection, Tensorflow, Mathematics
Stars: ✭ 133 (-15.82%)
Mutual labels:  sql-server
Prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite & MongoDB (Preview)
Stars: ✭ 18,168 (+11398.73%)
Mutual labels:  sql-server
Webtimesheetmanagement
Basic TimeSheet Management Application in ASP.NET MVC 5
Stars: ✭ 93 (-41.14%)
Mutual labels:  sql-server
Dbatools
🚀 SQL Server automation and instance migrations have never been safer, faster or freer
Stars: ✭ 1,742 (+1002.53%)
Mutual labels:  sql-server
Eval Sql.net
SQL Eval Function | Dynamically Evaluate Expression in SQL Server using C# Syntax
Stars: ✭ 84 (-46.84%)
Mutual labels:  sql-server
Msbuild.sdk.sqlproj
An MSBuild SDK that provides similar functionality to SQL Server Data Tools (.sqlproj) projects
Stars: ✭ 142 (-10.13%)
Mutual labels:  sql-server
Rsqlserver
SQL Server DBI for R, based on the jTDS driver
Stars: ✭ 76 (-51.9%)
Mutual labels:  sql-server
Msphpsql
Microsoft Drivers for PHP for SQL Server
Stars: ✭ 1,570 (+893.67%)
Mutual labels:  sql-server
Node Mssql
Microsoft SQL Server client for Node.js
Stars: ✭ 1,951 (+1134.81%)
Mutual labels:  sql-server
Querybuilder
SQL query builder, written in c#, helps you build complex queries easily, supports SqlServer, MySql, PostgreSql, Oracle, Sqlite and Firebird
Stars: ✭ 2,111 (+1236.08%)
Mutual labels:  sql-server
Transformalize
Configurable Extract, Transform, and Load
Stars: ✭ 125 (-20.89%)
Mutual labels:  sql-server

SQL LocalDB Wrapper

SQL LocalDB Wrapper is a .NET Standard 2.0 library providing interop with the Microsoft SQL Server LocalDB Instance API from managed code using .NET APIs.

NuGet

Build status

Introduction

This library exposes types that wrap the native SQL LocalDB Instance API to perform operations on SQL LocalDB such as for managing instances (create, delete, start, stop) and obtaining SQL connection strings for existing instances.

Microsoft SQL Server LocalDB 2012 and later is supported for both x86 and x64 on Microsoft Windows and the library targets netstandard2.0.

While the library can be compiled and referenced in .NET applications on non-Windows Operating Systems, SQL LocalDB is only supported on Windows. Non-Windows Operating Systems can query to determine that the SQL LocalDB Instance API is not installed, but other usage will cause a PlatformNotSupportedException to be thrown.

Installation

To install the library from NuGet using the .NET SDK run:

dotnet add package MartinCostello.SqlLocalDb

Basic Example

// using MartinCostello.SqlLocalDb;

using var localDB = new SqlLocalDbApi();

ISqlLocalDbInstanceInfo instance = localDB.GetOrCreateInstance("MyInstance");
ISqlLocalDbInstanceManager manager = instance.Manage();

if (!instance.IsRunning)
{
    manager.Start();
}

using SqlConnection connection = instance.CreateConnection();
connection.Open();

// Use the SQL connection...

manager.Stop();

Further Examples

Further examples of using the library can be found by following the links below:

  1. The wiki.
  2. The sample application.
  3. The examples written as tests.
  4. The library's own tests.

Migrating from System.Data.SqlLocalDb 1.x

Version 1.x.x of this library was previously published as System.Data.SqlLocalDb. The current version (3.x.x) has been renamed and is a breaking change to the previous version with various changes to namespaces and types.

Migrating from MartinCostello.SqlLocalDb 2.x

Version 2.x.x of this library uses SQL types from the System.Data.SqlClient namespace.

The current version (3.x.x) uses the new Microsoft.Data.SqlClient NuGet package where the same types (such as SqlConnection) are now in the Microsoft.Data.SqlClient namespace.

To migrate a project from using the previous 2.x release, you should change usage of the System.Data.SqlClient namespace to Microsoft.Data.SqlClient and recompile your project.

Feedback

Any feedback or issues can be added to the issues for this project in GitHub.

Repository

The repository is hosted in GitHub: https://github.com/martincostello/sqllocaldb.git

License

This project is licensed under the Apache 2.0 license.

Building and Testing

Compiling the library yourself requires Git and the .NET SDK to be installed (version 5.0.100 or later).

For all of the tests to be functional you must also have at least one version of SQL LocalDB installed.

To build and test the library locally from a terminal/command-line, run the following set of commands:

Windows

git clone https://github.com/martincostello/sqllocaldb.git
cd sqllocaldb
./build.ps1

Note: To run all the tests successfully, you must run either build.ps1 or Visual Studio with administrative privileges. This is because the SQL LocalDB APIs for sharing LocalDB instances can only be used with administrative privileges. Not running the tests with administrative privileges will cause all tests that exercise such functionality to be skipped.

Note: Several tests are skipped on non-Windows Operating Systems as SQL LocalDB itself is only supported on Windows.

Copyright and Trademarks

This library is copyright (©) Martin Costello 2012-2020.

Microsoft SQL Server is a trademark and copyright of the Microsoft Corporation.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].