--- /dev/null
+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
--- /dev/null
+//
+// 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;
+ }
+ }
+}
--- /dev/null
+<?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
--- /dev/null
+//
+// 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;
+ }
+ }
+}
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
\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
}\r
}\r
\r
- public ParmUtil(string query, SqlParameterCollection parms) {\r
+ public ParmUtil(string query, PgSqlParameterCollection parms) {\r
sql = query;\r
parmsCollection = parms;\r
}\r
#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
//
-// System.Data.SqlClient.SqlClientPermission.cs
+// Mono.Data.PostgreSqlClient.PgSqlClientPermission.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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 ();
}
}
[MonoTODO]
- ~SqlClientPermission() {
+ ~PgSqlClientPermission() {
// FIXME: destructor to release resources
}
}
//
-// System.Data.SqlClient.SqlClientPermissionAttribute.cs
+// Mono.Data.PostgreSqlClient.PgSqlClientPermissionAttribute.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
using System.Security;
using System.Security.Permissions;
-namespace System.Data.SqlClient {
+namespace Mono.Data.PostgreSqlClient {
[AttributeUsage(AttributeTargets.Assembly |
AttributeTargets.Class |
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
}
//[MonoTODO]
- //~SqlClientPermissionAttribute() {
+ //~PgSqlClientPermissionAttribute() {
// // FIXME: destructor to release resources
//}
}
//
-// System.Data.SqlClient.SqlCommand.cs
+// Mono.Data.PostgreSqlClient.PgSqlCommand.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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
// 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;
#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;
}
[MonoTODO]
- public SqlParameter CreateParameter () {
- return new SqlParameter ();
+ public PgSqlParameter CreateParameter () {
+ return new PgSqlParameter ();
}
public int ExecuteNonQuery () {
PostgresLibrary.PQclear (pgResult);
pgResult = IntPtr.Zero;
\r
- throw new SqlException(0, 0,
+ throw new PgSqlException(0, 0,
errorMessage, 0, "",
conn.DataSource, "SqlCommand", 0);\r
}
}
[MonoTODO]
- public SqlDataReader ExecuteReader () {
+ public PgSqlDataReader ExecuteReader () {
return ExecuteReader(CommandBehavior.Default);
}
}
[MonoTODO]
- public SqlDataReader ExecuteReader (CommandBehavior behavior)
+ public PgSqlDataReader ExecuteReader (CommandBehavior behavior)
{
if(conn.State != ConnectionState.Open)
throw new InvalidOperationException(
queries = null;
currentQuery = -1;
- dataReader = new SqlDataReader(this);
+ dataReader = new PgSqlDataReader(this);
queries = sql.Split(new Char[] {';'});
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;
return statement;
}
- private void ExecuteQuery (string query, SqlResult res)
+ private void ExecuteQuery (string query, PgSqlResult res)
{
IntPtr pgResult;
PostgresLibrary.PQclear (pgResult);
pgResult = IntPtr.Zero;
\r
- throw new SqlException(0, 0,
+ throw new PgSqlException(0, 0,
errorMessage, 0, "",
conn.DataSource, "SqlCommand", 0);\r
}
// only meant to be used between SqlConnectioin,
// SqlCommand, and SqlDataReader
- internal void OpenReader(SqlDataReader reader) {
+ internal void OpenReader(PgSqlDataReader reader) {
conn.OpenReader(reader);
}
PostgresLibrary.PQclear (pgResult);
pgResult = IntPtr.Zero;
\r
- throw new SqlException(0, 0,
+ throw new PgSqlException(0, 0,
errorMessage, 0, "",
conn.DataSource, "SqlCommand", 0);\r
}
}
[MonoTODO]
- public SqlCommand Clone () {
+ public PgSqlCommand Clone () {
throw new NotImplementedException ();
}
// transaction in progress
// csc
- Connection = (SqlConnection) value;
+ Connection = (PgSqlConnection) value;
// mcs
// Connection = value;
}
}
- public SqlConnection Connection {
+ public PgSqlConnection Connection {
get {
// conn defaults to null
return conn;
}
}
- public SqlParameterCollection Parameters {
+ public PgSqlParameterCollection Parameters {
get {
return parmCollection;
}
// has already begun
// csc
- Transaction = (SqlTransaction) value;
+ Transaction = (PgSqlTransaction) value;
// mcs
// Transaction = value;
}
}
- public SqlTransaction Transaction {
+ public PgSqlTransaction Transaction {
get {
return trans;
}
}
[MonoTODO]
- ~SqlCommand() {
+ ~PgSqlCommand() {
// FIXME: need proper way to release resources
// Dispose(false);
}
// 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
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;
}
- internal SqlConnection Connection {
+ internal PgSqlConnection Connection {
get {
return con;
}
//
-// System.Data.SqlClient.SqlCommandBuilder.cs
+// Mono.Data.PostgreSqlClient.PgSqlCommandBuilder.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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
}\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
}\r
\r
[MonoTODO]\r
- ~SqlCommandBuilder() {\r
+ ~PgSqlCommandBuilder() {\r
// FIXME: create destructor - release resources\r
}\r
}\r
//
-// System.Data.SqlClient.SqlConnection.cs
+// Mono.Data.PostgreSqlClient.PgSqlConnection.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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
// 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
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
// 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);
}
// aka Finalize()
// [ClassInterface(ClassInterfaceType.AutoDual)]
[MonoTODO]
- ~SqlConnection() {
+ ~PgSqlConnection() {
Dispose (false);
}
return BeginTransaction ();
}
- public SqlTransaction BeginTransaction () {
+ public PgSqlTransaction BeginTransaction () {
return TransactionBegin (); // call private method
}
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
}
return CreateCommand ();
}
- public SqlCommand CreateCommand () {
- SqlCommand sqlcmd = new SqlCommand ("", this);
+ public PgSqlCommand CreateCommand () {
+ PgSqlCommand sqlcmd = new PgSqlCommand ("", this);
return sqlcmd;
}
PQerrorMessage (pgConn);
errorMessage += ": Could not connect to database.";
- throw new SqlException(0, 0,
+ throw new PgSqlException(0, 0,
errorMessage, 0, "",
host, "SqlConnection", 0);
}
// 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?
private string GetDatabaseServerVersion()
{
- SqlCommand cmd = new SqlCommand("select version()",this);
+ PgSqlCommand cmd = new PgSqlCommand("select version()",this);
return (string) cmd.ExecuteScalar();
}
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();
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);
// For System.Data.SqlClient classes
// to get the current transaction
// in progress - if any
- internal SqlTransaction Transaction {
+ internal PgSqlTransaction Transaction {
get {
return trans;
}
#region Events
public event
- SqlInfoMessageEventHandler InfoMessage;
+ PgSqlInfoMessageEventHandler InfoMessage;
public event
StateChangeEventHandler StateChange;
private Hashtable hashTypes;
private ArrayList pgTypes;
- private SqlConnection con;
+ private PgSqlConnection con;
// Got this SQL with the permission from
// the authors of libgda
"'smgr', 'tid', 'unknown', 'xid') " +
"ORDER BY typname";
- internal PostgresTypes(SqlConnection sqlcon) {
+ internal PostgresTypes(PgSqlConnection sqlcon) {
con = sqlcon;
hashTypes = new Hashtable();
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);
}
PostgresLibrary.PQclear (pgResult);
pgResult = IntPtr.Zero;
\r
- throw new SqlException(0, 0,
+ throw new PgSqlException(0, 0,
errorMessage, 0, "",
con.DataSource, "SqlConnection", 0);\r
}
//
-// System.Data.SqlClient.SqlDataAdapter.cs
+// Mono.Data.PostgreSqlClient.PgSqlDataAdapter.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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();
#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))
{
}
#region Properties
- public SqlCommand DeleteCommand {
+ public PgSqlCommand DeleteCommand {
get {
return deleteCommand;
}
}
}
- public SqlCommand InsertCommand {
+ public PgSqlCommand InsertCommand {
get {
return insertCommand;
}
}
}
- public SqlCommand SelectCommand {
+ public PgSqlCommand SelectCommand {
get {
return selectCommand;
}
}
}
- public SqlCommand UpdateCommand {
+ public PgSqlCommand UpdateCommand {
get {
return updateCommand;
}
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;
}
}
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); }
}
//
-// System.Data.SqlClient.SqlDataReader.cs
+// Mono.Data.PostgreSqlClient.PgSqlDataReader.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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
#region Constructors
- internal SqlDataReader (SqlCommand sqlCmd) {
+ internal PgSqlDataReader (PgSqlCommand sqlCmd) {
cmd = sqlCmd;
open = true;
[MonoTODO]
public bool NextResult() {
- SqlResult res;
+ PgSqlResult res;
currentRow = -1;
bool resultReturned;
}
//[MonoTODO]
- //~SqlDataReader() {
+ //~PgSqlDataReader() {
//}
#endregion // Destructors
//
-// System.Data.SqlClient.SqlError.cs
+// Mono.Data.PostgreSqlClient.PgSqlError.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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;
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;
String stackTrace;
stackTrace = " <Stack Trace>";
// FIXME: generate the correct SQL error string
- toStr = "SqlError:" + message + stackTrace;
+ toStr = "PgSqlError:" + message + stackTrace;
return toStr;
}
//
-// System.Data.SqlClient.SqlError.cs
+// Mono.Data.PostgreSqlClient.PgSqlError.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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) {
// Index property (indexer)
// [MonoTODO]
- public SqlError this[int index] {
+ public PgSqlError this[int index] {
get {
- return (SqlError) errorList[index];
+ return (PgSqlError) errorList[index];
}
}
}
#endregion
- internal void Add(SqlError error) {
+ internal void Add(PgSqlError error) {
errorList.Add(error);
}
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);
#region Destructors
[MonoTODO]
- ~SqlErrorCollection()
+ ~PgSqlErrorCollection()
{
// FIXME: do the destructor - release resources
}
//
-// System.Data.SqlClient.SqlException.cs
+// Mono.Data.PostgreSqlClient.PgSqlException.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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);
}
[MonoTODO]
- public SqlErrorCollection Errors {
+ public PgSqlErrorCollection Errors {
get {
return errors;
}
}
[MonoTODO]
- ~SqlException() {
+ ~PgSqlException() {
// FIXME: destructor to release resources
}
//
-// 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 ();
}
}
//[MonoTODO]
- //~SqlInfoMessageEventArgs() {
+ //~PgSqlInfoMessageEventArgs() {
// FIXME: destructor needs to release resources
//}
}
//
-// System.Data.SqlClient.SqlInfoMessageEventHandler.cs
+// Mono.Data.PostgreSqlClient.PgSqlInfoMessageEventHandler.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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);
}
//
-// System.Data.SqlClient.SqlParameter.cs
+// Mono.Data.PostgreSqlClient.PgSqlParameter.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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;
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;
}
[MonoTODO]
- public SqlParameter(string parameterName, SqlDbType dbType,
+ public PgSqlParameter(string parameterName, SqlDbType dbType,
int size, string sourceColumn) {
this.parmName = parameterName;
}
[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,
//
-// System.Data.SqlClient.SqlParameterCollection.cs
+// Mono.Data.PostgreSqlClient.PgSqlParameterCollection.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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();
{
// 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.
}
- 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;
}
- 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;
{
// Check if value is a SqlParameter
CheckType(value);
- return Contains(((SqlParameter)value).ParameterName);
+ return Contains(((PgSqlParameter)value).ParameterName);
}
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;
{
// Check if value is a SqlParameter
CheckType(value);
- return IndexOf(((SqlParameter)value).ParameterName);
+ return IndexOf(((PgSqlParameter)value).ParameterName);
}
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;
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;
}
}
[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);
/// <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.");
}
}
//
-// System.Data.SqlClient.SqlRowUpdatedEventArgs.cs
+// Mono.Data.PostgreSqlClient.PgSqlRowUpdatedEventArgs.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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 ();
}
//
-// System.Data.SqlClient.SqlRowUpdatedEventHandler.cs
+// Mono.Data.PostgreSqlClient.PgSqlRowUpdatedEventHandler.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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);
}
//
-// System.Data.SqlClient.SqlRowUpdatingEventArgs.cs
+// Mono.Data.PostgreSqlClient.PgSqlRowUpdatingEventArgs.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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 ();
}
}
[MonoTODO]
- ~SqlRowUpdatingEventArgs()
+ ~PgSqlRowUpdatingEventArgs()
{
throw new NotImplementedException ();
}
//
-// System.Data.SqlClient.SqlRowUpdatingEventHandler.cs
+// Mono.Data.PostgreSqlClient.PgSqlRowUpdatingEventHandler.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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);
}
//
-// System.Data.SqlClient.SqlTransaction.cs
+// Mono.Data.PostgreSqlClient.PgSqlTransaction.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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:
"thus PostgreSQL can not " +
"Commit transaction.");
- SqlCommand cmd = new SqlCommand("COMMIT", conn);
+ PgSqlCommand cmd = new PgSqlCommand("COMMIT", conn);
cmd.ExecuteNonQuery();
doingTransaction = false;
"thus PostgreSQL can not " +
"Rollback transaction.");
- SqlCommand cmd = new SqlCommand("ROLLBACK", conn);
+ PgSqlCommand cmd = new PgSqlCommand("ROLLBACK", conn);
cmd.ExecuteNonQuery();
doingTransaction = false;
#endregion // Public Methods
- #region Internal Methods to System.Data.dll Assembly
+ #region Internal Methods to Mono.Data.PostgreSqlClient.dll Assembly
internal void Begin()
{
"and PostgreSQL does not " +
"support nested transactions.");
- SqlCommand cmd = new SqlCommand("BEGIN", conn);
+ PgSqlCommand cmd = new PgSqlCommand("BEGIN", conn);
cmd.ExecuteNonQuery();
doingTransaction = true;
// 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;
}
}
}
- public SqlConnection Connection {
+ public PgSqlConnection Connection {
get {
return conn;
}
[MonoTODO]
// [Serializable]\r
// [ClassInterface(ClassInterfaceType.AutoDual)]
- ~SqlTransaction() {
+ ~PgSqlTransaction() {
// FIXME: need to properly release resources
// Dispose(false);
}
//
-// System.Data.SqlClient.PostgresLibrary.cs
+// Mono.Data.PostgreSqlClient.PostgresLibrary.cs
//
// PInvoke methods to libpq
// which is PostgreSQL client library
using System.Diagnostics;
using System.Collections;
-namespace System.Data.SqlClient {
+namespace Mono.Data.PostgreSqlClient {
/* IMPORTANT: DO NOT CHANGE ANY OF THESE ENUMS BELOW */
\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
--- /dev/null
+//
+// 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;
+ }
+ }
+}
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
\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
}\r
}\r
\r
- public ParmUtil(string query, SqlParameterCollection parms) {\r
+ public ParmUtil(string query, PgSqlParameterCollection parms) {\r
sql = query;\r
parmsCollection = parms;\r
}\r
#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
//
-// System.Data.SqlClient.SqlClientPermission.cs
+// Mono.Data.PostgreSqlClient.PgSqlClientPermission.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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 ();
}
}
[MonoTODO]
- ~SqlClientPermission() {
+ ~PgSqlClientPermission() {
// FIXME: destructor to release resources
}
}
//
-// System.Data.SqlClient.SqlClientPermissionAttribute.cs
+// Mono.Data.PostgreSqlClient.PgSqlClientPermissionAttribute.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
using System.Security;
using System.Security.Permissions;
-namespace System.Data.SqlClient {
+namespace Mono.Data.PostgreSqlClient {
[AttributeUsage(AttributeTargets.Assembly |
AttributeTargets.Class |
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
}
//[MonoTODO]
- //~SqlClientPermissionAttribute() {
+ //~PgSqlClientPermissionAttribute() {
// // FIXME: destructor to release resources
//}
}
//
-// System.Data.SqlClient.SqlCommand.cs
+// Mono.Data.PostgreSqlClient.PgSqlCommand.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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
// 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;
#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;
}
[MonoTODO]
- public SqlParameter CreateParameter () {
- return new SqlParameter ();
+ public PgSqlParameter CreateParameter () {
+ return new PgSqlParameter ();
}
public int ExecuteNonQuery () {
PostgresLibrary.PQclear (pgResult);
pgResult = IntPtr.Zero;
\r
- throw new SqlException(0, 0,
+ throw new PgSqlException(0, 0,
errorMessage, 0, "",
conn.DataSource, "SqlCommand", 0);\r
}
}
[MonoTODO]
- public SqlDataReader ExecuteReader () {
+ public PgSqlDataReader ExecuteReader () {
return ExecuteReader(CommandBehavior.Default);
}
}
[MonoTODO]
- public SqlDataReader ExecuteReader (CommandBehavior behavior)
+ public PgSqlDataReader ExecuteReader (CommandBehavior behavior)
{
if(conn.State != ConnectionState.Open)
throw new InvalidOperationException(
queries = null;
currentQuery = -1;
- dataReader = new SqlDataReader(this);
+ dataReader = new PgSqlDataReader(this);
queries = sql.Split(new Char[] {';'});
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;
return statement;
}
- private void ExecuteQuery (string query, SqlResult res)
+ private void ExecuteQuery (string query, PgSqlResult res)
{
IntPtr pgResult;
PostgresLibrary.PQclear (pgResult);
pgResult = IntPtr.Zero;
\r
- throw new SqlException(0, 0,
+ throw new PgSqlException(0, 0,
errorMessage, 0, "",
conn.DataSource, "SqlCommand", 0);\r
}
// only meant to be used between SqlConnectioin,
// SqlCommand, and SqlDataReader
- internal void OpenReader(SqlDataReader reader) {
+ internal void OpenReader(PgSqlDataReader reader) {
conn.OpenReader(reader);
}
PostgresLibrary.PQclear (pgResult);
pgResult = IntPtr.Zero;
\r
- throw new SqlException(0, 0,
+ throw new PgSqlException(0, 0,
errorMessage, 0, "",
conn.DataSource, "SqlCommand", 0);\r
}
}
[MonoTODO]
- public SqlCommand Clone () {
+ public PgSqlCommand Clone () {
throw new NotImplementedException ();
}
// transaction in progress
// csc
- Connection = (SqlConnection) value;
+ Connection = (PgSqlConnection) value;
// mcs
// Connection = value;
}
}
- public SqlConnection Connection {
+ public PgSqlConnection Connection {
get {
// conn defaults to null
return conn;
}
}
- public SqlParameterCollection Parameters {
+ public PgSqlParameterCollection Parameters {
get {
return parmCollection;
}
// has already begun
// csc
- Transaction = (SqlTransaction) value;
+ Transaction = (PgSqlTransaction) value;
// mcs
// Transaction = value;
}
}
- public SqlTransaction Transaction {
+ public PgSqlTransaction Transaction {
get {
return trans;
}
}
[MonoTODO]
- ~SqlCommand() {
+ ~PgSqlCommand() {
// FIXME: need proper way to release resources
// Dispose(false);
}
// 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
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;
}
- internal SqlConnection Connection {
+ internal PgSqlConnection Connection {
get {
return con;
}
//
-// System.Data.SqlClient.SqlCommandBuilder.cs
+// Mono.Data.PostgreSqlClient.PgSqlCommandBuilder.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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
}\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
}\r
\r
[MonoTODO]\r
- ~SqlCommandBuilder() {\r
+ ~PgSqlCommandBuilder() {\r
// FIXME: create destructor - release resources\r
}\r
}\r
//
-// System.Data.SqlClient.SqlConnection.cs
+// Mono.Data.PostgreSqlClient.PgSqlConnection.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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
// 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
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
// 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);
}
// aka Finalize()
// [ClassInterface(ClassInterfaceType.AutoDual)]
[MonoTODO]
- ~SqlConnection() {
+ ~PgSqlConnection() {
Dispose (false);
}
return BeginTransaction ();
}
- public SqlTransaction BeginTransaction () {
+ public PgSqlTransaction BeginTransaction () {
return TransactionBegin (); // call private method
}
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
}
return CreateCommand ();
}
- public SqlCommand CreateCommand () {
- SqlCommand sqlcmd = new SqlCommand ("", this);
+ public PgSqlCommand CreateCommand () {
+ PgSqlCommand sqlcmd = new PgSqlCommand ("", this);
return sqlcmd;
}
PQerrorMessage (pgConn);
errorMessage += ": Could not connect to database.";
- throw new SqlException(0, 0,
+ throw new PgSqlException(0, 0,
errorMessage, 0, "",
host, "SqlConnection", 0);
}
// 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?
private string GetDatabaseServerVersion()
{
- SqlCommand cmd = new SqlCommand("select version()",this);
+ PgSqlCommand cmd = new PgSqlCommand("select version()",this);
return (string) cmd.ExecuteScalar();
}
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();
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);
// For System.Data.SqlClient classes
// to get the current transaction
// in progress - if any
- internal SqlTransaction Transaction {
+ internal PgSqlTransaction Transaction {
get {
return trans;
}
#region Events
public event
- SqlInfoMessageEventHandler InfoMessage;
+ PgSqlInfoMessageEventHandler InfoMessage;
public event
StateChangeEventHandler StateChange;
private Hashtable hashTypes;
private ArrayList pgTypes;
- private SqlConnection con;
+ private PgSqlConnection con;
// Got this SQL with the permission from
// the authors of libgda
"'smgr', 'tid', 'unknown', 'xid') " +
"ORDER BY typname";
- internal PostgresTypes(SqlConnection sqlcon) {
+ internal PostgresTypes(PgSqlConnection sqlcon) {
con = sqlcon;
hashTypes = new Hashtable();
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);
}
PostgresLibrary.PQclear (pgResult);
pgResult = IntPtr.Zero;
\r
- throw new SqlException(0, 0,
+ throw new PgSqlException(0, 0,
errorMessage, 0, "",
con.DataSource, "SqlConnection", 0);\r
}
//
-// System.Data.SqlClient.SqlDataAdapter.cs
+// Mono.Data.PostgreSqlClient.PgSqlDataAdapter.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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();
#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))
{
}
#region Properties
- public SqlCommand DeleteCommand {
+ public PgSqlCommand DeleteCommand {
get {
return deleteCommand;
}
}
}
- public SqlCommand InsertCommand {
+ public PgSqlCommand InsertCommand {
get {
return insertCommand;
}
}
}
- public SqlCommand SelectCommand {
+ public PgSqlCommand SelectCommand {
get {
return selectCommand;
}
}
}
- public SqlCommand UpdateCommand {
+ public PgSqlCommand UpdateCommand {
get {
return updateCommand;
}
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;
}
}
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); }
}
//
-// System.Data.SqlClient.SqlDataReader.cs
+// Mono.Data.PostgreSqlClient.PgSqlDataReader.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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
#region Constructors
- internal SqlDataReader (SqlCommand sqlCmd) {
+ internal PgSqlDataReader (PgSqlCommand sqlCmd) {
cmd = sqlCmd;
open = true;
[MonoTODO]
public bool NextResult() {
- SqlResult res;
+ PgSqlResult res;
currentRow = -1;
bool resultReturned;
}
//[MonoTODO]
- //~SqlDataReader() {
+ //~PgSqlDataReader() {
//}
#endregion // Destructors
//
-// System.Data.SqlClient.SqlError.cs
+// Mono.Data.PostgreSqlClient.PgSqlError.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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;
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;
String stackTrace;
stackTrace = " <Stack Trace>";
// FIXME: generate the correct SQL error string
- toStr = "SqlError:" + message + stackTrace;
+ toStr = "PgSqlError:" + message + stackTrace;
return toStr;
}
//
-// System.Data.SqlClient.SqlError.cs
+// Mono.Data.PostgreSqlClient.PgSqlError.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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) {
// Index property (indexer)
// [MonoTODO]
- public SqlError this[int index] {
+ public PgSqlError this[int index] {
get {
- return (SqlError) errorList[index];
+ return (PgSqlError) errorList[index];
}
}
}
#endregion
- internal void Add(SqlError error) {
+ internal void Add(PgSqlError error) {
errorList.Add(error);
}
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);
#region Destructors
[MonoTODO]
- ~SqlErrorCollection()
+ ~PgSqlErrorCollection()
{
// FIXME: do the destructor - release resources
}
//
-// System.Data.SqlClient.SqlException.cs
+// Mono.Data.PostgreSqlClient.PgSqlException.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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);
}
[MonoTODO]
- public SqlErrorCollection Errors {
+ public PgSqlErrorCollection Errors {
get {
return errors;
}
}
[MonoTODO]
- ~SqlException() {
+ ~PgSqlException() {
// FIXME: destructor to release resources
}
//
-// 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 ();
}
}
//[MonoTODO]
- //~SqlInfoMessageEventArgs() {
+ //~PgSqlInfoMessageEventArgs() {
// FIXME: destructor needs to release resources
//}
}
//
-// System.Data.SqlClient.SqlInfoMessageEventHandler.cs
+// Mono.Data.PostgreSqlClient.PgSqlInfoMessageEventHandler.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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);
}
//
-// System.Data.SqlClient.SqlParameter.cs
+// Mono.Data.PostgreSqlClient.PgSqlParameter.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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;
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;
}
[MonoTODO]
- public SqlParameter(string parameterName, SqlDbType dbType,
+ public PgSqlParameter(string parameterName, SqlDbType dbType,
int size, string sourceColumn) {
this.parmName = parameterName;
}
[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,
//
-// System.Data.SqlClient.SqlParameterCollection.cs
+// Mono.Data.PostgreSqlClient.PgSqlParameterCollection.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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();
{
// 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.
}
- 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;
}
- 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;
{
// Check if value is a SqlParameter
CheckType(value);
- return Contains(((SqlParameter)value).ParameterName);
+ return Contains(((PgSqlParameter)value).ParameterName);
}
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;
{
// Check if value is a SqlParameter
CheckType(value);
- return IndexOf(((SqlParameter)value).ParameterName);
+ return IndexOf(((PgSqlParameter)value).ParameterName);
}
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;
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;
}
}
[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);
/// <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.");
}
}
//
-// System.Data.SqlClient.SqlRowUpdatedEventArgs.cs
+// Mono.Data.PostgreSqlClient.PgSqlRowUpdatedEventArgs.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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 ();
}
//
-// System.Data.SqlClient.SqlRowUpdatedEventHandler.cs
+// Mono.Data.PostgreSqlClient.PgSqlRowUpdatedEventHandler.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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);
}
//
-// System.Data.SqlClient.SqlRowUpdatingEventArgs.cs
+// Mono.Data.PostgreSqlClient.PgSqlRowUpdatingEventArgs.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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 ();
}
}
[MonoTODO]
- ~SqlRowUpdatingEventArgs()
+ ~PgSqlRowUpdatingEventArgs()
{
throw new NotImplementedException ();
}
//
-// System.Data.SqlClient.SqlRowUpdatingEventHandler.cs
+// Mono.Data.PostgreSqlClient.PgSqlRowUpdatingEventHandler.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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);
}
//
-// System.Data.SqlClient.SqlTransaction.cs
+// Mono.Data.PostgreSqlClient.PgSqlTransaction.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
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:
"thus PostgreSQL can not " +
"Commit transaction.");
- SqlCommand cmd = new SqlCommand("COMMIT", conn);
+ PgSqlCommand cmd = new PgSqlCommand("COMMIT", conn);
cmd.ExecuteNonQuery();
doingTransaction = false;
"thus PostgreSQL can not " +
"Rollback transaction.");
- SqlCommand cmd = new SqlCommand("ROLLBACK", conn);
+ PgSqlCommand cmd = new PgSqlCommand("ROLLBACK", conn);
cmd.ExecuteNonQuery();
doingTransaction = false;
#endregion // Public Methods
- #region Internal Methods to System.Data.dll Assembly
+ #region Internal Methods to Mono.Data.PostgreSqlClient.dll Assembly
internal void Begin()
{
"and PostgreSQL does not " +
"support nested transactions.");
- SqlCommand cmd = new SqlCommand("BEGIN", conn);
+ PgSqlCommand cmd = new PgSqlCommand("BEGIN", conn);
cmd.ExecuteNonQuery();
doingTransaction = true;
// 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;
}
}
}
- public SqlConnection Connection {
+ public PgSqlConnection Connection {
get {
return conn;
}
[MonoTODO]
// [Serializable]\r
// [ClassInterface(ClassInterfaceType.AutoDual)]
- ~SqlTransaction() {
+ ~PgSqlTransaction() {
// FIXME: need to properly release resources
// Dispose(false);
}
//
-// System.Data.SqlClient.PostgresLibrary.cs
+// Mono.Data.PostgreSqlClient.PostgresLibrary.cs
//
// PInvoke methods to libpq
// which is PostgreSQL client library
using System.Diagnostics;
using System.Collections;
-namespace System.Data.SqlClient {
+namespace Mono.Data.PostgreSqlClient {
/* IMPORTANT: DO NOT CHANGE ANY OF THESE ENUMS BELOW */
\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
--- /dev/null
+//
+// 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;
+ }
+ }
+}
--- /dev/null
+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
--- /dev/null
+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