tweaks
[mono.git] / doc / tds-providers
1 * Design of the Microsoft SQL Server, Sybase, and TDS Providers in Mono
2
3         <ul>
4                 * After much discussion among the Mono ADO.NET developers,
5                   we have come up with the design of implementing a Sybase and Microsoft 
6                   SQL Server ADO.NET provider.  We have already begun implementing 
7                   this design in Mono.
8
9                 * Since Sybase and Microsoft SQL Server databases both 
10                   use the TDS protocol for data access, and other implementations 
11                   of TDS (FreeTDS and jTDS) have included support for multiple 
12                   versions of the TDS, we have decided to do the same.
13
14                 * The TdsClient ADO.NET provider will be Mono's first provider 
15                   written completely in C# without any dependencies except 
16                   the usual suspects: corlib.dll, System.dll, and System.Xml.dll.
17         </ul>
18
19 * New ADO.NET Providers
20
21 <p>There will be three ADO.NET providers that will use TDS.     
22
23                 <ol>
24                   <li><p>Mono.Data.SybaseClient namepace and assembly will 
25                   hold the ADO.NET provider for Sybase SQL Server database.  
26                   This provider will default to using TDS version 5.0 which 
27                   can only be used with  Sybase.
28
29                   <li><p>System.Data.SqlClient namespace and System.Data assembly 
30                   will hold the ADO.NET provider
31           for Microsoft SQL Server 7.0/2000 databases.  This is to be 
32           compatible with Microsoft .NET
33           This provider will default to using TDS version 7.0 
34           which only supports Microsoft SQL Server 7.0/2000 just like 
35           SqlClient in Microsoft .NET does.  There is TDS version of 8.0 
36           which we will need to support as well, but it is used for 
37           Microsoft SQL Server 2000 databases.
38
39                   <li><p>Mono.Data.TdsClient namespace and assembly is not 
40                   meant to be an ADO.NET provider in Mono, but a means to 
41                   provide generic unit tests for the TDS functionality shared by the SqlClient 
42                   and SybaseClient providers.  This provider will default to 
43                   using TDS version 4.2 which can be used by older Sybase and 
44                   Microsoft SQL Server databases.
45                  </ol>
46
47 * Building The New Providers
48
49  <p> All three providers will use common internal code 
50                 at Mono.Data.TdsClient.Internal.  Any classes in 
51                 Mono.Data.TdsClient.Internal will have the internal 
52                 keyword and will be built with the assembly of that provider.
53                 <ol>
54                 <li><p>SqlClient will build its assembly System.Data using files 
55                   from System.Data, System.Data.SqlClient, System.Data.SqlTypes, 
56                   System.Data.Common, and Mono.Data.TdsClient.Internal.  
57                  
58                   <p>SqlClient 
59                   will only reference the usual
60                   suspects: corlib.dll, System.dll, and System.Xml.dll. SqlClient will be 
61                   a wrapper around TdsClient.Internal, but provide specific functionality to
62                   Microsoft SQL Server 7.0/2000 databases.
63
64                   <p>SqlClient build example:
65
66 <pre>
67  mcs -target:library -out:System.Data.dll \
68    System.Data.SqlClient/*.cs \
69    ..\Mono.Data.TdsClient\Mono.Data.TdsClient.Internal\*.cs \
70    [any other classes in System.Data assembly...]  \
71    -r corlib.dll -r System.dll -r System.Xml.dll
72 </pre>
73
74                 <li><p>SybaseClient will build its assembly Mono.Data.SybaseClient using 
75                   files from Mono.Data.SybaseClient and Mono.Data.TdsClient.Internal.  
76                   SybaseClient will reference
77           the usual suspects plus System.Data.dll  SybaseClient will 
78           be a wrapper around TdsClient.Internal, but provide specific 
79           functionality to Sybase.
80
81                   <p>SybaseClient build example:
82
83 <pre>
84  mcs -target:library -out:Mono.Data.SybaseClient.dll \
85     Mono.Data.SybaseClient\*.cs \
86     ..\Mono.Data.TdsClient\Mono.Data.TdsClient.Internal\*.cs
87     -r corlib.dll -r System.dll -r System.Xml.dll -r System.Data.dll
88 </pre>
89     
90                 <li><p>TdsClient will build its assembly Mono.Data.TdsClient 
91                   using files from Mono.Data.TdsClient
92           and Mono.Data.TdsClient.Internal.  TdsClient will reference the 
93           usual suspects plus System.Data.dll  TdsClient is a wrapper 
94           provider around TdsClient.Internal used for generic
95           unit tests.  TdsClient will a wrapper around TdsClient.Internal 
96           as a generic TDS provider 
97           and allow TDS configuration options not exposed in SqlClient 
98           nor SybaseClient, such as, TdsVersion will be exposed in TdsClient 
99           but not in SqlClient nor SybaseClient.
100
101                  <p>TdsClient build example:
102
103 <pre>
104 mcs -target:library -out:Mono.Data.TdsClient.dll \
105     Mono.Data.TdsClient\*.cs \
106     Mono.Data.TdsClient.Internal\*.cs \
107     -r corlib.dll -r System.dll -r System.Xml.dll -r System.Data.dll
108 </pre>
109                 </ol>
110     
111 * Classes in Mono.Data.TdsClient.Internal will:
112
113         <ul>
114         <li>use the internal keyword to prevent exposing these classes
115           to the System.Data.dll assembly.
116           
117     <li> implement the ADO.NET interfaces just like any other ADO.NET provider, such as,
118           IDbConnection, IDbCommand, IDataReader, IDataRecord, IDataAdapter, etc...
119           
120     <li> be sealed just like other providers
121         
122     <li> provide features to be directly used by the SqlClient and SybaseClient 
123           providers, such
124           as, setting the default TDS version: SqlClient to 7.0 and SybaseClient 
125           to 5.0 and TdsClient to 4.2.
126           
127     <li> be written completely in C# or IL assembly language (if need be).
128         
129     <li> implement the TDS protocol version 4.2, 5.0, 7.0, and 8.0. This 
130           is where most of the
131           work will take place.
132           
133     <li> be an internal ADO.NET provider to the public ADO.NET providers:
134           System.Data.SqlClient, Mono.Data.SybaseClient, and Mono.Data.TdsClient.
135         </ul>
136
137 * Implementation Details of the TDS Protocol
138
139         <ul>
140                 * will be implemented in pure C# from scratch
141                 
142                 * will reside in Mono.Data.TdsClient.Internal  
143                 
144                 * will use FreeTDS and jTDS as rerferences.
145         </ul>
146
147 * More Information
148
149         <ul>
150                 * <a href="http://www.freetds.org/">FreeTDS</a> is C API that implements
151                 the TDS protocol.  Has libraries for tds, ctlib, and dblib.  It builds
152                 and runs on Windows, Linux, and other platforms.  FreeTDS provides
153                 data access to Microsoft SQL Server and Sybase databases. 
154                 
155                 * <a href="http://jtds.sf.net/">jTDS</a> is a 100% Java JDBC provider
156                 for Microsoft SQL Server and Sybase databases.
157                 
158                 * <a href="http://www.freetds.org/tds.html">TDS Protocol</a>
159         </ul>
160
161 * Contribute
162
163         <p>Anybody willing to help?  If so, 
164                 contact any of the people working on the ADO.NET support 
165                 in Mono: Rodrigo Moya, Tim Coleman, Daniel Morgan, Brian Ritchie, 
166                 Vladimir Vukicevic, Ville Palo, Franklin Wise, and others.
167