v / vlib / mssql
0 issues 1 contributor 4 branches 0 releases
Clone with HTTPS:

About

README
  V 99.7% 272k loc
  JavaScript 0.1% 344 loc
  C 0% 63 loc
  C++ 0% 95 loc
  Go 0% 63 loc
52 years ago
..

SQL Server ODBC

Dependencies

Windows Notes

Using msvc

Using tcc

copy "C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\sql.h" thirdparty\mssql\include
copy "C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\sqlext.h" thirdparty\mssql\include
copy "C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\sqltypes.h" thirdparty\mssql\include
copy "C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\sqlucode.h" thirdparty\mssql\include
copy "C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\sal.h" thirdparty\mssql\include
copy "C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\concurrencysal.h" thirdparty\mssql\include

TODO

Usage

import mssql

fn test_example() ? {
    // connect to server
    config := mssql.Config{
        driver: 'ODBC Driver 17 for SQL Server'
        server: 'tcp:localhost'
        uid: '<your username>'
        pwd: '<your password>'
    }

    mut conn := mssql.Connection{}

    conn.connect(config.get_conn_str())?

    defer {
        conn.close()
    }

    // get current db name
    mut query := 'SELECT DB_NAME()'
    mut res := conn.query(query)?
    assert res == mssql.Result{
        rows: [mssql.Row{
            vals: ['master']
        }]
        num_rows_affected: -1
    }
}