GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - DirectSQL/DirectSQL: Execute SQL directly from your code !

BranchesTags
Open more actions menu

Latest commit

 

History

287 Commits
287 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
DirectSQL
DirectSQL
 
 
TestSqlLiteDatabase
TestSqlLiteDatabase
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
DirectSQL.code-workspace
DirectSQL.code-workspace
 
 
DirectSQL.sln
DirectSQL.sln
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
_config.yml
_config.yml
 
 
azure-pipelines.yml
azure-pipelines.yml
 
 
global.json
global.json
 
 

Repository files navigation

What is this for ?

Build Status
CodeFactor
Ready on NuGet

Execute SQL directly !

This .NET library is very thin database framework on top of System.Data. In this library, you can use SQL directly without taking care for lifecycle of connection, transaction and so on.

In many database framework, direct execution of SQL is more or less barriered from orthodox. This library resolve issues around that.

Please try 😄.

Where to start

This library prepare corresponding Database class for supporting RDBMS

  • DirectSQL.SqlLite.SqlLiteDatabase (SQLite)
  • DirectSQL.SqlServer.SqlServerDatabase (SQL Server)
  • DirectSQL.npgsql.NpgsqlDatabase (PostgreSQL, CockroachDB)
  • DirectSQL.DB2.DB2Database (DB2)
  • DirectSQL.MySql.MySqlDatabase (MySql)
  • DirectSQL.Odbc.OdbcDatabase (ODBC connected DBMS)

These Database classes are entry point of this library.

Documentation

Documentation is here.

Examples

Example1

public static void example()
{
    SqlLiteDatabase db = new SqlLiteDatabase("connectionString_to_yourdb");
    db.Process((connection) =>
    {
        SqlLiteDatabase.Query(
            "select TEST_VAL1,TEST_VAL2 from TEST_TABLE where TEST_VAL1 = @val1",
            new (String, object)[] {("@val1","abcdef")},
            connection,
            (result) => {
                while (result.Next())
                {
                    var resultValues = result.ResultValues;
                    Console.Out.WriteLine("TEST_VAL1:" + resultValues.TEST_VAL1);
                    Console.Out.WriteLine("TEST_VAL2:" + resultValues.TEST_VAL2);
                }
            }
        );
    });
}

Example2

public static void example2()
{
    SqlLiteDatabase db = new SqlLiteDatabase("connectionString_to_yourdb");
    db.Process((connection) =>
    {
        dynamic[] resultArray =
            SqlLiteDatabase
            .LoadSqlResult(
                "select TEST_COL1,TEST_COL2 from TEST_TABLE",
                connection);
        
        Console.Out.WriteLine("TEST_VAL1:" + resultArray[0].TEST_VAL1);
        Console.Out.WriteLine("TEST_VAL2:" + resultArray[0].TEST_VAL2);
    });
}

Refer code in test project, also

How to build and test

 git clone [email protected]:DirectSQL/DirectSQL.git
 cd DirectSQL
 dotnet build
 dotnet test

About

Execute SQL directly from your code !

Topics

ado-netadonetdatabasedatabase-frameworkdbdotnetdotnet-librarysql

Resources

Readme

Security policy

Security policy
Activity
Custom properties

Stars

15 stars

Watchers

2 watching

Forks

4 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.