Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bbsimonbb/query-first

Open more actions menu

Repository files navigation

query-first

A much smarter way to work with SQL.

Query first is a "lightweight, low ceremony" data access tech, for working with SQL in C# projects. Develop your queries using the QueryFirst .sql template (in Visual C# items). When you save your file, QueryFirst will generate a wrapper class and a POCO for your results.

You will need to install the VSIX, then in your project, create qfconfig.json beside or above your .sql files. To create a query, choose New QueryFirstQuery from the Add => New Item dialogue.

// qfconfig.json
{
  "defaultConnection": "Data Source=localhost;Initial Catalog=Northwind;Integrated Security=True",
  "provider:["System.Data.SqlClient"(the default)/"MySql.Data.MySqlClient"/"Npgsql"],
  "helperAssembly":[pathToDll],
  "makeSelfTest":true/false
} 

// QfRuntimeConnection.cs
using System.Data;
using System.Data.SqlClient;

namespace CoreWebAppSqlServer
{
    public class QfRuntimeConnection
    {
        public static IDbConnection GetConnection()
        {
            return new SqlConnection("Data Source=localhost;Initial Catalog=Northwind;Integrated Security=True");
        }
    }
}

Nikhil Gupta, this is Simon Boddy, bbsimonbb@gmail.com, proving ownership of this repo !

Read more and download the VSIX here. There's a little code project article here.

About

Typed raw SQL for everybody ! This is the original VS Extension.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7

Morty Proxy This is a proxified and sanitized view of the page, visit original site.