Code Monkey home page Code Monkey logo

tds-nio's Introduction

SwiftTDS (TDS Implementation)

Non-blocking, event-driven Swift implementation of the Tabular Data Stream (TDS) Protocol built on top of SwiftNIO.

This package provides a client implementation of the TDS protocol, with functionality for connecting to, authorizing, and querying instances of Microsoft's SQL Server.

It is currenlty under active development and is an incomplete implementation of the protocol.

tds-nio's People

Contributors

aaronjedwards avatar joannis avatar 3a4ot avatar

Stargazers

Alex Sherbakov avatar Iason Orlandos avatar JeiHO avatar Ben Brook avatar Jordan Anders avatar Fan Jiang avatar Jeff L. avatar Jonathan Hicks avatar Chris avatar LE avatar Neevash Ramdial (Nash) avatar Pavel Usov avatar Richard Jones avatar Shane Burrell avatar Marco Chini avatar Niklas Saers avatar Tim Kersey avatar Max Desiatov avatar  avatar Mikhail Isaev aka iMike avatar  avatar

Watchers

Niklas Saers avatar James Cloos avatar Pavel Usov avatar  avatar Richard Jones avatar  avatar Jordan Anders avatar  avatar

tds-nio's Issues

SQL Server Varchar

I don't seem to be able to get a sensible value for the SQL Server Varchar Data Type.

AField = 'Hello World'. in database

// Swift Code
let afield = rows[0].column("AField")?.string
print("Field Value = (afield!)")

When run
Field Value = 楗摮睯

I noted in the code TDSData+String.swift a Todo label -
// TODO
switch self.metadata.dataType {
case .charLegacy, .varcharLegacy, .char, .varchar, .nvarchar, .nchar, .text, .nText:

If (pretty please), this could be resolved that would be fantastic. I would then have a solution I could use.

Consider depending on Swift Metrics 2.x (whilst still allowing 1.x)

Swift Metrics 2.0 just got released. It is almost completely compatible with Swift Metrics 1.x unless you exhaustively switch on the TimeUnit enum. I would highly recommend depending on swift-metrics like the following:

// swift-metrics 1.x and 2.x are almost API compatible, so most clients should use
.package(url: "https://github.com/apple/swift-metrics.git", "1.0.0" ..< "3.0.0"),

alternatively, from: "2.0.0" will also work but may in the interim cause compatibility issues with packages that specify from: "1.0.0".

If at all possible, this should be done before tagging the next release here. If using "1.0.0" ..< "3.0.0" this isn't even a SemVer major change because 1.x versions are still accepted.

SSL Trust Issue

I'm trying to connect to a SQL Server 2018. I can get it working from sqlcmd but I have to ignore the server's certificate trust.

When using swift-tds, I don't have this ignore certificate trust option, and I get -

error swift-tds : Uncaught error: handshakeFailed(NIOSSL.BoringSSLError.sslError([Error: 268435581 error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED]))

Is it possible we can do something like this -

i.e add an extra parameter on login to ignore certificate
conn.login(username: xxxx,
password: yyyyy,
server:zzzzz, database,
** tlsConfiguration: forClient(certificateVerification: .none)) **


Got the idea from this ---
app.databases.use(.mysql(hostname: host, port: port, username: user, password: pass, database: name, tlsConfiguration: ** forClient(certificateVerification: .none)),** as: .mysql)

Taken from this article -
https://forums.swift.org/t/fluent-connect-mysql-8-failure-how-to-solve/35939/14

[Proposal] Contribution add iOS support and RPC

I've been reviewing your library and I was wondering if you have any contribution guidelines?

I think I could enable iOS support fairly easily with the latest NIO. I also think I could implement RPC which is something I could use for a project I would like to try.

Cheers
Jordan

Basic Protocol Implementation

Basic Protocol Implementation

Below is a high level checklist for tracking the status of the TDS protocol implementation. It will be modified as necessary and may have parts moved to a future milestone as the initial goal is to end up just past the "proof of concept" phase:

Client Messages

  • Pre-Login (Including SSL negotiation)
  • Login
  • Federated Authentication Token
  • SQL Batch (Partially Implemented)
  • Bulk Load
  • Remote Procedure Call
  • Attention
  • Transaction Manager Request

Server Messages

  • Pre-Login Response
  • Login Response
  • Row Data (Partially Implemented)
  • Return Status
  • Return Parameter
  • Response Completion
  • Error and Info
  • Attention Acknowledgement

Token Parsing (Partially Implemented)

  • ALTMETADATA (Deprecated in TDS 7.4)
  • ALTROW (Deprecated in TDS 7.4)
  • COLINFO (TDS 7.4+)
  • COLMETADATA
  • DATACLASSIFICATION
  • DONE
  • DONEINPROC
  • DONEPROC
  • ENVCHANGE
  • ERROR
  • FEATUREEXTACK (TDS 7.4+)
  • FEDAUTHINFO (TDS 7.4+)
  • INFO
  • LOGINACK
  • NBCROW (TDS 7.3.B+)
  • OFFSET (Removed in TDS 7.2)
  • ORDER
  • RETURNSTATUS
  • RETURNVALUE
  • ROW
  • SESSIONSTATE
  • SSPI
  • TABNAME
  • TVP_ROW

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.