All Projects → fsprojects → Fsharp.data.sqlclient

fsprojects / Fsharp.data.sqlclient

Licence: other
A set of F# Type Providers for statically typed access to MS SQL database

Projects that are alternatives of or similar to Fsharp.data.sqlclient

Sp whoisactive
sp_whoisactive
Stars: ✭ 566 (+202.67%)
Mutual labels:  sql, sqlserver
Smartsql
SmartSql = MyBatis in C# + .NET Core+ Cache(Memory | Redis) + R/W Splitting + PropertyChangedTrack +Dynamic Repository + InvokeSync + Diagnostics
Stars: ✭ 775 (+314.44%)
Mutual labels:  sql, sqlserver
Rezoom.sql
Statically typechecks a common SQL dialect and translates it to various RDBMS backends
Stars: ✭ 621 (+232.09%)
Mutual labels:  sql, sqlserver
Monitor Table Change With Sqltabledependency
Get SQL Server notification on record table change
Stars: ✭ 459 (+145.45%)
Mutual labels:  sql, sqlserver
Sqlfaker
轻量级、易拓展的数据库智能填充Java开源库
Stars: ✭ 109 (-41.71%)
Mutual labels:  sql, sqlserver
Jooq
jOOQ is the best way to write SQL in Java
Stars: ✭ 4,695 (+2410.7%)
Mutual labels:  sql, sqlserver
Nopcommerce
The most popular open-source eCommerce shopping cart solution based on ASP.NET Core
Stars: ✭ 6,827 (+3550.8%)
Mutual labels:  sql, sqlserver
Sqlinjectionwiki
A wiki focusing on aggregating and documenting various SQL injection methods
Stars: ✭ 623 (+233.16%)
Mutual labels:  sql, sqlserver
Ebean
Ebean ORM
Stars: ✭ 1,172 (+526.74%)
Mutual labels:  sql, sqlserver
Tigertoolbox
Toolbox repository for Tiger team
Stars: ✭ 1,003 (+436.36%)
Mutual labels:  sql, sqlserver
Jsqlparser
JSqlParser parses an SQL statement and translate it into a hierarchy of Java classes. The generated hierarchy can be navigated using the Visitor Pattern
Stars: ✭ 3,405 (+1720.86%)
Mutual labels:  sql, sqlserver
Efcore.bulkextensions
Entity Framework Core Bulk Batch Extensions for Insert Update Delete Read (CRUD), Truncate and SaveChanges operations on SQL Server, PostgreSQL, SQLite
Stars: ✭ 2,295 (+1127.27%)
Mutual labels:  sql, sqlserver
Liquibase
Main Liquibase Source
Stars: ✭ 2,910 (+1456.15%)
Mutual labels:  sql, sqlserver
Evolve
Database migration tool for .NET and .NET Core projects. Inspired by Flyway.
Stars: ✭ 477 (+155.08%)
Mutual labels:  sql, sqlserver
Ezsql
PHP class to make interacting with a database ridiculusly easy
Stars: ✭ 804 (+329.95%)
Mutual labels:  sql, sqlserver
Kangaroo
SQL client and admin tool for popular databases
Stars: ✭ 127 (-32.09%)
Mutual labels:  sql, sqlserver
Yuniql
Free and open source schema versioning and database migration made natively with .NET Core.
Stars: ✭ 156 (-16.58%)
Mutual labels:  sql, sqlserver
Osquery Extensions
osquery extensions by Trail of Bits
Stars: ✭ 180 (-3.74%)
Mutual labels:  sql
Denunciado
This project born from the need from people to have a way of communication between municipalities and communities. Some municipalities, have their platforms, but they are complex to validate the veracity of complaints. Denounced, it was born with the purpose of offering a free platform to these municipalities. Denounced consists of three main modules developed with Microsoft technologies, using the .Net Framework and Xamarin for its development: 1. Back End Web Project: Module of administration of the complaints, by the employees of the town councils. In this tool, the employees of the city council receive, validate, report and close the complaints, after being served. 2. Web Portal Client: It consists of a web project, so that the community make their complaints, in the same, the users of the service create a profile, must specify when making their complaint, evidence to support this. Through the portal, they can see the complaints of other community members, follow it, give their opinion or provide possible solutions or more evidence. 3. Mobile Project: It has the same functionalities as the web portal, with the addition, that the automatic location can be sent, from the cell phone.
Stars: ✭ 183 (-2.14%)
Mutual labels:  sql
Ts Sql
A SQL database implemented purely in TypeScript type annotations.
Stars: ✭ 2,324 (+1142.78%)
Mutual labels:  sql

FSharp.Data.SqlClient - Type providers for Microsoft SQL Server

This library exposes SQL Server Database objects in a type safe manner to F# code, by the mean of Type Providers

You can reference it in F# Interactive that ships with Visual Studio

#r "nuget: FSharp.Data.SqlClient"
open FSharp.Data
open FSharp.Data.SqlClient
let [<Literal>] connectionString = "Server=.;Database=AdventureWorks2012;Trusted_Connection=True;"
type MyCommand = SqlCommandProvider<"""
select 
	data.a 
from 
	(select 1 a union all select 2 union all select 3) data
where
	data.a > @data 
    """, connectionString>;;

(new MyCommand(connectionString)).Execute(data=1) 
|> Seq.toArray
|> printfn "%A"

dotnet fsi is not supported yet.

Quick Links

Type Providers

SqlCommandProvider

Provides statically typed access to the parameters and result set of T-SQL command in idiomatic F# way (*).

open FSharp.Data

[<Literal>]
let connectionString = "Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True"

// The query below retrieves top 3 sales representatives from North American region with YTD sales of more than one million.

do
    use cmd = new SqlCommandProvider<"
        SELECT TOP(@topN) FirstName, LastName, SalesYTD 
        FROM Sales.vSalesPerson
        WHERE CountryRegionName = @regionName AND SalesYTD > @salesMoreThan 
        ORDER BY SalesYTD
        " , connectionString>(connectionString)

    cmd.Execute(topN = 3L, regionName = "United States", salesMoreThan = 1000000M) |> printfn "%A"

output

seq
    [("Pamela", "Ansman-Wolfe", 1352577.1325M);
     ("David", "Campbell", 1573012.9383M);
     ("Tete", "Mensa-Annan", 1576562.1966M)]

SqlProgrammabilityProvider

Exposes Tables, Stored Procedures, User-Defined Types and User-Defined Functions in F# code.

type AdventureWorks = SqlProgrammabilityProvider<connectionString>
do
    use cmd = new AdventureWorks.dbo.uspGetWhereUsedProductID(connectionString)
    for x in cmd.Execute( StartProductID = 1, CheckDate = System.DateTime(2013,1,1)) do
        //check for nulls
        match x.ProductAssemblyID, x.StandardCost, x.TotalQuantity with 
        | Some prodAsmId, Some cost, Some qty -> 
            printfn "ProductAssemblyID: %i, StandardCost: %M, TotalQuantity: %M" prodAsmId cost qty
        | _ -> ()

output

ProductAssemblyID: 749, StandardCost: 2171.2942, TotalQuantity: 1.00
ProductAssemblyID: 750, StandardCost: 2171.2942, TotalQuantity: 1.00
ProductAssemblyID: 751, StandardCost: 2171.2942, TotalQuantity: 1.00

SqlEnumProvider

Let's say we need to retrieve number of orders shipped by a certain shipping method since specific date.

//by convention: first column is Name, second is Value
type ShipMethod = SqlEnumProvider<"
    SELECT Name, ShipMethodID FROM Purchasing.ShipMethod ORDER BY ShipMethodID", connectionString>

//Combine with SqlCommandProvider
do 
    use cmd = new SqlCommandProvider<"
        SELECT COUNT(*) 
        FROM Purchasing.PurchaseOrderHeader 
        WHERE ShipDate > @shippedLaterThan AND ShipMethodID = @shipMethodId
    ", connectionString, SingleRow = true>(connectionString) 
    //overnight orders shipped since Jan 1, 2008 
    cmd.Execute( System.DateTime( 2008, 1, 1), ShipMethod.``OVERNIGHT J-FAST``) |> printfn "%A"

output

Some (Some 1085)

SqlFileProvider

type SampleCommand = SqlFile<"sampleCommand.sql">
type SampleCommandRelative = SqlFile<"sampleCommand.sql", "MySqlFolder">

use cmd1 = new SqlCommandProvider<SampleCommand.Text, ConnectionStrings.AdventureWorksNamed>()
use cmd2 = new SqlCommandProvider<SampleCommandRelative.Text, ConnectionStrings.AdventureWorksNamed>()

More information can be found in the documentation.

Build Status

Windows Linux NuGet
Build status (Windows Server 2012, AppVeyor) Build Status NuGet Status

Maintainers

The default maintainer account for projects under "fsprojects" is @fsprojectsgit - F# Community Project Incubation Space (repo management)

Thanks Jetbrains for their open source license program and providing their tool.

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].