2002-10-16 Daniel Morgan <danmorg@sc.rr.com>
authorDaniel Morgan <monodanmorg@yahoo.com>
Wed, 16 Oct 2002 19:42:16 +0000 (19:42 -0000)
committerDaniel Morgan <monodanmorg@yahoo.com>
Wed, 16 Oct 2002 19:42:16 +0000 (19:42 -0000)
* ParmUtil.cs
* PostgresLibrary.cs
* PostgresTypes.cs
* SqlClientPermission.cs
* SqlClientPermissionAttribute.cs
* SqlCommand.cs
* SqlCommandBuilder.cs
* SqlConnection.cs
* SqlDataAdapter.cs
* SqlDataReader.cs
* SqlError.cs
* SqlErrorCollection.cs
* SqlException.cs
* SqlInfoMessageEventArgs.cs
* SqlInfoMessageEventHandler.cs
* SqlParameter.cs
* SqlParameterCollection.cs
* SqlRowUpdatedEventArgs.cs
* SqlRowUpdatedEventHandler.cs
* SqlRowUpdatingEventArgs.cs
* SqlRowUpdatingEventHandler.cs
* SqlTransaction.cs: thanks to Miguel, he copied
files on the mono cvs server
from mcs/class/System.Data/System.Data.SqlClient
for the PostgreSQL provider
to mcs/class/Mono.Data.PostgreSqlClient.
This frees up
mcs/class/System.Data/System.Data.SqlClient for
the Microsoft SQL Server provider.
Any Mono.Data.PostgreSqlClient/Sql*.cs files
were copied on the cvs server
to Mono.Data.PostgreSqlClient/PgSql*.cs files
and the old Mono.Data.PostgreSqlClient/Sql*.cs
files were removed.  Copying, renaming, and removing
was done on the server so we could keep
the cvs change history.

* ChangeLog: added this file for logging changes

* Mono.Data.PostgreSqlClient.build: added file for Windows build

* library-deps.stamp
* list
* makefile.gnu: added for Linux build

* Locale.cs: added file for Locale.GetText(string);

* TODOAttribute.cs: added file for [MonoTODO] attribute

svn path=/trunk/mcs/; revision=8321

53 files changed:
mcs/class/Mono.Data.PostgreSqlClient/ChangeLog [new file with mode: 0644]
mcs/class/Mono.Data.PostgreSqlClient/Locale.cs [new file with mode: 0644]
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient.build [new file with mode: 0644]
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/Locale.cs [new file with mode: 0644]
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/ParmUtil.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlClientPermission.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlClientPermissionAttribute.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlCommand.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlCommandBuilder.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlConnection.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlDataAdapter.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlDataReader.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlError.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlErrorCollection.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlException.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlInfoMessageEventArgs.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlInfoMessageEventHandler.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlParameter.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlParameterCollection.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlRowUpdatedEventArgs.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlRowUpdatedEventHandler.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlRowUpdatingEventArgs.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlRowUpdatingEventHandler.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlTransaction.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PostgresLibrary.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PostgresTypes.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/TODOAttribute.cs [new file with mode: 0644]
mcs/class/Mono.Data.PostgreSqlClient/ParmUtil.cs
mcs/class/Mono.Data.PostgreSqlClient/PgSqlClientPermission.cs
mcs/class/Mono.Data.PostgreSqlClient/PgSqlClientPermissionAttribute.cs
mcs/class/Mono.Data.PostgreSqlClient/PgSqlCommand.cs
mcs/class/Mono.Data.PostgreSqlClient/PgSqlCommandBuilder.cs
mcs/class/Mono.Data.PostgreSqlClient/PgSqlConnection.cs
mcs/class/Mono.Data.PostgreSqlClient/PgSqlDataAdapter.cs
mcs/class/Mono.Data.PostgreSqlClient/PgSqlDataReader.cs
mcs/class/Mono.Data.PostgreSqlClient/PgSqlError.cs
mcs/class/Mono.Data.PostgreSqlClient/PgSqlErrorCollection.cs
mcs/class/Mono.Data.PostgreSqlClient/PgSqlException.cs
mcs/class/Mono.Data.PostgreSqlClient/PgSqlInfoMessageEventArgs.cs
mcs/class/Mono.Data.PostgreSqlClient/PgSqlInfoMessageEventHandler.cs
mcs/class/Mono.Data.PostgreSqlClient/PgSqlParameter.cs
mcs/class/Mono.Data.PostgreSqlClient/PgSqlParameterCollection.cs
mcs/class/Mono.Data.PostgreSqlClient/PgSqlRowUpdatedEventArgs.cs
mcs/class/Mono.Data.PostgreSqlClient/PgSqlRowUpdatedEventHandler.cs
mcs/class/Mono.Data.PostgreSqlClient/PgSqlRowUpdatingEventArgs.cs
mcs/class/Mono.Data.PostgreSqlClient/PgSqlRowUpdatingEventHandler.cs
mcs/class/Mono.Data.PostgreSqlClient/PgSqlTransaction.cs
mcs/class/Mono.Data.PostgreSqlClient/PostgresLibrary.cs
mcs/class/Mono.Data.PostgreSqlClient/PostgresTypes.cs
mcs/class/Mono.Data.PostgreSqlClient/TODOAttribute.cs [new file with mode: 0644]
mcs/class/Mono.Data.PostgreSqlClient/library-deps.stamp [new file with mode: 0644]
mcs/class/Mono.Data.PostgreSqlClient/list [new file with mode: 0644]
mcs/class/Mono.Data.PostgreSqlClient/makefile.gnu [new file with mode: 0644]

diff --git a/mcs/class/Mono.Data.PostgreSqlClient/ChangeLog b/mcs/class/Mono.Data.PostgreSqlClient/ChangeLog
new file mode 100644 (file)
index 0000000..6b6258f
--- /dev/null
@@ -0,0 +1,50 @@
+2002-10-16  Daniel Morgan <danmorg@sc.rr.com>\r
+\r
+       * ParmUtil.cs\r
+       * PostgresLibrary.cs\r
+       * PostgresTypes.cs\r
+       * SqlClientPermission.cs\r
+       * SqlClientPermissionAttribute.cs\r
+       * SqlCommand.cs\r
+       * SqlCommandBuilder.cs\r
+       * SqlConnection.cs\r
+       * SqlDataAdapter.cs\r
+       * SqlDataReader.cs\r
+       * SqlError.cs\r
+       * SqlErrorCollection.cs\r
+       * SqlException.cs\r
+       * SqlInfoMessageEventArgs.cs\r
+       * SqlInfoMessageEventHandler.cs\r
+       * SqlParameter.cs\r
+       * SqlParameterCollection.cs\r
+       * SqlRowUpdatedEventArgs.cs\r
+       * SqlRowUpdatedEventHandler.cs\r
+       * SqlRowUpdatingEventArgs.cs\r
+       * SqlRowUpdatingEventHandler.cs\r
+       * SqlTransaction.cs: thanks to Miguel, he copied \r
+       files on the mono cvs server\r
+       from mcs/class/System.Data/System.Data.SqlClient \r
+       for the PostgreSQL provider\r
+       to mcs/class/Mono.Data.PostgreSqlClient.  \r
+       This frees up\r
+       mcs/class/System.Data/System.Data.SqlClient for \r
+       the Microsoft SQL Server provider.  \r
+       Any Mono.Data.PostgreSqlClient/Sql*.cs files\r
+       were copied on the cvs server \r
+       to Mono.Data.PostgreSqlClient/PgSql*.cs files \r
+       and the old Mono.Data.PostgreSqlClient/Sql*.cs\r
+       files were removed.  Copying, renaming, and removing\r
+       was done on the server so we could keep \r
+       the cvs change history.\r
+\r
+       * ChangeLog: added this file for logging changes\r
+       \r
+       * Mono.Data.PostgreSqlClient.build: added file for Windows build\r
+\r
+       * library-deps.stamp    \r
+       * list\r
+       * makefile.gnu: added for Linux build\r
+       
+       * Locale.cs: added file for Locale.GetText(string);
+               
+       * TODOAttribute.cs: added file for [MonoTODO] attribute
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Locale.cs b/mcs/class/Mono.Data.PostgreSqlClient/Locale.cs
new file mode 100644 (file)
index 0000000..539184d
--- /dev/null
@@ -0,0 +1,22 @@
+//
+// System.Globalization.Locale.cs
+//
+// Author:
+//   Miguel de Icaza (miguel@ximian.com)
+//
+// (C) 2001 Ximian, Inc (http://www.ximian.com)
+//
+
+namespace System.Globalization {
+
+       internal class Locale {
+
+               /// <summary>
+               ///   Returns the translated message for the current locale
+               /// </summary>
+               public static string GetText (string msg)
+               {
+                       return msg;
+               }
+       }
+}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient.build b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient.build
new file mode 100644 (file)
index 0000000..727df3b
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="iso-8859-1"?>\r
+\r
+<!-- NAnt build file for Mono.Data.PostgreSqlClient.dll -->\r
+\r
+<project name="Mono.Data.PostgreSqlClient" default="build">\r
+       <property name="debug" value="false"/>\r
+\r
+       <target name="build">\r
+               <csc target="library" output="../lib/Mono.Data.PostgreSqlClient.dll" debug="${debug}">\r
+                       <arg value="/nowarn:1595"/>\r
+                       <arg value="/nowarn:0067"/>\r
+                       <arg value="/nowarn:0109"/>\r
+                       <arg value="/nowarn:0169"/>\r
+                       <arg value="/nowarn:0649"/>\r
+                       <arg value="/unsafe"/>\r
+                       <arg value="/noconfig"/>\r
+                       <arg value="/r:System.dll"/>\r
+                       <arg value="/r:System.Xml.dll"/>\r
+                       <arg value="/r:System.Data.dll"/>\r
+                       <sources>\r
+                               <includes name="**/*.cs"/> \r
+                               <excludes name="Test/**"/>\r
+                               \r
+                       </sources>\r
+                       <references>\r
+                               <includes name="../lib/corlib.dll"/>\r
+                               <includes name="../lib/System.dll"/>\r
+                               <includes name="../lib/System.Xml.dll"/>\r
+                               <includes name="../lib/System.Data.dll"/>\r
+                       </references>\r
+               </csc>\r
+               <copy file="../lib/System.Data.dll" tofile="Test/System.Data.dll"/>\r
+               <copy file="../lib/Mono.Data.PostgreSqlClient.dll" tofile="Test/Mono.Data.PostgreSqlClient.dll"/>\r
+               <copy file="../lib/Mono.Data.PostgreSqlClient.dll" tofile="Mono.Data.PostgreSqlClient.dll"/>\r
+               <copy file="../lib/Mono.Data.PostgreSqlClient.dll" tofile="../System.Data/Test/Mono.Data.PostgreSqlClient.dll"/>\r
+       </target>\r
+       <target name="test" depends="build">\r
+               <nant basedir="Test" target="test"/>\r
+       </target>\r
+       <target name="clean">\r
+               <delete file="Test/System.Data.dll" failonerror="false"/>\r
+               <delete file="../lib/Mono.Data.PostgreSqlClient.dll" failonerror="false"/>\r
+               <delete file="Test/Mono.Data.PostgreSqlClient.dll" failonerror="false"/>\r
+\r
+       </target>\r
+</project>\r
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/Locale.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/Locale.cs
new file mode 100644 (file)
index 0000000..539184d
--- /dev/null
@@ -0,0 +1,22 @@
+//
+// System.Globalization.Locale.cs
+//
+// Author:
+//   Miguel de Icaza (miguel@ximian.com)
+//
+// (C) 2001 Ximian, Inc (http://www.ximian.com)
+//
+
+namespace System.Globalization {
+
+       internal class Locale {
+
+               /// <summary>
+               ///   Returns the translated message for the current locale
+               /// </summary>
+               public static string GetText (string msg)
+               {
+                       return msg;
+               }
+       }
+}
index 3dabac7853ee51bab2d68263b46b494e6381e219..beb3537f937874affe1ff390ec1f8548255731b5 100644 (file)
@@ -15,7 +15,7 @@ using System;
 using System.Data;\r
 using System.Text;\r
 \r
-namespace System.Data.SqlClient {\r
+namespace Mono.Data.PostgreSqlClient {\r
 \r
        enum PostgresBindVariableCharacter {\r
                Semicolon,\r
@@ -27,7 +27,7 @@ namespace System.Data.SqlClient {
 \r
                private string sql = "";\r
                private string resultSql = "";\r
-               private SqlParameterCollection parmsCollection = null;\r
+               private PgSqlParameterCollection parmsCollection = null;\r
                \r
                static private PostgresBindVariableCharacter PgbindChar = PostgresBindVariableCharacter.Semicolon;\r
                static char bindChar;\r
@@ -49,7 +49,7 @@ namespace System.Data.SqlClient {
                        }\r
                }\r
                                \r
-               public ParmUtil(string query, SqlParameterCollection parms) {\r
+               public ParmUtil(string query, PgSqlParameterCollection parms) {\r
                        sql = query;\r
                        parmsCollection = parms;\r
                }\r
@@ -150,7 +150,7 @@ namespace System.Data.SqlClient {
 #if DEBUG_ParmUtil\r
                                Console.WriteLine("Parameter Found: " + p);\r
 #endif\r
-                               SqlParameter prm = parmsCollection[p];\r
+                               PgSqlParameter prm = parmsCollection[p];\r
 \r
 #if DEBUG_ParmUtil                                                                                                                                     \r
                                // DEBUG \r
index 20b9e02a6d0d63446752c9c077354816abdc037d..8ef58881165e48bac6bb165a87febf899bf59efe 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlClientPermission.cs
+// Mono.Data.PostgreSqlClient.PgSqlClientPermission.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -14,22 +14,22 @@ using System.Data.Common;
 using System.Security;
 using System.Security.Permissions;
 
-namespace System.Data.SqlClient {
+namespace Mono.Data.PostgreSqlClient {
 
-       public sealed class SqlClientPermission : DBDataPermission {
+       public sealed class PgSqlClientPermission : DBDataPermission {
                
                [MonoTODO]
-               public SqlClientPermission() {
+               public PgSqlClientPermission() {
                        // FIXME: do constructor
                }
 
                [MonoTODO]
-               public SqlClientPermission(PermissionState state) {
+               public PgSqlClientPermission(PermissionState state) {
                        // FIXME: do constructor
                }
 
                [MonoTODO]
-               public SqlClientPermission(PermissionState state,
+               public PgSqlClientPermission(PermissionState state,
                        bool allowBlankPassword) { 
                        throw new NotImplementedException ();
                }
@@ -71,7 +71,7 @@ namespace System.Data.SqlClient {
                }
 
                [MonoTODO]
-               ~SqlClientPermission() {
+               ~PgSqlClientPermission() {
                        // FIXME: destructor to release resources
                }
        }
index 149613c5f2ecbb39d1939db5a66b2978afb5bb50..6c9f5b126db1485383918eebdf449288e1307d6e 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlClientPermissionAttribute.cs
+// Mono.Data.PostgreSqlClient.PgSqlClientPermissionAttribute.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -14,7 +14,7 @@ using System.Data.Common;
 using System.Security;
 using System.Security.Permissions;
 
-namespace System.Data.SqlClient {
+namespace Mono.Data.PostgreSqlClient {
 
        [AttributeUsage(AttributeTargets.Assembly    | 
                        AttributeTargets.Class       | 
@@ -22,11 +22,11 @@ namespace System.Data.SqlClient {
                        AttributeTargets.Constructor |
                        AttributeTargets.Method)]
        [Serializable]
-       public sealed class SqlClientPermissionAttribute :
+       public sealed class PgSqlClientPermissionAttribute :
                DBDataPermissionAttribute {
 
                [MonoTODO]
-               public SqlClientPermissionAttribute(SecurityAction action) : 
+               public PgSqlClientPermissionAttribute(SecurityAction action) : 
                        base(action)
                {
                        // FIXME: do constructor
@@ -38,7 +38,7 @@ namespace System.Data.SqlClient {
                }
 
                //[MonoTODO]
-               //~SqlClientPermissionAttribute() {
+               //~PgSqlClientPermissionAttribute() {
                //      // FIXME: destructor to release resources
                //}
        }
index 92e1d1d5e63e11799085027c0b8fea8130ceb975..6fd7926d1e898d9fe87f683a50ae0e559028b54b 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlCommand.cs
+// Mono.Data.PostgreSqlClient.PgSqlCommand.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -33,13 +33,13 @@ using System.Runtime.InteropServices;
 using System.Text;
 using System.Xml;
 
-namespace System.Data.SqlClient {
+namespace Mono.Data.PostgreSqlClient {
        /// <summary>
        /// Represents a SQL statement that is executed 
        /// while connected to a SQL database.
        /// </summary>
-       // public sealed class SqlCommand : Component, IDbCommand, ICloneable
-       public sealed class SqlCommand : IDbCommand {
+       // public sealed class PgSqlCommand : Component, IDbCommand, ICloneable
+       public sealed class PgSqlCommand : IDbCommand {
 
                #region Fields
 
@@ -48,15 +48,15 @@ namespace System.Data.SqlClient {
                // default is 30 seconds 
                // for command execution
 
-               private SqlConnection conn = null;
-               private SqlTransaction trans = null;
+               private PgSqlConnection conn = null;
+               private PgSqlTransaction trans = null;
                private CommandType cmdType = CommandType.Text;
                private bool designTime = false;
-               private SqlParameterCollection parmCollection = new 
-                       SqlParameterCollection();
+               private PgSqlParameterCollection parmCollection = new 
+                       PgSqlParameterCollection();
 
-               // SqlDataReader state data for ExecuteReader()
-               private SqlDataReader dataReader = null;
+               // PgSqlDataReader state data for ExecuteReader()
+               private PgSqlDataReader dataReader = null;
                private string[] queries = null;
                private int currentQuery = -1;
                private CommandBehavior cmdBehavior = CommandBehavior.Default;
@@ -67,21 +67,21 @@ namespace System.Data.SqlClient {
 
                #region Constructors
 
-               public SqlCommand() {
+               public PgSqlCommand() {
                        sql = "";
                }
 
-               public SqlCommand (string cmdText) {
+               public PgSqlCommand (string cmdText) {
                        sql = cmdText;
                }
 
-               public SqlCommand (string cmdText, SqlConnection connection) {
+               public PgSqlCommand (string cmdText, PgSqlConnection connection) {
                        sql = cmdText;
                        conn = connection;
                }
 
-               public SqlCommand (string cmdText, SqlConnection connection, 
-                       SqlTransaction transaction) {
+               public PgSqlCommand (string cmdText, PgSqlConnection connection, 
+                       PgSqlTransaction transaction) {
                        sql = cmdText;
                        conn = connection;
                        trans = transaction;
@@ -104,8 +104,8 @@ namespace System.Data.SqlClient {
                }
 
                [MonoTODO]
-               public SqlParameter CreateParameter () {
-                       return new SqlParameter ();
+               public PgSqlParameter CreateParameter () {
+                       return new PgSqlParameter ();
                }
 
                public int ExecuteNonQuery () { 
@@ -160,7 +160,7 @@ namespace System.Data.SqlClient {
                                PostgresLibrary.PQclear (pgResult);
                                pgResult = IntPtr.Zero;
 \r
-                               throw new SqlException(0, 0,
+                               throw new PgSqlException(0, 0,
                                        errorMessage, 0, "",
                                        conn.DataSource, "SqlCommand", 0);\r
                        }
@@ -174,7 +174,7 @@ namespace System.Data.SqlClient {
                }
 
                [MonoTODO]
-               public SqlDataReader ExecuteReader () {
+               public PgSqlDataReader ExecuteReader () {
                        return ExecuteReader(CommandBehavior.Default);
                }
 
@@ -185,7 +185,7 @@ namespace System.Data.SqlClient {
                }
 
                [MonoTODO]
-               public SqlDataReader ExecuteReader (CommandBehavior behavior) 
+               public PgSqlDataReader ExecuteReader (CommandBehavior behavior) 
                {
                        if(conn.State != ConnectionState.Open)
                                throw new InvalidOperationException(
@@ -195,7 +195,7 @@ namespace System.Data.SqlClient {
 
                        queries = null;
                        currentQuery = -1;
-                       dataReader = new SqlDataReader(this);
+                       dataReader = new PgSqlDataReader(this);
 
                        queries = sql.Split(new Char[] {';'});                  
 
@@ -204,9 +204,9 @@ namespace System.Data.SqlClient {
                        return dataReader;
                }
 
-               internal SqlResult NextResult() 
+               internal PgSqlResult NextResult() 
                {
-                       SqlResult res = new SqlResult();
+                       PgSqlResult res = new PgSqlResult();
                        res.Connection = this.Connection;
                        res.Behavior = cmdBehavior;
                        string statement;
@@ -293,7 +293,7 @@ namespace System.Data.SqlClient {
                        return statement;
                }
 
-               private void ExecuteQuery (string query, SqlResult res)
+               private void ExecuteQuery (string query, PgSqlResult res)
                {                       
                        IntPtr pgResult;
                
@@ -336,7 +336,7 @@ namespace System.Data.SqlClient {
                                PostgresLibrary.PQclear (pgResult);
                                pgResult = IntPtr.Zero;
 \r
-                               throw new SqlException(0, 0,
+                               throw new PgSqlException(0, 0,
                                        errorMessage, 0, "",
                                        conn.DataSource, "SqlCommand", 0);\r
                        }
@@ -360,7 +360,7 @@ namespace System.Data.SqlClient {
 
                // only meant to be used between SqlConnectioin,
                // SqlCommand, and SqlDataReader
-               internal void OpenReader(SqlDataReader reader) {
+               internal void OpenReader(PgSqlDataReader reader) {
                        conn.OpenReader(reader);
                }
 
@@ -483,7 +483,7 @@ namespace System.Data.SqlClient {
                                PostgresLibrary.PQclear (pgResult);
                                pgResult = IntPtr.Zero;
 \r
-                               throw new SqlException(0, 0,
+                               throw new PgSqlException(0, 0,
                                        errorMessage, 0, "",
                                        conn.DataSource, "SqlCommand", 0);\r
                        }
@@ -503,7 +503,7 @@ namespace System.Data.SqlClient {
                }
 
                [MonoTODO]
-               public SqlCommand Clone () {
+               public PgSqlCommand Clone () {
                        throw new NotImplementedException ();
                }
 
@@ -558,7 +558,7 @@ namespace System.Data.SqlClient {
                                // transaction in progress
 
                                // csc
-                               Connection = (SqlConnection) value; 
+                               Connection = (PgSqlConnection) value; 
                                // mcs
                                // Connection = value; 
                                
@@ -566,7 +566,7 @@ namespace System.Data.SqlClient {
                        }
                }
                
-               public SqlConnection Connection {
+               public PgSqlConnection Connection {
                        get { 
                                // conn defaults to null
                                return conn;
@@ -599,7 +599,7 @@ namespace System.Data.SqlClient {
                        }
                }
 
-               public SqlParameterCollection Parameters {
+               public PgSqlParameterCollection Parameters {
                        get { 
                                return parmCollection;
                        }
@@ -618,13 +618,13 @@ namespace System.Data.SqlClient {
                                // has already begun
 
                                // csc
-                               Transaction = (SqlTransaction) value;
+                               Transaction = (PgSqlTransaction) value;
                                // mcs
                                // Transaction = value; 
                        }
                }
 
-               public SqlTransaction Transaction {
+               public PgSqlTransaction Transaction {
                        get { 
                                return trans; 
                        }
@@ -662,7 +662,7 @@ namespace System.Data.SqlClient {
                }
 
                [MonoTODO]
-               ~SqlCommand() {
+               ~PgSqlCommand() {
                        // FIXME: need proper way to release resources
                        // Dispose(false);
                }
@@ -672,7 +672,7 @@ namespace System.Data.SqlClient {
 
        // SqlResult is used for passing Result Set data 
        // from SqlCommand to SqlDataReader
-       internal class SqlResult {
+       internal class PgSqlResult {
 
                private DataTable dataTableSchema = null; // only will contain the schema
                private IntPtr pg_result = IntPtr.Zero; // native PostgreSQL PGresult
@@ -680,7 +680,7 @@ namespace System.Data.SqlClient {
                private int fieldCount = 0;
                private string[] pgtypes = null; // PostgreSQL types (typname)
                private bool resultReturned = false;
-               private SqlConnection con = null;
+               private PgSqlConnection con = null;
                private int rowsAffected = -1;
                private ExecStatusType execStatus = ExecStatusType.PGRES_FATAL_ERROR;
                private int currentQuery = -1;
@@ -725,7 +725,7 @@ namespace System.Data.SqlClient {
 
                }
 
-               internal SqlConnection Connection {
+               internal PgSqlConnection Connection {
                        get {
                                return con;
                        }
index d2b028bc652399acda1325cc6b9228e1b0f0a309..ddd6c1267540059913c48d82017e87ba08d6dade 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlCommandBuilder.cs
+// Mono.Data.PostgreSqlClient.PgSqlCommandBuilder.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -12,27 +12,27 @@ using System;
 using System.Data;
 using System.ComponentModel;
 
-namespace System.Data.SqlClient {\r
+namespace Mono.Data.PostgreSqlClient {\r
 \r
        /// <summary>\r
        /// Builder of one command\r
        /// that will be used in manipulating a table for\r
        /// a DataSet that is assoicated with a database.\r
        /// </summary>\r
-       public sealed class SqlCommandBuilder : Component {\r
+       public sealed class PgSqlCommandBuilder : Component {\r
                \r
                [MonoTODO]\r
-               public SqlCommandBuilder() {\r
+               public PgSqlCommandBuilder() {\r
 \r
                }\r
 \r
                [MonoTODO]\r
-               public SqlCommandBuilder(SqlDataAdapter adapter) {\r
+               public PgSqlCommandBuilder(PgSqlDataAdapter adapter) {\r
                \r
                }\r
 \r
                [MonoTODO]\r
-               public SqlDataAdapter DataAdapter {\r
+               public PgSqlDataAdapter DataAdapter {\r
                        get {\r
                                throw new NotImplementedException ();\r
                        }\r
@@ -65,22 +65,22 @@ namespace System.Data.SqlClient {
                }\r
 \r
                [MonoTODO]\r
-               public static void DeriveParameters(SqlCommand command) {\r
+               public static void DeriveParameters(PgSqlCommand command) {\r
                        throw new NotImplementedException ();\r
                }\r
 \r
                [MonoTODO]\r
-               public SqlCommand GetDeleteCommand() {\r
+               public PgSqlCommand GetDeleteCommand() {\r
                        throw new NotImplementedException ();\r
                }\r
 \r
                [MonoTODO]\r
-               public SqlCommand GetInsertCommand() {\r
+               public PgSqlCommand GetInsertCommand() {\r
                        throw new NotImplementedException ();\r
                }\r
 \r
                [MonoTODO]\r
-               public SqlCommand GetUpdateCommand() {\r
+               public PgSqlCommand GetUpdateCommand() {\r
                        throw new NotImplementedException ();\r
                }\r
 \r
@@ -95,7 +95,7 @@ namespace System.Data.SqlClient {
                }\r
 \r
                [MonoTODO]\r
-               ~SqlCommandBuilder() {\r
+               ~PgSqlCommandBuilder() {\r
                        // FIXME: create destructor - release resources\r
                }\r
        }\r
index f3c4df7be716371711d8745401464d1819da4f9d..a306a701e5103e336d3950c04f6b62f9997c1d6d 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlConnection.cs
+// Mono.Data.PostgreSqlClient.PgSqlConnection.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -30,12 +30,12 @@ using System.Data.Common;
 using System.Runtime.InteropServices;
 using System.Text;
 
-namespace System.Data.SqlClient {
+namespace Mono.Data.PostgreSqlClient {
 
        /// <summary>
        /// Represents an open connection to a SQL data source
        /// </summary>
-       public sealed class SqlConnection : Component, IDbConnection,
+       public sealed class PgSqlConnection : Component, IDbConnection,
                ICloneable      
        {
                // FIXME: Need to implement class Component, \r
@@ -51,7 +51,7 @@ namespace System.Data.SqlClient {
                // OLE DB Connection String
                private string pgConnectionString = ""; 
                // PostgreSQL Connection String
-               private SqlTransaction trans = null;
+               private PgSqlTransaction trans = null;
                private int connectionTimeout = 15;     
                // default for 15 seconds
                
@@ -85,7 +85,7 @@ namespace System.Data.SqlClient {
                private ConnectionState conState = ConnectionState.Closed;
                
                // DataReader state
-               private SqlDataReader rdr = null;
+               private PgSqlDataReader rdr = null;
                private bool dataReaderOpen = false;
                // FIXME: if true, throw an exception if SqlConnection 
                //        is used for anything other than reading
@@ -101,12 +101,12 @@ namespace System.Data.SqlClient {
 
                // A lot of the defaults were initialized in the Fields
                [MonoTODO]
-               public SqlConnection () {
+               public PgSqlConnection () {
 
                }
        
                [MonoTODO]
-               public SqlConnection (String connectionString) {
+               public PgSqlConnection (String connectionString) {
                        SetConnectionString (connectionString);
                }
 
@@ -133,7 +133,7 @@ namespace System.Data.SqlClient {
                // aka Finalize()
                // [ClassInterface(ClassInterfaceType.AutoDual)]
                [MonoTODO]
-               ~SqlConnection() {
+               ~PgSqlConnection() {
                        Dispose (false);
                }
                
@@ -145,7 +145,7 @@ namespace System.Data.SqlClient {
                        return BeginTransaction ();
                }
 
-               public SqlTransaction BeginTransaction () {
+               public PgSqlTransaction BeginTransaction () {
                        return TransactionBegin (); // call private method
                }
 
@@ -154,19 +154,19 @@ namespace System.Data.SqlClient {
                        return BeginTransaction (il);
                }
 
-               public SqlTransaction BeginTransaction (IsolationLevel il) {
+               public PgSqlTransaction BeginTransaction (IsolationLevel il) {
                        return TransactionBegin (il); // call private method
                }
 
                // PostgreSQL does not support named transactions/savepoint
                //            nor nested transactions
                [Obsolete]
-               public SqlTransaction BeginTransaction(string transactionName) {
+               public PgSqlTransaction BeginTransaction(string transactionName) {
                        return TransactionBegin (); // call private method
                }
 
                [Obsolete]
-               public SqlTransaction BeginTransaction(IsolationLevel iso,\r
+               public PgSqlTransaction BeginTransaction(IsolationLevel iso,\r
                        string transactionName) {
                        return TransactionBegin (iso); // call private method
                }
@@ -195,8 +195,8 @@ namespace System.Data.SqlClient {
                        return CreateCommand ();
                }
 
-               public SqlCommand CreateCommand () {
-                       SqlCommand sqlcmd = new SqlCommand ("", this);
+               public PgSqlCommand CreateCommand () {
+                       PgSqlCommand sqlcmd = new PgSqlCommand ("", this);
 
                        return sqlcmd;
                }
@@ -235,7 +235,7 @@ namespace System.Data.SqlClient {
                                        PQerrorMessage (pgConn);
                                errorMessage += ": Could not connect to database.";
 
-                               throw new SqlException(0, 0,
+                               throw new PgSqlException(0, 0,
                                        errorMessage, 0, "",
                                        host, "SqlConnection", 0);
                        }
@@ -249,7 +249,7 @@ namespace System.Data.SqlClient {
                // from doing anything while
                // SqlDataReader is open.
                // Open the Reader. (called from SqlCommand)
-               internal void OpenReader(SqlDataReader reader) 
+               internal void OpenReader(PgSqlDataReader reader) 
                {       
                        if(dataReaderOpen == true) {
                                // TODO: throw exception here?
@@ -298,7 +298,7 @@ namespace System.Data.SqlClient {
 
                private string GetDatabaseServerVersion() 
                {
-                       SqlCommand cmd = new SqlCommand("select version()",this);
+                       PgSqlCommand cmd = new PgSqlCommand("select version()",this);
                        return (string) cmd.ExecuteScalar();
                }
 
@@ -451,10 +451,10 @@ namespace System.Data.SqlClient {
                        return addParm;
                }
 
-               private SqlTransaction TransactionBegin () {
+               private PgSqlTransaction TransactionBegin () {
                        // FIXME: need to keep track of 
                        // transaction in-progress
-                       trans = new SqlTransaction ();
+                       trans = new PgSqlTransaction ();
                        // using internal methods of SqlTransaction
                        trans.SetConnection (this);
                        trans.Begin();
@@ -462,10 +462,10 @@ namespace System.Data.SqlClient {
                        return trans;
                }
 
-               private SqlTransaction TransactionBegin (IsolationLevel il) {
+               private PgSqlTransaction TransactionBegin (IsolationLevel il) {
                        // FIXME: need to keep track of 
                        // transaction in-progress
-                       trans = new SqlTransaction ();
+                       trans = new PgSqlTransaction ();
                        // using internal methods of SqlTransaction
                        trans.SetConnection (this);
                        trans.SetIsolationLevel (il);
@@ -531,7 +531,7 @@ namespace System.Data.SqlClient {
                // For System.Data.SqlClient classes
                // to get the current transaction
                // in progress - if any
-               internal SqlTransaction Transaction {
+               internal PgSqlTransaction Transaction {
                        get {
                                return trans;
                        }
@@ -569,7 +569,7 @@ namespace System.Data.SqlClient {
                #region Events
                 
                public event 
-               SqlInfoMessageEventHandler InfoMessage;
+               PgSqlInfoMessageEventHandler InfoMessage;
 
                public event 
                StateChangeEventHandler StateChange;
@@ -585,7 +585,7 @@ namespace System.Data.SqlClient {
 
                        private Hashtable hashTypes;
                        private ArrayList pgTypes;
-                       private SqlConnection con;
+                       private PgSqlConnection con;
 
                        // Got this SQL with the permission from 
                        // the authors of libgda
@@ -597,7 +597,7 @@ namespace System.Data.SqlClient {
                                "'smgr', 'tid', 'unknown', 'xid') " +
                                "ORDER BY typname";
 
-                       internal PostgresTypes(SqlConnection sqlcon) {
+                       internal PostgresTypes(PgSqlConnection sqlcon) {
                                
                                con = sqlcon;
                                hashTypes = new Hashtable();
@@ -667,7 +667,7 @@ namespace System.Data.SqlClient {
                                        PQexec (con.PostgresConnection, SEL_SQL_GetTypes);
 
                                if(pgResult.Equals(IntPtr.Zero)) {
-                                       throw new SqlException(0, 0,
+                                       throw new PgSqlException(0, 0,
                                                "No Resultset from PostgreSQL", 0, "",
                                                con.DataSource, "SqlConnection", 0);
                                }
@@ -706,7 +706,7 @@ namespace System.Data.SqlClient {
                                                PostgresLibrary.PQclear (pgResult);
                                                pgResult = IntPtr.Zero;
 \r
-                                               throw new SqlException(0, 0,
+                                               throw new PgSqlException(0, 0,
                                                        errorMessage, 0, "",
                                                        con.DataSource, "SqlConnection", 0);\r
                                        }
index 526f8f368183f2d10bcf90eadcbd972d9670b538..aee4ceee59d2b713e70f7423c5060bc2cc249a49 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlDataAdapter.cs
+// Mono.Data.PostgreSqlClient.PgSqlDataAdapter.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -15,21 +15,21 @@ using System.ComponentModel;
 using System.Data;
 using System.Data.Common;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
        /// <summary>
        /// Represents a set of command-related properties that are used 
        /// to fill the DataSet and update a data source, all this 
        /// from a SQL database.
        /// </summary>
-       public sealed class SqlDataAdapter : DbDataAdapter, IDbDataAdapter 
+       public sealed class PgSqlDataAdapter : DbDataAdapter, IDbDataAdapter 
        {
                #region Fields
        
-               SqlCommand deleteCommand;
-               SqlCommand insertCommand;
-               SqlCommand selectCommand;
-               SqlCommand updateCommand;
+               PgSqlCommand deleteCommand;
+               PgSqlCommand insertCommand;
+               PgSqlCommand selectCommand;
+               PgSqlCommand updateCommand;
 
                static readonly object EventRowUpdated = new object(); 
                static readonly object EventRowUpdating = new object(); 
@@ -38,26 +38,26 @@ namespace System.Data.SqlClient
 
                #region Constructors
                
-               public SqlDataAdapter ()        
-                       : this (new SqlCommand ())
+               public PgSqlDataAdapter ()      
+                       : this (new PgSqlCommand ())
                {
                }
 
-               public SqlDataAdapter (SqlCommand selectCommand) 
+               public PgSqlDataAdapter (PgSqlCommand selectCommand) 
                {
-                       DeleteCommand = new SqlCommand ();
-                       InsertCommand = new SqlCommand ();
+                       DeleteCommand = new PgSqlCommand ();
+                       InsertCommand = new PgSqlCommand ();
                        SelectCommand = selectCommand;
-                       UpdateCommand = new SqlCommand ();
+                       UpdateCommand = new PgSqlCommand ();
                }
 
-               public SqlDataAdapter (string selectCommandText, SqlConnection selectConnection) 
-                       : this (new SqlCommand (selectCommandText, selectConnection))
+               public PgSqlDataAdapter (string selectCommandText, PgSqlConnection selectConnection) 
+                       : this (new PgSqlCommand (selectCommandText, selectConnection))
                { 
                }
 
-               public SqlDataAdapter (string selectCommandText, string selectConnectionString)
-                       : this (selectCommandText, new SqlConnection (selectConnectionString))
+               public PgSqlDataAdapter (string selectCommandText, string selectConnectionString)
+                       : this (selectCommandText, new PgSqlConnection (selectConnectionString))
                {
                }
 
@@ -65,7 +65,7 @@ namespace System.Data.SqlClient
 
                #region Properties
 
-               public SqlCommand DeleteCommand {
+               public PgSqlCommand DeleteCommand {
                        get {
                                return deleteCommand;
                        }
@@ -74,7 +74,7 @@ namespace System.Data.SqlClient
                        }
                }
 
-               public SqlCommand InsertCommand {
+               public PgSqlCommand InsertCommand {
                        get {
                                return insertCommand;
                        }
@@ -83,7 +83,7 @@ namespace System.Data.SqlClient
                        }
                }
 
-               public SqlCommand SelectCommand {
+               public PgSqlCommand SelectCommand {
                        get {
                                return selectCommand;
                        }
@@ -92,7 +92,7 @@ namespace System.Data.SqlClient
                        }
                }
 
-               public SqlCommand UpdateCommand {
+               public PgSqlCommand UpdateCommand {
                        get {
                                return updateCommand;
                        }
@@ -104,36 +104,36 @@ namespace System.Data.SqlClient
                IDbCommand IDbDataAdapter.DeleteCommand {
                        get { return DeleteCommand; }
                        set { 
-                               if (!(value is SqlCommand)) 
+                               if (!(value is PgSqlCommand)) 
                                        throw new ArgumentException ();
-                               DeleteCommand = (SqlCommand)value;
+                               DeleteCommand = (PgSqlCommand)value;
                        }
                }
 
                IDbCommand IDbDataAdapter.InsertCommand {
                        get { return InsertCommand; }
                        set { 
-                               if (!(value is SqlCommand)) 
+                               if (!(value is PgSqlCommand)) 
                                        throw new ArgumentException ();
-                               InsertCommand = (SqlCommand)value;
+                               InsertCommand = (PgSqlCommand)value;
                        }
                }
 
                IDbCommand IDbDataAdapter.SelectCommand {
                        get { return SelectCommand; }
                        set { 
-                               if (!(value is SqlCommand)) 
+                               if (!(value is PgSqlCommand)) 
                                        throw new ArgumentException ();
-                               SelectCommand = (SqlCommand)value;
+                               SelectCommand = (PgSqlCommand)value;
                        }
                }
 
                IDbCommand IDbDataAdapter.UpdateCommand {
                        get { return UpdateCommand; }
                        set { 
-                               if (!(value is SqlCommand)) 
+                               if (!(value is PgSqlCommand)) 
                                        throw new ArgumentException ();
-                               UpdateCommand = (SqlCommand)value;
+                               UpdateCommand = (PgSqlCommand)value;
                        }
                }
 
@@ -148,39 +148,39 @@ namespace System.Data.SqlClient
 
                protected override RowUpdatedEventArgs CreateRowUpdatedEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) 
                {
-                       return new SqlRowUpdatedEventArgs (dataRow, command, statementType, tableMapping);
+                       return new PgSqlRowUpdatedEventArgs (dataRow, command, statementType, tableMapping);
                }
 
 
                protected override RowUpdatingEventArgs CreateRowUpdatingEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) 
                {
-                       return new SqlRowUpdatingEventArgs (dataRow, command, statementType, tableMapping);
+                       return new PgSqlRowUpdatingEventArgs (dataRow, command, statementType, tableMapping);
                }
 
                protected override void OnRowUpdated (RowUpdatedEventArgs value) 
                {
-                       SqlRowUpdatedEventHandler handler = (SqlRowUpdatedEventHandler) Events[EventRowUpdated];
-                       if ((handler != null) && (value is SqlRowUpdatedEventArgs))
-                               handler(this, (SqlRowUpdatedEventArgs) value);
+                       PgSqlRowUpdatedEventHandler handler = (PgSqlRowUpdatedEventHandler) Events[EventRowUpdated];
+                       if ((handler != null) && (value is PgSqlRowUpdatedEventArgs))
+                               handler(this, (PgSqlRowUpdatedEventArgs) value);
                }
 
                protected override void OnRowUpdating (RowUpdatingEventArgs value) 
                {
-                       SqlRowUpdatingEventHandler handler = (SqlRowUpdatingEventHandler) Events[EventRowUpdating];
-                       if ((handler != null) && (value is SqlRowUpdatingEventArgs))
-                               handler(this, (SqlRowUpdatingEventArgs) value);
+                       PgSqlRowUpdatingEventHandler handler = (PgSqlRowUpdatingEventHandler) Events[EventRowUpdating];
+                       if ((handler != null) && (value is PgSqlRowUpdatingEventArgs))
+                               handler(this, (PgSqlRowUpdatingEventArgs) value);
                }
 
                #endregion // Methods
 
                #region Events and Delegates
 
-               public event SqlRowUpdatedEventHandler RowUpdated {
+               public event PgSqlRowUpdatedEventHandler RowUpdated {
                        add { Events.AddHandler (EventRowUpdated, value); }
                        remove { Events.RemoveHandler (EventRowUpdated, value); }
                }
 
-               public event SqlRowUpdatingEventHandler RowUpdating {
+               public event PgSqlRowUpdatingEventHandler RowUpdating {
                        add { Events.AddHandler (EventRowUpdating, value); }
                        remove { Events.RemoveHandler (EventRowUpdating, value); }
                }
index 28d0e1bc4e725012ab50bcbd4a281d4adef64e9a..1bd246638c48026e4d7b9f8479d53587520f45fd 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlDataReader.cs
+// Mono.Data.PostgreSqlClient.PgSqlDataReader.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -28,19 +28,19 @@ using System.Collections;
 using System.ComponentModel;
 using System.Data;
 
-namespace System.Data.SqlClient {
+namespace Mono.Data.PostgreSqlClient {
        /// <summary>
        /// Provides a means of reading one or more forward-only streams
        /// of result sets obtained by executing a command 
        /// at a SQL database.
        /// </summary>
-       //public sealed class SqlDataReader : MarshalByRefObject,
+       //public sealed class PgSqlDataReader : MarshalByRefObject,
        //      IEnumerable, IDataReader, IDisposable, IDataRecord
-       public sealed class SqlDataReader : IEnumerable, 
+       public sealed class PgSqlDataReader : IEnumerable, 
                IDataReader, IDataRecord {
                #region Fields
 
-               private SqlCommand cmd;
+               private PgSqlCommand cmd;
                private DataTable table = null;
 
                // columns in a row
@@ -64,7 +64,7 @@ namespace System.Data.SqlClient {
 
                #region Constructors
 
-               internal SqlDataReader (SqlCommand sqlCmd) {
+               internal PgSqlDataReader (PgSqlCommand sqlCmd) {
 
                        cmd = sqlCmd;
                        open = true;
@@ -97,7 +97,7 @@ namespace System.Data.SqlClient {
 
                [MonoTODO]
                public bool NextResult() {
-                       SqlResult res;
+                       PgSqlResult res;
                        currentRow = -1;
                        bool resultReturned;
                        
@@ -341,7 +341,7 @@ namespace System.Data.SqlClient {
                }
 
                //[MonoTODO]
-               //~SqlDataReader() {
+               //~PgSqlDataReader() {
                //}
 
                #endregion // Destructors
index e7c722285a925f0d797712a78c79f0d0dae0b281..42e63996bec74564421980b3270c8f3da66144af 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlError.cs
+// Mono.Data.PostgreSqlClient.PgSqlError.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -11,13 +11,13 @@ using System;
 using System.Data;
 using System.Runtime.InteropServices;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
        /// <summary>
        /// Describes an error from a SQL database.
        /// </summary>
        [MonoTODO]
-       public sealed class SqlError
+       public sealed class PgSqlError
        {
                byte theClass = 0;
                int lineNumber = 0;
@@ -28,7 +28,7 @@ namespace System.Data.SqlClient
                string source = "";
                byte state = 0;
 
-               internal SqlError(byte theClass, int lineNumber,
+               internal PgSqlError(byte theClass, int lineNumber,
                        string message, int number, string procedure,
                        string server, string source, byte state) {
                        this.theClass = theClass;
@@ -113,7 +113,7 @@ namespace System.Data.SqlClient
                        String stackTrace;
                        stackTrace = " <Stack Trace>";
                        // FIXME: generate the correct SQL error string
-                       toStr = "SqlError:" + message + stackTrace;
+                       toStr = "PgSqlError:" + message + stackTrace;
                        return toStr;
                }
 
index 7050d5d08fa784c1a4f8cc0d63154697ad3c10d2..bff6205b87b395fd67fd36b70220d00faadb5fc6 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlError.cs
+// Mono.Data.PostgreSqlClient.PgSqlError.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -12,20 +12,20 @@ using System.Collections;
 using System.Data;
 using System.Runtime.InteropServices;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
        /// <summary>
        /// Describes an error from a SQL database.
        /// </summary>
        [MonoTODO]
-       public sealed class SqlErrorCollection : ICollection, IEnumerable
+       public sealed class PgSqlErrorCollection : ICollection, IEnumerable
        {
                ArrayList errorList = new ArrayList();
 
-               internal SqlErrorCollection() {
+               internal PgSqlErrorCollection() {
                }
 
-               internal SqlErrorCollection(byte theClass, int lineNumber,
+               internal PgSqlErrorCollection(byte theClass, int lineNumber,
                        string message, int number, string procedure,
                        string server, string source, byte state) {
                        
@@ -69,9 +69,9 @@ namespace System.Data.SqlClient
                
                // Index property (indexer)
                // [MonoTODO]
-               public SqlError this[int index] {
+               public PgSqlError this[int index] {
                        get {
-                               return (SqlError) errorList[index];
+                               return (PgSqlError) errorList[index];
                        }
                }
 
@@ -86,7 +86,7 @@ namespace System.Data.SqlClient
                }
                #endregion
 
-               internal void Add(SqlError error) {
+               internal void Add(PgSqlError error) {
                        errorList.Add(error);
                }
 
@@ -94,7 +94,7 @@ namespace System.Data.SqlClient
                        string message, int number, string procedure,
                        string server, string source, byte state) {
                        
-                       SqlError error = new SqlError(theClass,
+                       PgSqlError error = new PgSqlError(theClass,
                                lineNumber, message,
                                number, procedure,
                                server, source, state);
@@ -104,7 +104,7 @@ namespace System.Data.SqlClient
                #region Destructors
 
                [MonoTODO]
-               ~SqlErrorCollection()
+               ~PgSqlErrorCollection()
                {
                        // FIXME: do the destructor - release resources
                }
index e447b5993721be783e28203f95168c3162a5728c..854b6cc4b2d5bd76fd06b4f75c39180a553e4420 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlException.cs
+// Mono.Data.PostgreSqlClient.PgSqlException.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -11,26 +11,26 @@ using System;
 using System.Data;
 using System.Runtime.Serialization;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
        /// <summary>
        /// Exceptions, as returned by SQL databases.
        /// </summary>
-       public sealed class SqlException : SystemException
+       public sealed class PgSqlException : SystemException
        {
-               private SqlErrorCollection errors; 
+               private PgSqlErrorCollection errors; 
 
-               internal SqlException() 
+               internal PgSqlException() 
                        : base("a SQL Exception has occurred") {
-                       errors = new SqlErrorCollection();
+                       errors = new PgSqlErrorCollection();
                }
 
-               internal SqlException(byte theClass, int lineNumber,
+               internal PgSqlException(byte theClass, int lineNumber,
                        string message, int number, string procedure,
                        string server, string source, byte state) 
                                : base(message) {       
                        
-                       errors = new SqlErrorCollection (theClass, 
+                       errors = new PgSqlErrorCollection (theClass, 
                                lineNumber, message,
                                number, procedure,
                                server, source, state);
@@ -53,7 +53,7 @@ namespace System.Data.SqlClient
                }
 
                [MonoTODO]
-               public SqlErrorCollection Errors {
+               public PgSqlErrorCollection Errors {
                        get { 
                                return errors;
                        }
@@ -195,7 +195,7 @@ namespace System.Data.SqlClient
                }
 
                [MonoTODO]
-               ~SqlException() {
+               ~PgSqlException() {
                        // FIXME: destructor to release resources
                }
 
index df69dff1d35c67015d3e73a20c0d9438714cb111..f2a7a7e8a81214d12792b47eb4e1ac923173a54b 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlInfoMessageEventArgs.cs
+// Mono.Data.PostgreSqlClient.PgSqlInfoMessageEventArgs.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
 using System;
 using System.Data;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
-       public sealed class SqlInfoMessageEventArgs : EventArgs
+       public sealed class PgSqlInfoMessageEventArgs : EventArgs
        {
                [MonoTODO]
-               public SqlErrorCollection Errors {
+               public PgSqlErrorCollection Errors {
                        get { 
                                throw new NotImplementedException (); 
                        }
@@ -44,7 +44,7 @@ namespace System.Data.SqlClient
                }
 
                //[MonoTODO]
-               //~SqlInfoMessageEventArgs() {
+               //~PgSqlInfoMessageEventArgs() {
                        // FIXME: destructor needs to release resources
                //}
        }
index c9862d61c03250ac9d33688a6afd1791b5d93dbf..d96fc3f7050fa7e42bff618a14bdf58d20143b95 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlInfoMessageEventHandler.cs
+// Mono.Data.PostgreSqlClient.PgSqlInfoMessageEventHandler.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -11,9 +11,9 @@
 using System;
 using System.Data;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
        public delegate void 
-       SqlInfoMessageEventHandler (object sender,
-                               SqlInfoMessageEventArgs e);
+       PgSqlInfoMessageEventHandler (object sender,
+                               PgSqlInfoMessageEventArgs e);
 }
index 6c05695eafc08858d12a086b25001d6d22ea7860..287febfcf423bf0253127eb2c69373210132d73a 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlParameter.cs
+// Mono.Data.PostgreSqlClient.PgSqlParameter.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -13,16 +13,16 @@ using System.Data;
 using System.Data.Common;
 using System.Runtime.InteropServices;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
        /// <summary>
        /// Represents a parameter to a Command object, and optionally, 
        /// its mapping to DataSet columns; and is implemented by .NET 
        /// data providers that access data sources.
        /// </summary>
-       //public sealed class SqlParameter : MarshalByRefObject,
+       //public sealed class PgSqlParameter : MarshalByRefObject,
        //      IDbDataParameter, IDataParameter, ICloneable
-       public sealed class SqlParameter : IDbDataParameter, IDataParameter
+       public sealed class PgSqlParameter : IDbDataParameter, IDataParameter
        {
                private string parmName;
                private SqlDbType dbtype;
@@ -38,24 +38,24 @@ namespace System.Data.SqlClient
                private int offset;
 
                [MonoTODO]
-               public SqlParameter () {
+               public PgSqlParameter () {
                
                }
 
                [MonoTODO]
-               public SqlParameter (string parameterName, object value) {
+               public PgSqlParameter (string parameterName, object value) {
                        this.parmName = parameterName;
                        this.objValue = value;
                }
                
                [MonoTODO]
-               public SqlParameter(string parameterName, SqlDbType dbType) {
+               public PgSqlParameter(string parameterName, SqlDbType dbType) {
                        this.parmName = parameterName;
                        this.dbtype = dbType;
                }
 
                [MonoTODO]
-               public SqlParameter(string parameterName, SqlDbType dbType,
+               public PgSqlParameter(string parameterName, SqlDbType dbType,
                        int size) {
 
                        this.parmName = parameterName;
@@ -64,7 +64,7 @@ namespace System.Data.SqlClient
                }
                
                [MonoTODO]
-               public SqlParameter(string parameterName, SqlDbType dbType,
+               public PgSqlParameter(string parameterName, SqlDbType dbType,
                        int size, string sourceColumn) {
 
                        this.parmName = parameterName;
@@ -74,7 +74,7 @@ namespace System.Data.SqlClient
                }
                         
                [MonoTODO]
-               public SqlParameter(string parameterName, SqlDbType dbType,
+               public PgSqlParameter(string parameterName, SqlDbType dbType,
                        int size, ParameterDirection direction, 
                        bool isNullable, byte precision,
                        byte scale, string sourceColumn,
index c1778299b866d4389f3a7a7cb8b08c464c512d3f..0cd47323cd2097d4f31a9a0d91854746a1e797e8 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlParameterCollection.cs
+// Mono.Data.PostgreSqlClient.PgSqlParameterCollection.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -14,15 +14,15 @@ using System.Data;
 using System.Data.Common;
 using System.Collections;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
        /// <summary>
        /// Collects all parameters relevant to a Command object 
        /// and their mappings to DataSet columns.
        /// </summary>
-       // public sealed class SqlParameterCollection : MarshalByRefObject,
+       // public sealed class PgSqlParameterCollection : MarshalByRefObject,
        // IDataParameterCollection, IList, ICollection, IEnumerable
-       public sealed class SqlParameterCollection : IDataParameterCollection,
+       public sealed class PgSqlParameterCollection : IDataParameterCollection,
                IList
        {
                private ArrayList parameterList = new ArrayList();
@@ -38,24 +38,24 @@ namespace System.Data.SqlClient
                {
                        // Call the add version that receives a SqlParameter 
                        
-                       // Check if value is a SqlParameter.
+                       // Check if value is a PgSqlParameter.
                        CheckType(value);
-                       Add((SqlParameter) value);
+                       Add((PgSqlParameter) value);
 
                        return IndexOf (value);
                }
 
                
-               public SqlParameter Add(SqlParameter value)
+               public PgSqlParameter Add(PgSqlParameter value)
                {
                        parameterList.Add(value);
                        return value;
                }
 
                
-               public SqlParameter Add(string parameterName, object value)
+               public PgSqlParameter Add(string parameterName, object value)
                {
-                       SqlParameter sqlparam = new SqlParameter();
+                       PgSqlParameter sqlparam = new PgSqlParameter();
                        sqlparam.Value = value;
                        // TODO: Get the dbtype and Sqldbtype from system type of value.
                        
@@ -63,19 +63,19 @@ namespace System.Data.SqlClient
                }
 
                
-               public SqlParameter Add(string parameterName, SqlDbType sqlDbType)
+               public PgSqlParameter Add(string parameterName, SqlDbType sqlDbType)
                {
-                       SqlParameter sqlparam = new SqlParameter();
+                       PgSqlParameter sqlparam = new PgSqlParameter();
                        sqlparam.ParameterName = parameterName;
                        sqlparam.SqlDbType = sqlDbType;
                        return Add(sqlparam);                   
                }
 
                
-               public SqlParameter Add(string parameterName,
+               public PgSqlParameter Add(string parameterName,
                        SqlDbType sqlDbType, int size)
                {
-                       SqlParameter sqlparam = new SqlParameter();
+                       PgSqlParameter sqlparam = new PgSqlParameter();
                        sqlparam.ParameterName = parameterName;
                        sqlparam.SqlDbType = sqlDbType;
                        sqlparam.Size = size;
@@ -83,10 +83,10 @@ namespace System.Data.SqlClient
                }
 
                
-               public SqlParameter Add(string parameterName,
+               public PgSqlParameter Add(string parameterName,
                        SqlDbType sqlDbType, int size, string sourceColumn)
                {
-                       SqlParameter sqlparam = new SqlParameter();
+                       PgSqlParameter sqlparam = new PgSqlParameter();
                        sqlparam.ParameterName = parameterName;
                        sqlparam.SqlDbType = sqlDbType;
                        sqlparam.Size = size;
@@ -105,7 +105,7 @@ namespace System.Data.SqlClient
                {
                        // Check if value is a SqlParameter
                        CheckType(value);
-                       return Contains(((SqlParameter)value).ParameterName);
+                       return Contains(((PgSqlParameter)value).ParameterName);
                }
 
 
@@ -113,7 +113,7 @@ namespace System.Data.SqlClient
                public bool Contains(string value)
                {
                        for(int p = 0; p < parameterList.Count; p++) {
-                               if(((SqlParameter)parameterList[p]).ParameterName.Equals(value))
+                               if(((PgSqlParameter)parameterList[p]).ParameterName.Equals(value))
                                        return true;
                        }
                        return false;
@@ -130,7 +130,7 @@ namespace System.Data.SqlClient
                {
                        // Check if value is a SqlParameter
                        CheckType(value);
-                       return IndexOf(((SqlParameter)value).ParameterName);
+                       return IndexOf(((PgSqlParameter)value).ParameterName);
                }
 
                
@@ -139,7 +139,7 @@ namespace System.Data.SqlClient
                        int p = -1;
 
                        for(p = 0; p < parameterList.Count; p++) {
-                               if(((SqlParameter)parameterList[p]).ParameterName.Equals(parameterName))
+                               if(((PgSqlParameter)parameterList[p]).ParameterName.Equals(parameterName))
                                        return p;
                        }
                        return p;
@@ -179,22 +179,22 @@ namespace System.Data.SqlClient
                object IList.this[int index] {
                        [MonoTODO]
                        get { 
-                               return (SqlParameter) this[index];
+                               return (PgSqlParameter) this[index];
                        }
                        
                        [MonoTODO]
                        set { 
-                               this[index] = (SqlParameter) value;
+                               this[index] = (PgSqlParameter) value;
                        }
                }
 
-               public SqlParameter this[int index] {
+               public PgSqlParameter this[int index] {
                        get {   
-                               return (SqlParameter) parameterList[index];
+                               return (PgSqlParameter) parameterList[index];
                        }                         
                        
                        set {   
-                               parameterList[index] = (SqlParameter) value;
+                               parameterList[index] = (PgSqlParameter) value;
                        }                         
                }
 
@@ -207,22 +207,22 @@ namespace System.Data.SqlClient
                        [MonoTODO]
                        set { 
                                CheckType(value);
-                               this[parameterName] = (SqlParameter) value;
+                               this[parameterName] = (PgSqlParameter) value;
                        }
                }
 
-               public SqlParameter this[string parameterName] {
+               public PgSqlParameter this[string parameterName] {
                        get {   
                                for(int p = 0; p < parameterList.Count; p++) {
-                                       if(parameterName.Equals(((SqlParameter)parameterList[p]).ParameterName))
-                                               return (SqlParameter) parameterList[p];
+                                       if(parameterName.Equals(((PgSqlParameter)parameterList[p]).ParameterName))
+                                               return (PgSqlParameter) parameterList[p];
                                }
                                throw new IndexOutOfRangeException("The specified name does not exist: " + parameterName);
                        }         
                        
                        set {   
                                for(int p = 0; p < parameterList.Count; p++) {
-                                       if(parameterName.Equals(((SqlParameter)parameterList[p]).ParameterName))
+                                       if(parameterName.Equals(((PgSqlParameter)parameterList[p]).ParameterName))
                                                parameterList[p] = value;
                                }
                                throw new IndexOutOfRangeException("The specified name does not exist: " + parameterName);
@@ -255,12 +255,12 @@ namespace System.Data.SqlClient
                
                /// <summary>
                /// This method checks if the parameter value is of 
-               /// SqlParameter type. If it doesn't, throws an InvalidCastException.
+               /// PgSqlParameter type. If it doesn't, throws an InvalidCastException.
                /// </summary>
                private void CheckType(object value)
                {
-                       if(!(value is SqlParameter))
-                               throw new InvalidCastException("Only SQLParameter objects can be used.");
+                       if(!(value is PgSqlParameter))
+                               throw new InvalidCastException("Only PgSqlParameter objects can be used.");
                }
                
        }
index dbc5789aa95eb0b46b18a7a34885813c53241130..1b7beb61461c452ad332fd34e8c96e5839169795 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlRowUpdatedEventArgs.cs
+// Mono.Data.PostgreSqlClient.PgSqlRowUpdatedEventArgs.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -12,23 +12,23 @@ using System;
 using System.Data;
 using System.Data.Common;
 
-namespace System.Data.SqlClient {
-       public sealed class SqlRowUpdatedEventArgs : RowUpdatedEventArgs 
+namespace Mono.Data.PostgreSqlClient {
+       public sealed class PgSqlRowUpdatedEventArgs : RowUpdatedEventArgs 
        {
                [MonoTODO]
-               public SqlRowUpdatedEventArgs (DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) 
+               public PgSqlRowUpdatedEventArgs (DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) 
                        : base (row, command, statementType, tableMapping)
                {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public new SqlCommand Command {
+               public new PgSqlCommand Command {
                        get { throw new NotImplementedException (); }
                }
 
                [MonoTODO]
-               ~SqlRowUpdatedEventArgs () 
+               ~PgSqlRowUpdatedEventArgs () 
                {
                        throw new NotImplementedException ();
                }
index 8cad2f1cbca5190b5c6ecf31a5cb95e4b01131e9..c577aabc8d134505a6cbd1715068a42d16ad31a3 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlRowUpdatedEventHandler.cs
+// Mono.Data.PostgreSqlClient.PgSqlRowUpdatedEventHandler.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -11,8 +11,8 @@
 using System;
 using System.Data;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
-       public delegate void SqlRowUpdatedEventHandler(object sender,
-                                       SqlRowUpdatedEventArgs e);
+       public delegate void PgSqlRowUpdatedEventHandler(object sender,
+                                       PgSqlRowUpdatedEventArgs e);
 }
index 6194ca1f95de75bbd8f59c5517f98293070ce4e8..f61e2f6933802bedd2734c1a7598ef7d86858c51 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlRowUpdatingEventArgs.cs
+// Mono.Data.PostgreSqlClient.PgSqlRowUpdatingEventArgs.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -12,19 +12,19 @@ using System;
 using System.Data;
 using System.Data.Common;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
-       public sealed class SqlRowUpdatingEventArgs : RowUpdatingEventArgs
+       public sealed class PgSqlRowUpdatingEventArgs : RowUpdatingEventArgs
        {
                [MonoTODO]
-               public SqlRowUpdatingEventArgs (DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) 
+               public PgSqlRowUpdatingEventArgs (DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) 
                        : base (row, command, statementType, tableMapping)
                {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public new SqlCommand Command {
+               public new PgSqlCommand Command {
                        get {
                                throw new NotImplementedException ();
                        } 
@@ -35,7 +35,7 @@ namespace System.Data.SqlClient
                }
 
                [MonoTODO]
-               ~SqlRowUpdatingEventArgs() 
+               ~PgSqlRowUpdatingEventArgs() 
                {
                        throw new NotImplementedException ();
                }
index 69c0228534dd36088b74c9a9fc823d5ee35eec79..672239c23d8ea21858e249a6f81a178a7f97c640 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlRowUpdatingEventHandler.cs
+// Mono.Data.PostgreSqlClient.PgSqlRowUpdatingEventHandler.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -11,8 +11,8 @@
 using System;
 using System.Data;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
-       public delegate void SqlRowUpdatingEventHandler(object sender,
-                       SqlRowUpdatingEventArgs e);
+       public delegate void PgSqlRowUpdatingEventHandler(object sender,
+                       PgSqlRowUpdatingEventArgs e);
 }
index 3a485b299c5abdd730f5383c7b2a83f1abf554d0..e3d0a87b2a2e618eb94bd82d3d71d58f4eb32af2 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlTransaction.cs
+// Mono.Data.PostgreSqlClient.PgSqlTransaction.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -16,19 +16,19 @@ using System;
 using System.Data;
 using System.Data.Common;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
        /// <summary>
        /// Represents a transaction to be performed on a SQL database.
        /// </summary>
-       // public sealed class SqlTransaction : MarshalByRefObject,
+       // public sealed class PgSqlTransaction : MarshalByRefObject,
        //      IDbTransaction, IDisposable
-       public sealed class SqlTransaction : IDbTransaction
+       public sealed class PgSqlTransaction : IDbTransaction
        {
                #region Fields
 
                private bool doingTransaction = false;
-               private SqlConnection conn = null;
+               private PgSqlConnection conn = null;
                private IsolationLevel isolationLevel = 
                        IsolationLevel.ReadCommitted;
                // There are only two IsolationLevel's for PostgreSQL:
@@ -49,7 +49,7 @@ namespace System.Data.SqlClient
                                        "thus PostgreSQL can not " +
                                        "Commit transaction.");
                        
-                       SqlCommand cmd = new SqlCommand("COMMIT", conn);
+                       PgSqlCommand cmd = new PgSqlCommand("COMMIT", conn);
                        cmd.ExecuteNonQuery();
                                                
                        doingTransaction = false;
@@ -65,7 +65,7 @@ namespace System.Data.SqlClient
                                        "thus PostgreSQL can not " +
                                        "Rollback transaction.");
                        
-                       SqlCommand cmd = new SqlCommand("ROLLBACK", conn);
+                       PgSqlCommand cmd = new PgSqlCommand("ROLLBACK", conn);
                        cmd.ExecuteNonQuery();
                                                
                        doingTransaction = false;
@@ -88,7 +88,7 @@ namespace System.Data.SqlClient
 
                #endregion // Public Methods
 
-               #region Internal Methods to System.Data.dll Assembly
+               #region Internal Methods to Mono.Data.PostgreSqlClient.dll Assembly
 
                internal void Begin()
                {
@@ -98,7 +98,7 @@ namespace System.Data.SqlClient
                                        "and PostgreSQL does not " +
                                        "support nested transactions.");
                        
-                       SqlCommand cmd = new SqlCommand("BEGIN", conn);
+                       PgSqlCommand cmd = new PgSqlCommand("BEGIN", conn);
                        cmd.ExecuteNonQuery();
                                                
                        doingTransaction = true;
@@ -124,13 +124,13 @@ namespace System.Data.SqlClient
                                        //   ReadCommitted or Serializable
                                        break;
                        }
-                       SqlCommand cmd = new SqlCommand(sSql, conn);
+                       PgSqlCommand cmd = new PgSqlCommand(sSql, conn);
                        cmd.ExecuteNonQuery();
 
                        this.isolationLevel = isoLevel;
                }
 
-               internal void SetConnection(SqlConnection connection)
+               internal void SetConnection(PgSqlConnection connection)
                {
                        this.conn = connection;
                }
@@ -145,7 +145,7 @@ namespace System.Data.SqlClient
                        }
                }
 
-               public SqlConnection Connection {
+               public PgSqlConnection Connection       {
                        get { 
                                return conn; 
                        }
@@ -180,7 +180,7 @@ namespace System.Data.SqlClient
                [MonoTODO]
                // [Serializable]\r
                // [ClassInterface(ClassInterfaceType.AutoDual)]
-               ~SqlTransaction() {
+               ~PgSqlTransaction() {
                        // FIXME: need to properly release resources
                        // Dispose(false);
                }
index 493afcd49e2742fdad23135794f6cdd32553f2cb..7fe06e40b914f016be65f50c19ce5a3f9b595017 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.PostgresLibrary.cs  
+// Mono.Data.PostgreSqlClient.PostgresLibrary.cs  
 //
 // PInvoke methods to libpq
 // which is PostgreSQL client library
@@ -23,7 +23,7 @@ using System.Runtime.InteropServices;
 using System.Diagnostics;
 using System.Collections;
 
-namespace System.Data.SqlClient {
+namespace Mono.Data.PostgreSqlClient {
 
        /* IMPORTANT: DO NOT CHANGE ANY OF THESE ENUMS BELOW */
        
index 6a086a82a42323d8297ac4f0ec720265f74f01fa..b20742876f88e27c09f18d5171d986aa59a08d42 100644 (file)
 \r
 // Note: this might become PostgresType and PostgresTypeCollection\r
 //       also, the PostgresTypes that exist as an inner internal class\r
-//       within SqlConnection maybe moved here in the future\r
+//       within PgSqlConnection maybe moved here in the future\r
 \r
 using System;\r
 using System.Collections;\r
 using System.Data;\r
 using System.Data.Common;\r
-using System.Data.SqlClient;\r
 using System.Text;\r
 \r
-namespace System.Data.SqlClient {\r
+namespace Mono.Data.PostgreSqlClient {\r
 \r
        internal struct PostgresType {\r
                public int oid;\r
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/TODOAttribute.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/TODOAttribute.cs
new file mode 100644 (file)
index 0000000..dd7e68a
--- /dev/null
@@ -0,0 +1,33 @@
+//
+// TODOAttribute.cs
+//
+// Author:
+//   Ravi Pratap (ravi@ximian.com)
+//
+// (C) Ximian, Inc.  http://www.ximian.com
+//
+using System;
+
+namespace Mono.Data.PostgreSqlClient {
+
+       /// <summary>
+       ///   The TODO attribute is used to flag all incomplete bits in our class libraries
+       /// </summary>
+       ///
+       /// <remarks>
+       ///   Use this to decorate any element which you think is not complete
+       /// </remarks>
+       [AttributeUsage (AttributeTargets.All)]
+       internal class MonoTODOAttribute : Attribute {
+
+               string comment;
+
+               public MonoTODOAttribute ()
+               {}
+
+               public MonoTODOAttribute (string comment)
+               {
+                       this.comment = comment;
+               }
+       }
+}
index 3dabac7853ee51bab2d68263b46b494e6381e219..beb3537f937874affe1ff390ec1f8548255731b5 100644 (file)
@@ -15,7 +15,7 @@ using System;
 using System.Data;\r
 using System.Text;\r
 \r
-namespace System.Data.SqlClient {\r
+namespace Mono.Data.PostgreSqlClient {\r
 \r
        enum PostgresBindVariableCharacter {\r
                Semicolon,\r
@@ -27,7 +27,7 @@ namespace System.Data.SqlClient {
 \r
                private string sql = "";\r
                private string resultSql = "";\r
-               private SqlParameterCollection parmsCollection = null;\r
+               private PgSqlParameterCollection parmsCollection = null;\r
                \r
                static private PostgresBindVariableCharacter PgbindChar = PostgresBindVariableCharacter.Semicolon;\r
                static char bindChar;\r
@@ -49,7 +49,7 @@ namespace System.Data.SqlClient {
                        }\r
                }\r
                                \r
-               public ParmUtil(string query, SqlParameterCollection parms) {\r
+               public ParmUtil(string query, PgSqlParameterCollection parms) {\r
                        sql = query;\r
                        parmsCollection = parms;\r
                }\r
@@ -150,7 +150,7 @@ namespace System.Data.SqlClient {
 #if DEBUG_ParmUtil\r
                                Console.WriteLine("Parameter Found: " + p);\r
 #endif\r
-                               SqlParameter prm = parmsCollection[p];\r
+                               PgSqlParameter prm = parmsCollection[p];\r
 \r
 #if DEBUG_ParmUtil                                                                                                                                     \r
                                // DEBUG \r
index 20b9e02a6d0d63446752c9c077354816abdc037d..8ef58881165e48bac6bb165a87febf899bf59efe 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlClientPermission.cs
+// Mono.Data.PostgreSqlClient.PgSqlClientPermission.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -14,22 +14,22 @@ using System.Data.Common;
 using System.Security;
 using System.Security.Permissions;
 
-namespace System.Data.SqlClient {
+namespace Mono.Data.PostgreSqlClient {
 
-       public sealed class SqlClientPermission : DBDataPermission {
+       public sealed class PgSqlClientPermission : DBDataPermission {
                
                [MonoTODO]
-               public SqlClientPermission() {
+               public PgSqlClientPermission() {
                        // FIXME: do constructor
                }
 
                [MonoTODO]
-               public SqlClientPermission(PermissionState state) {
+               public PgSqlClientPermission(PermissionState state) {
                        // FIXME: do constructor
                }
 
                [MonoTODO]
-               public SqlClientPermission(PermissionState state,
+               public PgSqlClientPermission(PermissionState state,
                        bool allowBlankPassword) { 
                        throw new NotImplementedException ();
                }
@@ -71,7 +71,7 @@ namespace System.Data.SqlClient {
                }
 
                [MonoTODO]
-               ~SqlClientPermission() {
+               ~PgSqlClientPermission() {
                        // FIXME: destructor to release resources
                }
        }
index 149613c5f2ecbb39d1939db5a66b2978afb5bb50..6c9f5b126db1485383918eebdf449288e1307d6e 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlClientPermissionAttribute.cs
+// Mono.Data.PostgreSqlClient.PgSqlClientPermissionAttribute.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -14,7 +14,7 @@ using System.Data.Common;
 using System.Security;
 using System.Security.Permissions;
 
-namespace System.Data.SqlClient {
+namespace Mono.Data.PostgreSqlClient {
 
        [AttributeUsage(AttributeTargets.Assembly    | 
                        AttributeTargets.Class       | 
@@ -22,11 +22,11 @@ namespace System.Data.SqlClient {
                        AttributeTargets.Constructor |
                        AttributeTargets.Method)]
        [Serializable]
-       public sealed class SqlClientPermissionAttribute :
+       public sealed class PgSqlClientPermissionAttribute :
                DBDataPermissionAttribute {
 
                [MonoTODO]
-               public SqlClientPermissionAttribute(SecurityAction action) : 
+               public PgSqlClientPermissionAttribute(SecurityAction action) : 
                        base(action)
                {
                        // FIXME: do constructor
@@ -38,7 +38,7 @@ namespace System.Data.SqlClient {
                }
 
                //[MonoTODO]
-               //~SqlClientPermissionAttribute() {
+               //~PgSqlClientPermissionAttribute() {
                //      // FIXME: destructor to release resources
                //}
        }
index 92e1d1d5e63e11799085027c0b8fea8130ceb975..6fd7926d1e898d9fe87f683a50ae0e559028b54b 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlCommand.cs
+// Mono.Data.PostgreSqlClient.PgSqlCommand.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -33,13 +33,13 @@ using System.Runtime.InteropServices;
 using System.Text;
 using System.Xml;
 
-namespace System.Data.SqlClient {
+namespace Mono.Data.PostgreSqlClient {
        /// <summary>
        /// Represents a SQL statement that is executed 
        /// while connected to a SQL database.
        /// </summary>
-       // public sealed class SqlCommand : Component, IDbCommand, ICloneable
-       public sealed class SqlCommand : IDbCommand {
+       // public sealed class PgSqlCommand : Component, IDbCommand, ICloneable
+       public sealed class PgSqlCommand : IDbCommand {
 
                #region Fields
 
@@ -48,15 +48,15 @@ namespace System.Data.SqlClient {
                // default is 30 seconds 
                // for command execution
 
-               private SqlConnection conn = null;
-               private SqlTransaction trans = null;
+               private PgSqlConnection conn = null;
+               private PgSqlTransaction trans = null;
                private CommandType cmdType = CommandType.Text;
                private bool designTime = false;
-               private SqlParameterCollection parmCollection = new 
-                       SqlParameterCollection();
+               private PgSqlParameterCollection parmCollection = new 
+                       PgSqlParameterCollection();
 
-               // SqlDataReader state data for ExecuteReader()
-               private SqlDataReader dataReader = null;
+               // PgSqlDataReader state data for ExecuteReader()
+               private PgSqlDataReader dataReader = null;
                private string[] queries = null;
                private int currentQuery = -1;
                private CommandBehavior cmdBehavior = CommandBehavior.Default;
@@ -67,21 +67,21 @@ namespace System.Data.SqlClient {
 
                #region Constructors
 
-               public SqlCommand() {
+               public PgSqlCommand() {
                        sql = "";
                }
 
-               public SqlCommand (string cmdText) {
+               public PgSqlCommand (string cmdText) {
                        sql = cmdText;
                }
 
-               public SqlCommand (string cmdText, SqlConnection connection) {
+               public PgSqlCommand (string cmdText, PgSqlConnection connection) {
                        sql = cmdText;
                        conn = connection;
                }
 
-               public SqlCommand (string cmdText, SqlConnection connection, 
-                       SqlTransaction transaction) {
+               public PgSqlCommand (string cmdText, PgSqlConnection connection, 
+                       PgSqlTransaction transaction) {
                        sql = cmdText;
                        conn = connection;
                        trans = transaction;
@@ -104,8 +104,8 @@ namespace System.Data.SqlClient {
                }
 
                [MonoTODO]
-               public SqlParameter CreateParameter () {
-                       return new SqlParameter ();
+               public PgSqlParameter CreateParameter () {
+                       return new PgSqlParameter ();
                }
 
                public int ExecuteNonQuery () { 
@@ -160,7 +160,7 @@ namespace System.Data.SqlClient {
                                PostgresLibrary.PQclear (pgResult);
                                pgResult = IntPtr.Zero;
 \r
-                               throw new SqlException(0, 0,
+                               throw new PgSqlException(0, 0,
                                        errorMessage, 0, "",
                                        conn.DataSource, "SqlCommand", 0);\r
                        }
@@ -174,7 +174,7 @@ namespace System.Data.SqlClient {
                }
 
                [MonoTODO]
-               public SqlDataReader ExecuteReader () {
+               public PgSqlDataReader ExecuteReader () {
                        return ExecuteReader(CommandBehavior.Default);
                }
 
@@ -185,7 +185,7 @@ namespace System.Data.SqlClient {
                }
 
                [MonoTODO]
-               public SqlDataReader ExecuteReader (CommandBehavior behavior) 
+               public PgSqlDataReader ExecuteReader (CommandBehavior behavior) 
                {
                        if(conn.State != ConnectionState.Open)
                                throw new InvalidOperationException(
@@ -195,7 +195,7 @@ namespace System.Data.SqlClient {
 
                        queries = null;
                        currentQuery = -1;
-                       dataReader = new SqlDataReader(this);
+                       dataReader = new PgSqlDataReader(this);
 
                        queries = sql.Split(new Char[] {';'});                  
 
@@ -204,9 +204,9 @@ namespace System.Data.SqlClient {
                        return dataReader;
                }
 
-               internal SqlResult NextResult() 
+               internal PgSqlResult NextResult() 
                {
-                       SqlResult res = new SqlResult();
+                       PgSqlResult res = new PgSqlResult();
                        res.Connection = this.Connection;
                        res.Behavior = cmdBehavior;
                        string statement;
@@ -293,7 +293,7 @@ namespace System.Data.SqlClient {
                        return statement;
                }
 
-               private void ExecuteQuery (string query, SqlResult res)
+               private void ExecuteQuery (string query, PgSqlResult res)
                {                       
                        IntPtr pgResult;
                
@@ -336,7 +336,7 @@ namespace System.Data.SqlClient {
                                PostgresLibrary.PQclear (pgResult);
                                pgResult = IntPtr.Zero;
 \r
-                               throw new SqlException(0, 0,
+                               throw new PgSqlException(0, 0,
                                        errorMessage, 0, "",
                                        conn.DataSource, "SqlCommand", 0);\r
                        }
@@ -360,7 +360,7 @@ namespace System.Data.SqlClient {
 
                // only meant to be used between SqlConnectioin,
                // SqlCommand, and SqlDataReader
-               internal void OpenReader(SqlDataReader reader) {
+               internal void OpenReader(PgSqlDataReader reader) {
                        conn.OpenReader(reader);
                }
 
@@ -483,7 +483,7 @@ namespace System.Data.SqlClient {
                                PostgresLibrary.PQclear (pgResult);
                                pgResult = IntPtr.Zero;
 \r
-                               throw new SqlException(0, 0,
+                               throw new PgSqlException(0, 0,
                                        errorMessage, 0, "",
                                        conn.DataSource, "SqlCommand", 0);\r
                        }
@@ -503,7 +503,7 @@ namespace System.Data.SqlClient {
                }
 
                [MonoTODO]
-               public SqlCommand Clone () {
+               public PgSqlCommand Clone () {
                        throw new NotImplementedException ();
                }
 
@@ -558,7 +558,7 @@ namespace System.Data.SqlClient {
                                // transaction in progress
 
                                // csc
-                               Connection = (SqlConnection) value; 
+                               Connection = (PgSqlConnection) value; 
                                // mcs
                                // Connection = value; 
                                
@@ -566,7 +566,7 @@ namespace System.Data.SqlClient {
                        }
                }
                
-               public SqlConnection Connection {
+               public PgSqlConnection Connection {
                        get { 
                                // conn defaults to null
                                return conn;
@@ -599,7 +599,7 @@ namespace System.Data.SqlClient {
                        }
                }
 
-               public SqlParameterCollection Parameters {
+               public PgSqlParameterCollection Parameters {
                        get { 
                                return parmCollection;
                        }
@@ -618,13 +618,13 @@ namespace System.Data.SqlClient {
                                // has already begun
 
                                // csc
-                               Transaction = (SqlTransaction) value;
+                               Transaction = (PgSqlTransaction) value;
                                // mcs
                                // Transaction = value; 
                        }
                }
 
-               public SqlTransaction Transaction {
+               public PgSqlTransaction Transaction {
                        get { 
                                return trans; 
                        }
@@ -662,7 +662,7 @@ namespace System.Data.SqlClient {
                }
 
                [MonoTODO]
-               ~SqlCommand() {
+               ~PgSqlCommand() {
                        // FIXME: need proper way to release resources
                        // Dispose(false);
                }
@@ -672,7 +672,7 @@ namespace System.Data.SqlClient {
 
        // SqlResult is used for passing Result Set data 
        // from SqlCommand to SqlDataReader
-       internal class SqlResult {
+       internal class PgSqlResult {
 
                private DataTable dataTableSchema = null; // only will contain the schema
                private IntPtr pg_result = IntPtr.Zero; // native PostgreSQL PGresult
@@ -680,7 +680,7 @@ namespace System.Data.SqlClient {
                private int fieldCount = 0;
                private string[] pgtypes = null; // PostgreSQL types (typname)
                private bool resultReturned = false;
-               private SqlConnection con = null;
+               private PgSqlConnection con = null;
                private int rowsAffected = -1;
                private ExecStatusType execStatus = ExecStatusType.PGRES_FATAL_ERROR;
                private int currentQuery = -1;
@@ -725,7 +725,7 @@ namespace System.Data.SqlClient {
 
                }
 
-               internal SqlConnection Connection {
+               internal PgSqlConnection Connection {
                        get {
                                return con;
                        }
index d2b028bc652399acda1325cc6b9228e1b0f0a309..ddd6c1267540059913c48d82017e87ba08d6dade 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlCommandBuilder.cs
+// Mono.Data.PostgreSqlClient.PgSqlCommandBuilder.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -12,27 +12,27 @@ using System;
 using System.Data;
 using System.ComponentModel;
 
-namespace System.Data.SqlClient {\r
+namespace Mono.Data.PostgreSqlClient {\r
 \r
        /// <summary>\r
        /// Builder of one command\r
        /// that will be used in manipulating a table for\r
        /// a DataSet that is assoicated with a database.\r
        /// </summary>\r
-       public sealed class SqlCommandBuilder : Component {\r
+       public sealed class PgSqlCommandBuilder : Component {\r
                \r
                [MonoTODO]\r
-               public SqlCommandBuilder() {\r
+               public PgSqlCommandBuilder() {\r
 \r
                }\r
 \r
                [MonoTODO]\r
-               public SqlCommandBuilder(SqlDataAdapter adapter) {\r
+               public PgSqlCommandBuilder(PgSqlDataAdapter adapter) {\r
                \r
                }\r
 \r
                [MonoTODO]\r
-               public SqlDataAdapter DataAdapter {\r
+               public PgSqlDataAdapter DataAdapter {\r
                        get {\r
                                throw new NotImplementedException ();\r
                        }\r
@@ -65,22 +65,22 @@ namespace System.Data.SqlClient {
                }\r
 \r
                [MonoTODO]\r
-               public static void DeriveParameters(SqlCommand command) {\r
+               public static void DeriveParameters(PgSqlCommand command) {\r
                        throw new NotImplementedException ();\r
                }\r
 \r
                [MonoTODO]\r
-               public SqlCommand GetDeleteCommand() {\r
+               public PgSqlCommand GetDeleteCommand() {\r
                        throw new NotImplementedException ();\r
                }\r
 \r
                [MonoTODO]\r
-               public SqlCommand GetInsertCommand() {\r
+               public PgSqlCommand GetInsertCommand() {\r
                        throw new NotImplementedException ();\r
                }\r
 \r
                [MonoTODO]\r
-               public SqlCommand GetUpdateCommand() {\r
+               public PgSqlCommand GetUpdateCommand() {\r
                        throw new NotImplementedException ();\r
                }\r
 \r
@@ -95,7 +95,7 @@ namespace System.Data.SqlClient {
                }\r
 \r
                [MonoTODO]\r
-               ~SqlCommandBuilder() {\r
+               ~PgSqlCommandBuilder() {\r
                        // FIXME: create destructor - release resources\r
                }\r
        }\r
index f3c4df7be716371711d8745401464d1819da4f9d..a306a701e5103e336d3950c04f6b62f9997c1d6d 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlConnection.cs
+// Mono.Data.PostgreSqlClient.PgSqlConnection.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -30,12 +30,12 @@ using System.Data.Common;
 using System.Runtime.InteropServices;
 using System.Text;
 
-namespace System.Data.SqlClient {
+namespace Mono.Data.PostgreSqlClient {
 
        /// <summary>
        /// Represents an open connection to a SQL data source
        /// </summary>
-       public sealed class SqlConnection : Component, IDbConnection,
+       public sealed class PgSqlConnection : Component, IDbConnection,
                ICloneable      
        {
                // FIXME: Need to implement class Component, \r
@@ -51,7 +51,7 @@ namespace System.Data.SqlClient {
                // OLE DB Connection String
                private string pgConnectionString = ""; 
                // PostgreSQL Connection String
-               private SqlTransaction trans = null;
+               private PgSqlTransaction trans = null;
                private int connectionTimeout = 15;     
                // default for 15 seconds
                
@@ -85,7 +85,7 @@ namespace System.Data.SqlClient {
                private ConnectionState conState = ConnectionState.Closed;
                
                // DataReader state
-               private SqlDataReader rdr = null;
+               private PgSqlDataReader rdr = null;
                private bool dataReaderOpen = false;
                // FIXME: if true, throw an exception if SqlConnection 
                //        is used for anything other than reading
@@ -101,12 +101,12 @@ namespace System.Data.SqlClient {
 
                // A lot of the defaults were initialized in the Fields
                [MonoTODO]
-               public SqlConnection () {
+               public PgSqlConnection () {
 
                }
        
                [MonoTODO]
-               public SqlConnection (String connectionString) {
+               public PgSqlConnection (String connectionString) {
                        SetConnectionString (connectionString);
                }
 
@@ -133,7 +133,7 @@ namespace System.Data.SqlClient {
                // aka Finalize()
                // [ClassInterface(ClassInterfaceType.AutoDual)]
                [MonoTODO]
-               ~SqlConnection() {
+               ~PgSqlConnection() {
                        Dispose (false);
                }
                
@@ -145,7 +145,7 @@ namespace System.Data.SqlClient {
                        return BeginTransaction ();
                }
 
-               public SqlTransaction BeginTransaction () {
+               public PgSqlTransaction BeginTransaction () {
                        return TransactionBegin (); // call private method
                }
 
@@ -154,19 +154,19 @@ namespace System.Data.SqlClient {
                        return BeginTransaction (il);
                }
 
-               public SqlTransaction BeginTransaction (IsolationLevel il) {
+               public PgSqlTransaction BeginTransaction (IsolationLevel il) {
                        return TransactionBegin (il); // call private method
                }
 
                // PostgreSQL does not support named transactions/savepoint
                //            nor nested transactions
                [Obsolete]
-               public SqlTransaction BeginTransaction(string transactionName) {
+               public PgSqlTransaction BeginTransaction(string transactionName) {
                        return TransactionBegin (); // call private method
                }
 
                [Obsolete]
-               public SqlTransaction BeginTransaction(IsolationLevel iso,\r
+               public PgSqlTransaction BeginTransaction(IsolationLevel iso,\r
                        string transactionName) {
                        return TransactionBegin (iso); // call private method
                }
@@ -195,8 +195,8 @@ namespace System.Data.SqlClient {
                        return CreateCommand ();
                }
 
-               public SqlCommand CreateCommand () {
-                       SqlCommand sqlcmd = new SqlCommand ("", this);
+               public PgSqlCommand CreateCommand () {
+                       PgSqlCommand sqlcmd = new PgSqlCommand ("", this);
 
                        return sqlcmd;
                }
@@ -235,7 +235,7 @@ namespace System.Data.SqlClient {
                                        PQerrorMessage (pgConn);
                                errorMessage += ": Could not connect to database.";
 
-                               throw new SqlException(0, 0,
+                               throw new PgSqlException(0, 0,
                                        errorMessage, 0, "",
                                        host, "SqlConnection", 0);
                        }
@@ -249,7 +249,7 @@ namespace System.Data.SqlClient {
                // from doing anything while
                // SqlDataReader is open.
                // Open the Reader. (called from SqlCommand)
-               internal void OpenReader(SqlDataReader reader) 
+               internal void OpenReader(PgSqlDataReader reader) 
                {       
                        if(dataReaderOpen == true) {
                                // TODO: throw exception here?
@@ -298,7 +298,7 @@ namespace System.Data.SqlClient {
 
                private string GetDatabaseServerVersion() 
                {
-                       SqlCommand cmd = new SqlCommand("select version()",this);
+                       PgSqlCommand cmd = new PgSqlCommand("select version()",this);
                        return (string) cmd.ExecuteScalar();
                }
 
@@ -451,10 +451,10 @@ namespace System.Data.SqlClient {
                        return addParm;
                }
 
-               private SqlTransaction TransactionBegin () {
+               private PgSqlTransaction TransactionBegin () {
                        // FIXME: need to keep track of 
                        // transaction in-progress
-                       trans = new SqlTransaction ();
+                       trans = new PgSqlTransaction ();
                        // using internal methods of SqlTransaction
                        trans.SetConnection (this);
                        trans.Begin();
@@ -462,10 +462,10 @@ namespace System.Data.SqlClient {
                        return trans;
                }
 
-               private SqlTransaction TransactionBegin (IsolationLevel il) {
+               private PgSqlTransaction TransactionBegin (IsolationLevel il) {
                        // FIXME: need to keep track of 
                        // transaction in-progress
-                       trans = new SqlTransaction ();
+                       trans = new PgSqlTransaction ();
                        // using internal methods of SqlTransaction
                        trans.SetConnection (this);
                        trans.SetIsolationLevel (il);
@@ -531,7 +531,7 @@ namespace System.Data.SqlClient {
                // For System.Data.SqlClient classes
                // to get the current transaction
                // in progress - if any
-               internal SqlTransaction Transaction {
+               internal PgSqlTransaction Transaction {
                        get {
                                return trans;
                        }
@@ -569,7 +569,7 @@ namespace System.Data.SqlClient {
                #region Events
                 
                public event 
-               SqlInfoMessageEventHandler InfoMessage;
+               PgSqlInfoMessageEventHandler InfoMessage;
 
                public event 
                StateChangeEventHandler StateChange;
@@ -585,7 +585,7 @@ namespace System.Data.SqlClient {
 
                        private Hashtable hashTypes;
                        private ArrayList pgTypes;
-                       private SqlConnection con;
+                       private PgSqlConnection con;
 
                        // Got this SQL with the permission from 
                        // the authors of libgda
@@ -597,7 +597,7 @@ namespace System.Data.SqlClient {
                                "'smgr', 'tid', 'unknown', 'xid') " +
                                "ORDER BY typname";
 
-                       internal PostgresTypes(SqlConnection sqlcon) {
+                       internal PostgresTypes(PgSqlConnection sqlcon) {
                                
                                con = sqlcon;
                                hashTypes = new Hashtable();
@@ -667,7 +667,7 @@ namespace System.Data.SqlClient {
                                        PQexec (con.PostgresConnection, SEL_SQL_GetTypes);
 
                                if(pgResult.Equals(IntPtr.Zero)) {
-                                       throw new SqlException(0, 0,
+                                       throw new PgSqlException(0, 0,
                                                "No Resultset from PostgreSQL", 0, "",
                                                con.DataSource, "SqlConnection", 0);
                                }
@@ -706,7 +706,7 @@ namespace System.Data.SqlClient {
                                                PostgresLibrary.PQclear (pgResult);
                                                pgResult = IntPtr.Zero;
 \r
-                                               throw new SqlException(0, 0,
+                                               throw new PgSqlException(0, 0,
                                                        errorMessage, 0, "",
                                                        con.DataSource, "SqlConnection", 0);\r
                                        }
index 526f8f368183f2d10bcf90eadcbd972d9670b538..aee4ceee59d2b713e70f7423c5060bc2cc249a49 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlDataAdapter.cs
+// Mono.Data.PostgreSqlClient.PgSqlDataAdapter.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -15,21 +15,21 @@ using System.ComponentModel;
 using System.Data;
 using System.Data.Common;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
        /// <summary>
        /// Represents a set of command-related properties that are used 
        /// to fill the DataSet and update a data source, all this 
        /// from a SQL database.
        /// </summary>
-       public sealed class SqlDataAdapter : DbDataAdapter, IDbDataAdapter 
+       public sealed class PgSqlDataAdapter : DbDataAdapter, IDbDataAdapter 
        {
                #region Fields
        
-               SqlCommand deleteCommand;
-               SqlCommand insertCommand;
-               SqlCommand selectCommand;
-               SqlCommand updateCommand;
+               PgSqlCommand deleteCommand;
+               PgSqlCommand insertCommand;
+               PgSqlCommand selectCommand;
+               PgSqlCommand updateCommand;
 
                static readonly object EventRowUpdated = new object(); 
                static readonly object EventRowUpdating = new object(); 
@@ -38,26 +38,26 @@ namespace System.Data.SqlClient
 
                #region Constructors
                
-               public SqlDataAdapter ()        
-                       : this (new SqlCommand ())
+               public PgSqlDataAdapter ()      
+                       : this (new PgSqlCommand ())
                {
                }
 
-               public SqlDataAdapter (SqlCommand selectCommand) 
+               public PgSqlDataAdapter (PgSqlCommand selectCommand) 
                {
-                       DeleteCommand = new SqlCommand ();
-                       InsertCommand = new SqlCommand ();
+                       DeleteCommand = new PgSqlCommand ();
+                       InsertCommand = new PgSqlCommand ();
                        SelectCommand = selectCommand;
-                       UpdateCommand = new SqlCommand ();
+                       UpdateCommand = new PgSqlCommand ();
                }
 
-               public SqlDataAdapter (string selectCommandText, SqlConnection selectConnection) 
-                       : this (new SqlCommand (selectCommandText, selectConnection))
+               public PgSqlDataAdapter (string selectCommandText, PgSqlConnection selectConnection) 
+                       : this (new PgSqlCommand (selectCommandText, selectConnection))
                { 
                }
 
-               public SqlDataAdapter (string selectCommandText, string selectConnectionString)
-                       : this (selectCommandText, new SqlConnection (selectConnectionString))
+               public PgSqlDataAdapter (string selectCommandText, string selectConnectionString)
+                       : this (selectCommandText, new PgSqlConnection (selectConnectionString))
                {
                }
 
@@ -65,7 +65,7 @@ namespace System.Data.SqlClient
 
                #region Properties
 
-               public SqlCommand DeleteCommand {
+               public PgSqlCommand DeleteCommand {
                        get {
                                return deleteCommand;
                        }
@@ -74,7 +74,7 @@ namespace System.Data.SqlClient
                        }
                }
 
-               public SqlCommand InsertCommand {
+               public PgSqlCommand InsertCommand {
                        get {
                                return insertCommand;
                        }
@@ -83,7 +83,7 @@ namespace System.Data.SqlClient
                        }
                }
 
-               public SqlCommand SelectCommand {
+               public PgSqlCommand SelectCommand {
                        get {
                                return selectCommand;
                        }
@@ -92,7 +92,7 @@ namespace System.Data.SqlClient
                        }
                }
 
-               public SqlCommand UpdateCommand {
+               public PgSqlCommand UpdateCommand {
                        get {
                                return updateCommand;
                        }
@@ -104,36 +104,36 @@ namespace System.Data.SqlClient
                IDbCommand IDbDataAdapter.DeleteCommand {
                        get { return DeleteCommand; }
                        set { 
-                               if (!(value is SqlCommand)) 
+                               if (!(value is PgSqlCommand)) 
                                        throw new ArgumentException ();
-                               DeleteCommand = (SqlCommand)value;
+                               DeleteCommand = (PgSqlCommand)value;
                        }
                }
 
                IDbCommand IDbDataAdapter.InsertCommand {
                        get { return InsertCommand; }
                        set { 
-                               if (!(value is SqlCommand)) 
+                               if (!(value is PgSqlCommand)) 
                                        throw new ArgumentException ();
-                               InsertCommand = (SqlCommand)value;
+                               InsertCommand = (PgSqlCommand)value;
                        }
                }
 
                IDbCommand IDbDataAdapter.SelectCommand {
                        get { return SelectCommand; }
                        set { 
-                               if (!(value is SqlCommand)) 
+                               if (!(value is PgSqlCommand)) 
                                        throw new ArgumentException ();
-                               SelectCommand = (SqlCommand)value;
+                               SelectCommand = (PgSqlCommand)value;
                        }
                }
 
                IDbCommand IDbDataAdapter.UpdateCommand {
                        get { return UpdateCommand; }
                        set { 
-                               if (!(value is SqlCommand)) 
+                               if (!(value is PgSqlCommand)) 
                                        throw new ArgumentException ();
-                               UpdateCommand = (SqlCommand)value;
+                               UpdateCommand = (PgSqlCommand)value;
                        }
                }
 
@@ -148,39 +148,39 @@ namespace System.Data.SqlClient
 
                protected override RowUpdatedEventArgs CreateRowUpdatedEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) 
                {
-                       return new SqlRowUpdatedEventArgs (dataRow, command, statementType, tableMapping);
+                       return new PgSqlRowUpdatedEventArgs (dataRow, command, statementType, tableMapping);
                }
 
 
                protected override RowUpdatingEventArgs CreateRowUpdatingEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) 
                {
-                       return new SqlRowUpdatingEventArgs (dataRow, command, statementType, tableMapping);
+                       return new PgSqlRowUpdatingEventArgs (dataRow, command, statementType, tableMapping);
                }
 
                protected override void OnRowUpdated (RowUpdatedEventArgs value) 
                {
-                       SqlRowUpdatedEventHandler handler = (SqlRowUpdatedEventHandler) Events[EventRowUpdated];
-                       if ((handler != null) && (value is SqlRowUpdatedEventArgs))
-                               handler(this, (SqlRowUpdatedEventArgs) value);
+                       PgSqlRowUpdatedEventHandler handler = (PgSqlRowUpdatedEventHandler) Events[EventRowUpdated];
+                       if ((handler != null) && (value is PgSqlRowUpdatedEventArgs))
+                               handler(this, (PgSqlRowUpdatedEventArgs) value);
                }
 
                protected override void OnRowUpdating (RowUpdatingEventArgs value) 
                {
-                       SqlRowUpdatingEventHandler handler = (SqlRowUpdatingEventHandler) Events[EventRowUpdating];
-                       if ((handler != null) && (value is SqlRowUpdatingEventArgs))
-                               handler(this, (SqlRowUpdatingEventArgs) value);
+                       PgSqlRowUpdatingEventHandler handler = (PgSqlRowUpdatingEventHandler) Events[EventRowUpdating];
+                       if ((handler != null) && (value is PgSqlRowUpdatingEventArgs))
+                               handler(this, (PgSqlRowUpdatingEventArgs) value);
                }
 
                #endregion // Methods
 
                #region Events and Delegates
 
-               public event SqlRowUpdatedEventHandler RowUpdated {
+               public event PgSqlRowUpdatedEventHandler RowUpdated {
                        add { Events.AddHandler (EventRowUpdated, value); }
                        remove { Events.RemoveHandler (EventRowUpdated, value); }
                }
 
-               public event SqlRowUpdatingEventHandler RowUpdating {
+               public event PgSqlRowUpdatingEventHandler RowUpdating {
                        add { Events.AddHandler (EventRowUpdating, value); }
                        remove { Events.RemoveHandler (EventRowUpdating, value); }
                }
index 28d0e1bc4e725012ab50bcbd4a281d4adef64e9a..1bd246638c48026e4d7b9f8479d53587520f45fd 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlDataReader.cs
+// Mono.Data.PostgreSqlClient.PgSqlDataReader.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -28,19 +28,19 @@ using System.Collections;
 using System.ComponentModel;
 using System.Data;
 
-namespace System.Data.SqlClient {
+namespace Mono.Data.PostgreSqlClient {
        /// <summary>
        /// Provides a means of reading one or more forward-only streams
        /// of result sets obtained by executing a command 
        /// at a SQL database.
        /// </summary>
-       //public sealed class SqlDataReader : MarshalByRefObject,
+       //public sealed class PgSqlDataReader : MarshalByRefObject,
        //      IEnumerable, IDataReader, IDisposable, IDataRecord
-       public sealed class SqlDataReader : IEnumerable, 
+       public sealed class PgSqlDataReader : IEnumerable, 
                IDataReader, IDataRecord {
                #region Fields
 
-               private SqlCommand cmd;
+               private PgSqlCommand cmd;
                private DataTable table = null;
 
                // columns in a row
@@ -64,7 +64,7 @@ namespace System.Data.SqlClient {
 
                #region Constructors
 
-               internal SqlDataReader (SqlCommand sqlCmd) {
+               internal PgSqlDataReader (PgSqlCommand sqlCmd) {
 
                        cmd = sqlCmd;
                        open = true;
@@ -97,7 +97,7 @@ namespace System.Data.SqlClient {
 
                [MonoTODO]
                public bool NextResult() {
-                       SqlResult res;
+                       PgSqlResult res;
                        currentRow = -1;
                        bool resultReturned;
                        
@@ -341,7 +341,7 @@ namespace System.Data.SqlClient {
                }
 
                //[MonoTODO]
-               //~SqlDataReader() {
+               //~PgSqlDataReader() {
                //}
 
                #endregion // Destructors
index e7c722285a925f0d797712a78c79f0d0dae0b281..42e63996bec74564421980b3270c8f3da66144af 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlError.cs
+// Mono.Data.PostgreSqlClient.PgSqlError.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -11,13 +11,13 @@ using System;
 using System.Data;
 using System.Runtime.InteropServices;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
        /// <summary>
        /// Describes an error from a SQL database.
        /// </summary>
        [MonoTODO]
-       public sealed class SqlError
+       public sealed class PgSqlError
        {
                byte theClass = 0;
                int lineNumber = 0;
@@ -28,7 +28,7 @@ namespace System.Data.SqlClient
                string source = "";
                byte state = 0;
 
-               internal SqlError(byte theClass, int lineNumber,
+               internal PgSqlError(byte theClass, int lineNumber,
                        string message, int number, string procedure,
                        string server, string source, byte state) {
                        this.theClass = theClass;
@@ -113,7 +113,7 @@ namespace System.Data.SqlClient
                        String stackTrace;
                        stackTrace = " <Stack Trace>";
                        // FIXME: generate the correct SQL error string
-                       toStr = "SqlError:" + message + stackTrace;
+                       toStr = "PgSqlError:" + message + stackTrace;
                        return toStr;
                }
 
index 7050d5d08fa784c1a4f8cc0d63154697ad3c10d2..bff6205b87b395fd67fd36b70220d00faadb5fc6 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlError.cs
+// Mono.Data.PostgreSqlClient.PgSqlError.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -12,20 +12,20 @@ using System.Collections;
 using System.Data;
 using System.Runtime.InteropServices;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
        /// <summary>
        /// Describes an error from a SQL database.
        /// </summary>
        [MonoTODO]
-       public sealed class SqlErrorCollection : ICollection, IEnumerable
+       public sealed class PgSqlErrorCollection : ICollection, IEnumerable
        {
                ArrayList errorList = new ArrayList();
 
-               internal SqlErrorCollection() {
+               internal PgSqlErrorCollection() {
                }
 
-               internal SqlErrorCollection(byte theClass, int lineNumber,
+               internal PgSqlErrorCollection(byte theClass, int lineNumber,
                        string message, int number, string procedure,
                        string server, string source, byte state) {
                        
@@ -69,9 +69,9 @@ namespace System.Data.SqlClient
                
                // Index property (indexer)
                // [MonoTODO]
-               public SqlError this[int index] {
+               public PgSqlError this[int index] {
                        get {
-                               return (SqlError) errorList[index];
+                               return (PgSqlError) errorList[index];
                        }
                }
 
@@ -86,7 +86,7 @@ namespace System.Data.SqlClient
                }
                #endregion
 
-               internal void Add(SqlError error) {
+               internal void Add(PgSqlError error) {
                        errorList.Add(error);
                }
 
@@ -94,7 +94,7 @@ namespace System.Data.SqlClient
                        string message, int number, string procedure,
                        string server, string source, byte state) {
                        
-                       SqlError error = new SqlError(theClass,
+                       PgSqlError error = new PgSqlError(theClass,
                                lineNumber, message,
                                number, procedure,
                                server, source, state);
@@ -104,7 +104,7 @@ namespace System.Data.SqlClient
                #region Destructors
 
                [MonoTODO]
-               ~SqlErrorCollection()
+               ~PgSqlErrorCollection()
                {
                        // FIXME: do the destructor - release resources
                }
index e447b5993721be783e28203f95168c3162a5728c..854b6cc4b2d5bd76fd06b4f75c39180a553e4420 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlException.cs
+// Mono.Data.PostgreSqlClient.PgSqlException.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -11,26 +11,26 @@ using System;
 using System.Data;
 using System.Runtime.Serialization;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
        /// <summary>
        /// Exceptions, as returned by SQL databases.
        /// </summary>
-       public sealed class SqlException : SystemException
+       public sealed class PgSqlException : SystemException
        {
-               private SqlErrorCollection errors; 
+               private PgSqlErrorCollection errors; 
 
-               internal SqlException() 
+               internal PgSqlException() 
                        : base("a SQL Exception has occurred") {
-                       errors = new SqlErrorCollection();
+                       errors = new PgSqlErrorCollection();
                }
 
-               internal SqlException(byte theClass, int lineNumber,
+               internal PgSqlException(byte theClass, int lineNumber,
                        string message, int number, string procedure,
                        string server, string source, byte state) 
                                : base(message) {       
                        
-                       errors = new SqlErrorCollection (theClass, 
+                       errors = new PgSqlErrorCollection (theClass, 
                                lineNumber, message,
                                number, procedure,
                                server, source, state);
@@ -53,7 +53,7 @@ namespace System.Data.SqlClient
                }
 
                [MonoTODO]
-               public SqlErrorCollection Errors {
+               public PgSqlErrorCollection Errors {
                        get { 
                                return errors;
                        }
@@ -195,7 +195,7 @@ namespace System.Data.SqlClient
                }
 
                [MonoTODO]
-               ~SqlException() {
+               ~PgSqlException() {
                        // FIXME: destructor to release resources
                }
 
index df69dff1d35c67015d3e73a20c0d9438714cb111..f2a7a7e8a81214d12792b47eb4e1ac923173a54b 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlInfoMessageEventArgs.cs
+// Mono.Data.PostgreSqlClient.PgSqlInfoMessageEventArgs.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
 using System;
 using System.Data;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
-       public sealed class SqlInfoMessageEventArgs : EventArgs
+       public sealed class PgSqlInfoMessageEventArgs : EventArgs
        {
                [MonoTODO]
-               public SqlErrorCollection Errors {
+               public PgSqlErrorCollection Errors {
                        get { 
                                throw new NotImplementedException (); 
                        }
@@ -44,7 +44,7 @@ namespace System.Data.SqlClient
                }
 
                //[MonoTODO]
-               //~SqlInfoMessageEventArgs() {
+               //~PgSqlInfoMessageEventArgs() {
                        // FIXME: destructor needs to release resources
                //}
        }
index c9862d61c03250ac9d33688a6afd1791b5d93dbf..d96fc3f7050fa7e42bff618a14bdf58d20143b95 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlInfoMessageEventHandler.cs
+// Mono.Data.PostgreSqlClient.PgSqlInfoMessageEventHandler.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -11,9 +11,9 @@
 using System;
 using System.Data;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
        public delegate void 
-       SqlInfoMessageEventHandler (object sender,
-                               SqlInfoMessageEventArgs e);
+       PgSqlInfoMessageEventHandler (object sender,
+                               PgSqlInfoMessageEventArgs e);
 }
index 6c05695eafc08858d12a086b25001d6d22ea7860..287febfcf423bf0253127eb2c69373210132d73a 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlParameter.cs
+// Mono.Data.PostgreSqlClient.PgSqlParameter.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -13,16 +13,16 @@ using System.Data;
 using System.Data.Common;
 using System.Runtime.InteropServices;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
        /// <summary>
        /// Represents a parameter to a Command object, and optionally, 
        /// its mapping to DataSet columns; and is implemented by .NET 
        /// data providers that access data sources.
        /// </summary>
-       //public sealed class SqlParameter : MarshalByRefObject,
+       //public sealed class PgSqlParameter : MarshalByRefObject,
        //      IDbDataParameter, IDataParameter, ICloneable
-       public sealed class SqlParameter : IDbDataParameter, IDataParameter
+       public sealed class PgSqlParameter : IDbDataParameter, IDataParameter
        {
                private string parmName;
                private SqlDbType dbtype;
@@ -38,24 +38,24 @@ namespace System.Data.SqlClient
                private int offset;
 
                [MonoTODO]
-               public SqlParameter () {
+               public PgSqlParameter () {
                
                }
 
                [MonoTODO]
-               public SqlParameter (string parameterName, object value) {
+               public PgSqlParameter (string parameterName, object value) {
                        this.parmName = parameterName;
                        this.objValue = value;
                }
                
                [MonoTODO]
-               public SqlParameter(string parameterName, SqlDbType dbType) {
+               public PgSqlParameter(string parameterName, SqlDbType dbType) {
                        this.parmName = parameterName;
                        this.dbtype = dbType;
                }
 
                [MonoTODO]
-               public SqlParameter(string parameterName, SqlDbType dbType,
+               public PgSqlParameter(string parameterName, SqlDbType dbType,
                        int size) {
 
                        this.parmName = parameterName;
@@ -64,7 +64,7 @@ namespace System.Data.SqlClient
                }
                
                [MonoTODO]
-               public SqlParameter(string parameterName, SqlDbType dbType,
+               public PgSqlParameter(string parameterName, SqlDbType dbType,
                        int size, string sourceColumn) {
 
                        this.parmName = parameterName;
@@ -74,7 +74,7 @@ namespace System.Data.SqlClient
                }
                         
                [MonoTODO]
-               public SqlParameter(string parameterName, SqlDbType dbType,
+               public PgSqlParameter(string parameterName, SqlDbType dbType,
                        int size, ParameterDirection direction, 
                        bool isNullable, byte precision,
                        byte scale, string sourceColumn,
index c1778299b866d4389f3a7a7cb8b08c464c512d3f..0cd47323cd2097d4f31a9a0d91854746a1e797e8 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlParameterCollection.cs
+// Mono.Data.PostgreSqlClient.PgSqlParameterCollection.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -14,15 +14,15 @@ using System.Data;
 using System.Data.Common;
 using System.Collections;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
        /// <summary>
        /// Collects all parameters relevant to a Command object 
        /// and their mappings to DataSet columns.
        /// </summary>
-       // public sealed class SqlParameterCollection : MarshalByRefObject,
+       // public sealed class PgSqlParameterCollection : MarshalByRefObject,
        // IDataParameterCollection, IList, ICollection, IEnumerable
-       public sealed class SqlParameterCollection : IDataParameterCollection,
+       public sealed class PgSqlParameterCollection : IDataParameterCollection,
                IList
        {
                private ArrayList parameterList = new ArrayList();
@@ -38,24 +38,24 @@ namespace System.Data.SqlClient
                {
                        // Call the add version that receives a SqlParameter 
                        
-                       // Check if value is a SqlParameter.
+                       // Check if value is a PgSqlParameter.
                        CheckType(value);
-                       Add((SqlParameter) value);
+                       Add((PgSqlParameter) value);
 
                        return IndexOf (value);
                }
 
                
-               public SqlParameter Add(SqlParameter value)
+               public PgSqlParameter Add(PgSqlParameter value)
                {
                        parameterList.Add(value);
                        return value;
                }
 
                
-               public SqlParameter Add(string parameterName, object value)
+               public PgSqlParameter Add(string parameterName, object value)
                {
-                       SqlParameter sqlparam = new SqlParameter();
+                       PgSqlParameter sqlparam = new PgSqlParameter();
                        sqlparam.Value = value;
                        // TODO: Get the dbtype and Sqldbtype from system type of value.
                        
@@ -63,19 +63,19 @@ namespace System.Data.SqlClient
                }
 
                
-               public SqlParameter Add(string parameterName, SqlDbType sqlDbType)
+               public PgSqlParameter Add(string parameterName, SqlDbType sqlDbType)
                {
-                       SqlParameter sqlparam = new SqlParameter();
+                       PgSqlParameter sqlparam = new PgSqlParameter();
                        sqlparam.ParameterName = parameterName;
                        sqlparam.SqlDbType = sqlDbType;
                        return Add(sqlparam);                   
                }
 
                
-               public SqlParameter Add(string parameterName,
+               public PgSqlParameter Add(string parameterName,
                        SqlDbType sqlDbType, int size)
                {
-                       SqlParameter sqlparam = new SqlParameter();
+                       PgSqlParameter sqlparam = new PgSqlParameter();
                        sqlparam.ParameterName = parameterName;
                        sqlparam.SqlDbType = sqlDbType;
                        sqlparam.Size = size;
@@ -83,10 +83,10 @@ namespace System.Data.SqlClient
                }
 
                
-               public SqlParameter Add(string parameterName,
+               public PgSqlParameter Add(string parameterName,
                        SqlDbType sqlDbType, int size, string sourceColumn)
                {
-                       SqlParameter sqlparam = new SqlParameter();
+                       PgSqlParameter sqlparam = new PgSqlParameter();
                        sqlparam.ParameterName = parameterName;
                        sqlparam.SqlDbType = sqlDbType;
                        sqlparam.Size = size;
@@ -105,7 +105,7 @@ namespace System.Data.SqlClient
                {
                        // Check if value is a SqlParameter
                        CheckType(value);
-                       return Contains(((SqlParameter)value).ParameterName);
+                       return Contains(((PgSqlParameter)value).ParameterName);
                }
 
 
@@ -113,7 +113,7 @@ namespace System.Data.SqlClient
                public bool Contains(string value)
                {
                        for(int p = 0; p < parameterList.Count; p++) {
-                               if(((SqlParameter)parameterList[p]).ParameterName.Equals(value))
+                               if(((PgSqlParameter)parameterList[p]).ParameterName.Equals(value))
                                        return true;
                        }
                        return false;
@@ -130,7 +130,7 @@ namespace System.Data.SqlClient
                {
                        // Check if value is a SqlParameter
                        CheckType(value);
-                       return IndexOf(((SqlParameter)value).ParameterName);
+                       return IndexOf(((PgSqlParameter)value).ParameterName);
                }
 
                
@@ -139,7 +139,7 @@ namespace System.Data.SqlClient
                        int p = -1;
 
                        for(p = 0; p < parameterList.Count; p++) {
-                               if(((SqlParameter)parameterList[p]).ParameterName.Equals(parameterName))
+                               if(((PgSqlParameter)parameterList[p]).ParameterName.Equals(parameterName))
                                        return p;
                        }
                        return p;
@@ -179,22 +179,22 @@ namespace System.Data.SqlClient
                object IList.this[int index] {
                        [MonoTODO]
                        get { 
-                               return (SqlParameter) this[index];
+                               return (PgSqlParameter) this[index];
                        }
                        
                        [MonoTODO]
                        set { 
-                               this[index] = (SqlParameter) value;
+                               this[index] = (PgSqlParameter) value;
                        }
                }
 
-               public SqlParameter this[int index] {
+               public PgSqlParameter this[int index] {
                        get {   
-                               return (SqlParameter) parameterList[index];
+                               return (PgSqlParameter) parameterList[index];
                        }                         
                        
                        set {   
-                               parameterList[index] = (SqlParameter) value;
+                               parameterList[index] = (PgSqlParameter) value;
                        }                         
                }
 
@@ -207,22 +207,22 @@ namespace System.Data.SqlClient
                        [MonoTODO]
                        set { 
                                CheckType(value);
-                               this[parameterName] = (SqlParameter) value;
+                               this[parameterName] = (PgSqlParameter) value;
                        }
                }
 
-               public SqlParameter this[string parameterName] {
+               public PgSqlParameter this[string parameterName] {
                        get {   
                                for(int p = 0; p < parameterList.Count; p++) {
-                                       if(parameterName.Equals(((SqlParameter)parameterList[p]).ParameterName))
-                                               return (SqlParameter) parameterList[p];
+                                       if(parameterName.Equals(((PgSqlParameter)parameterList[p]).ParameterName))
+                                               return (PgSqlParameter) parameterList[p];
                                }
                                throw new IndexOutOfRangeException("The specified name does not exist: " + parameterName);
                        }         
                        
                        set {   
                                for(int p = 0; p < parameterList.Count; p++) {
-                                       if(parameterName.Equals(((SqlParameter)parameterList[p]).ParameterName))
+                                       if(parameterName.Equals(((PgSqlParameter)parameterList[p]).ParameterName))
                                                parameterList[p] = value;
                                }
                                throw new IndexOutOfRangeException("The specified name does not exist: " + parameterName);
@@ -255,12 +255,12 @@ namespace System.Data.SqlClient
                
                /// <summary>
                /// This method checks if the parameter value is of 
-               /// SqlParameter type. If it doesn't, throws an InvalidCastException.
+               /// PgSqlParameter type. If it doesn't, throws an InvalidCastException.
                /// </summary>
                private void CheckType(object value)
                {
-                       if(!(value is SqlParameter))
-                               throw new InvalidCastException("Only SQLParameter objects can be used.");
+                       if(!(value is PgSqlParameter))
+                               throw new InvalidCastException("Only PgSqlParameter objects can be used.");
                }
                
        }
index dbc5789aa95eb0b46b18a7a34885813c53241130..1b7beb61461c452ad332fd34e8c96e5839169795 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlRowUpdatedEventArgs.cs
+// Mono.Data.PostgreSqlClient.PgSqlRowUpdatedEventArgs.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -12,23 +12,23 @@ using System;
 using System.Data;
 using System.Data.Common;
 
-namespace System.Data.SqlClient {
-       public sealed class SqlRowUpdatedEventArgs : RowUpdatedEventArgs 
+namespace Mono.Data.PostgreSqlClient {
+       public sealed class PgSqlRowUpdatedEventArgs : RowUpdatedEventArgs 
        {
                [MonoTODO]
-               public SqlRowUpdatedEventArgs (DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) 
+               public PgSqlRowUpdatedEventArgs (DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) 
                        : base (row, command, statementType, tableMapping)
                {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public new SqlCommand Command {
+               public new PgSqlCommand Command {
                        get { throw new NotImplementedException (); }
                }
 
                [MonoTODO]
-               ~SqlRowUpdatedEventArgs () 
+               ~PgSqlRowUpdatedEventArgs () 
                {
                        throw new NotImplementedException ();
                }
index 8cad2f1cbca5190b5c6ecf31a5cb95e4b01131e9..c577aabc8d134505a6cbd1715068a42d16ad31a3 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlRowUpdatedEventHandler.cs
+// Mono.Data.PostgreSqlClient.PgSqlRowUpdatedEventHandler.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -11,8 +11,8 @@
 using System;
 using System.Data;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
-       public delegate void SqlRowUpdatedEventHandler(object sender,
-                                       SqlRowUpdatedEventArgs e);
+       public delegate void PgSqlRowUpdatedEventHandler(object sender,
+                                       PgSqlRowUpdatedEventArgs e);
 }
index 6194ca1f95de75bbd8f59c5517f98293070ce4e8..f61e2f6933802bedd2734c1a7598ef7d86858c51 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlRowUpdatingEventArgs.cs
+// Mono.Data.PostgreSqlClient.PgSqlRowUpdatingEventArgs.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -12,19 +12,19 @@ using System;
 using System.Data;
 using System.Data.Common;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
-       public sealed class SqlRowUpdatingEventArgs : RowUpdatingEventArgs
+       public sealed class PgSqlRowUpdatingEventArgs : RowUpdatingEventArgs
        {
                [MonoTODO]
-               public SqlRowUpdatingEventArgs (DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) 
+               public PgSqlRowUpdatingEventArgs (DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) 
                        : base (row, command, statementType, tableMapping)
                {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public new SqlCommand Command {
+               public new PgSqlCommand Command {
                        get {
                                throw new NotImplementedException ();
                        } 
@@ -35,7 +35,7 @@ namespace System.Data.SqlClient
                }
 
                [MonoTODO]
-               ~SqlRowUpdatingEventArgs() 
+               ~PgSqlRowUpdatingEventArgs() 
                {
                        throw new NotImplementedException ();
                }
index 69c0228534dd36088b74c9a9fc823d5ee35eec79..672239c23d8ea21858e249a6f81a178a7f97c640 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlRowUpdatingEventHandler.cs
+// Mono.Data.PostgreSqlClient.PgSqlRowUpdatingEventHandler.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -11,8 +11,8 @@
 using System;
 using System.Data;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
-       public delegate void SqlRowUpdatingEventHandler(object sender,
-                       SqlRowUpdatingEventArgs e);
+       public delegate void PgSqlRowUpdatingEventHandler(object sender,
+                       PgSqlRowUpdatingEventArgs e);
 }
index 3a485b299c5abdd730f5383c7b2a83f1abf554d0..e3d0a87b2a2e618eb94bd82d3d71d58f4eb32af2 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.SqlTransaction.cs
+// Mono.Data.PostgreSqlClient.PgSqlTransaction.cs
 //
 // Author:
 //   Rodrigo Moya (rodrigo@ximian.com)
@@ -16,19 +16,19 @@ using System;
 using System.Data;
 using System.Data.Common;
 
-namespace System.Data.SqlClient
+namespace Mono.Data.PostgreSqlClient
 {
        /// <summary>
        /// Represents a transaction to be performed on a SQL database.
        /// </summary>
-       // public sealed class SqlTransaction : MarshalByRefObject,
+       // public sealed class PgSqlTransaction : MarshalByRefObject,
        //      IDbTransaction, IDisposable
-       public sealed class SqlTransaction : IDbTransaction
+       public sealed class PgSqlTransaction : IDbTransaction
        {
                #region Fields
 
                private bool doingTransaction = false;
-               private SqlConnection conn = null;
+               private PgSqlConnection conn = null;
                private IsolationLevel isolationLevel = 
                        IsolationLevel.ReadCommitted;
                // There are only two IsolationLevel's for PostgreSQL:
@@ -49,7 +49,7 @@ namespace System.Data.SqlClient
                                        "thus PostgreSQL can not " +
                                        "Commit transaction.");
                        
-                       SqlCommand cmd = new SqlCommand("COMMIT", conn);
+                       PgSqlCommand cmd = new PgSqlCommand("COMMIT", conn);
                        cmd.ExecuteNonQuery();
                                                
                        doingTransaction = false;
@@ -65,7 +65,7 @@ namespace System.Data.SqlClient
                                        "thus PostgreSQL can not " +
                                        "Rollback transaction.");
                        
-                       SqlCommand cmd = new SqlCommand("ROLLBACK", conn);
+                       PgSqlCommand cmd = new PgSqlCommand("ROLLBACK", conn);
                        cmd.ExecuteNonQuery();
                                                
                        doingTransaction = false;
@@ -88,7 +88,7 @@ namespace System.Data.SqlClient
 
                #endregion // Public Methods
 
-               #region Internal Methods to System.Data.dll Assembly
+               #region Internal Methods to Mono.Data.PostgreSqlClient.dll Assembly
 
                internal void Begin()
                {
@@ -98,7 +98,7 @@ namespace System.Data.SqlClient
                                        "and PostgreSQL does not " +
                                        "support nested transactions.");
                        
-                       SqlCommand cmd = new SqlCommand("BEGIN", conn);
+                       PgSqlCommand cmd = new PgSqlCommand("BEGIN", conn);
                        cmd.ExecuteNonQuery();
                                                
                        doingTransaction = true;
@@ -124,13 +124,13 @@ namespace System.Data.SqlClient
                                        //   ReadCommitted or Serializable
                                        break;
                        }
-                       SqlCommand cmd = new SqlCommand(sSql, conn);
+                       PgSqlCommand cmd = new PgSqlCommand(sSql, conn);
                        cmd.ExecuteNonQuery();
 
                        this.isolationLevel = isoLevel;
                }
 
-               internal void SetConnection(SqlConnection connection)
+               internal void SetConnection(PgSqlConnection connection)
                {
                        this.conn = connection;
                }
@@ -145,7 +145,7 @@ namespace System.Data.SqlClient
                        }
                }
 
-               public SqlConnection Connection {
+               public PgSqlConnection Connection       {
                        get { 
                                return conn; 
                        }
@@ -180,7 +180,7 @@ namespace System.Data.SqlClient
                [MonoTODO]
                // [Serializable]\r
                // [ClassInterface(ClassInterfaceType.AutoDual)]
-               ~SqlTransaction() {
+               ~PgSqlTransaction() {
                        // FIXME: need to properly release resources
                        // Dispose(false);
                }
index 493afcd49e2742fdad23135794f6cdd32553f2cb..7fe06e40b914f016be65f50c19ce5a3f9b595017 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Data.SqlClient.PostgresLibrary.cs  
+// Mono.Data.PostgreSqlClient.PostgresLibrary.cs  
 //
 // PInvoke methods to libpq
 // which is PostgreSQL client library
@@ -23,7 +23,7 @@ using System.Runtime.InteropServices;
 using System.Diagnostics;
 using System.Collections;
 
-namespace System.Data.SqlClient {
+namespace Mono.Data.PostgreSqlClient {
 
        /* IMPORTANT: DO NOT CHANGE ANY OF THESE ENUMS BELOW */
        
index 6a086a82a42323d8297ac4f0ec720265f74f01fa..b20742876f88e27c09f18d5171d986aa59a08d42 100644 (file)
 \r
 // Note: this might become PostgresType and PostgresTypeCollection\r
 //       also, the PostgresTypes that exist as an inner internal class\r
-//       within SqlConnection maybe moved here in the future\r
+//       within PgSqlConnection maybe moved here in the future\r
 \r
 using System;\r
 using System.Collections;\r
 using System.Data;\r
 using System.Data.Common;\r
-using System.Data.SqlClient;\r
 using System.Text;\r
 \r
-namespace System.Data.SqlClient {\r
+namespace Mono.Data.PostgreSqlClient {\r
 \r
        internal struct PostgresType {\r
                public int oid;\r
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/TODOAttribute.cs b/mcs/class/Mono.Data.PostgreSqlClient/TODOAttribute.cs
new file mode 100644 (file)
index 0000000..dd7e68a
--- /dev/null
@@ -0,0 +1,33 @@
+//
+// TODOAttribute.cs
+//
+// Author:
+//   Ravi Pratap (ravi@ximian.com)
+//
+// (C) Ximian, Inc.  http://www.ximian.com
+//
+using System;
+
+namespace Mono.Data.PostgreSqlClient {
+
+       /// <summary>
+       ///   The TODO attribute is used to flag all incomplete bits in our class libraries
+       /// </summary>
+       ///
+       /// <remarks>
+       ///   Use this to decorate any element which you think is not complete
+       /// </remarks>
+       [AttributeUsage (AttributeTargets.All)]
+       internal class MonoTODOAttribute : Attribute {
+
+               string comment;
+
+               public MonoTODOAttribute ()
+               {}
+
+               public MonoTODOAttribute (string comment)
+               {
+                       this.comment = comment;
+               }
+       }
+}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/library-deps.stamp b/mcs/class/Mono.Data.PostgreSqlClient/library-deps.stamp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/list b/mcs/class/Mono.Data.PostgreSqlClient/list
new file mode 100644 (file)
index 0000000..fff49e9
--- /dev/null
@@ -0,0 +1,14 @@
+Mono.Data.PostgreSqlClient/ParmUtil.cs
+Mono.Data.PostgreSqlClient/PostgresLibrary.cs
+Mono.Data.PostgreSqlClient/PostgresTypes.cs
+Mono.Data.PostgreSqlClient/SqlCommand.cs
+Mono.Data.PostgreSqlClient/SqlConnection.cs
+Mono.Data.PostgreSqlClient/SqlDataReader.cs
+Mono.Data.PostgreSqlClient/SqlError.cs
+Mono.Data.PostgreSqlClient/SqlErrorCollection.cs
+Mono.Data.PostgreSqlClient/SqlException.cs
+Mono.Data.PostgreSqlClient/SqlInfoMessageEventArgs.cs
+Mono.Data.PostgreSqlClient/SqlInfoMessageEventHandler.cs
+Mono.Data.PostgreSqlClient/SqlParameter.cs
+Mono.Data.PostgreSqlClient/SqlParameterCollection.cs
+Mono.Data.PostgreSqlClient/SqlTransaction.cs
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/makefile.gnu b/mcs/class/Mono.Data.PostgreSqlClient/makefile.gnu
new file mode 100644 (file)
index 0000000..1809b06
--- /dev/null
@@ -0,0 +1,15 @@
+topdir = ../..
+
+LIBRARY = $(topdir)/class/lib/Mono.Data.PostgreSqlClient.dll
+
+LIB_LIST = list
+LIB_FLAGS = -r corlib -r System -r System.Xml -r System.Data
+
+SOURCES_INCLUDE=*.cs
+SOURCES_EXCLUDE=\
+       ./Test* \
+       ./System.Xml*
+
+export MONO_PATH_PREFIX = $(topdir)/class/lib:
+
+include $(topdir)/class/library.make