pgsqlclient-checkins Mailing List for PostgreSqlClient (Page 54)
Status: Inactive
Brought to you by:
carlosga_fb
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(120) |
Aug
(95) |
Sep
(95) |
Oct
(213) |
Nov
(114) |
Dec
(64) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(6) |
Feb
(134) |
Mar
(88) |
Apr
(28) |
May
(22) |
Jun
(15) |
Jul
(23) |
Aug
(2) |
Sep
(15) |
Oct
(2) |
Nov
(6) |
Dec
|
2005 |
Jan
(8) |
Feb
(6) |
Mar
|
Apr
(42) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
(84) |
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
(84) |
Apr
(46) |
May
(40) |
Jun
(8) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <car...@us...> - 2003-07-16 19:34:26
|
Update of /cvsroot/pgsqlclient/pgsqlclient In directory sc8-pr-cvs1:/tmp/cvs-serv1795 Modified Files: changelog.txt Log Message: Updated CHANGELOG.TXT Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/changelog.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** changelog.txt 16 Jul 2003 14:12:03 -0000 1.11 --- changelog.txt 16 Jul 2003 19:34:21 -0000 1.12 *************** *** 15,18 **** --- 15,24 ---- - Added better use of design time attributes. + * source/PGConnection.cs: + * source/PGDataReader.cs: + * source/PGDataAdapter.cs: + + - Added better use of design time attributes. + 2003-07-15 Carlos Guzmán Álvarez <car...@te...> |
From: <car...@us...> - 2003-07-16 19:33:25
|
Update of /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source In directory sc8-pr-cvs1:/tmp/cvs-serv1562 Modified Files: PGConnection.cs PGDataAdapter.cs PGDataReader.cs Log Message: Added better use of design time attributes. Index: PGConnection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/PGConnection.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PGConnection.cs 12 Jul 2003 13:57:59 -0000 1.2 --- PGConnection.cs 16 Jul 2003 19:33:21 -0000 1.3 *************** *** 53,57 **** #region PROPERTIES ! [Category("Data"), RefreshProperties(RefreshProperties.All)] public string ConnectionString { --- 53,61 ---- #region PROPERTIES ! [Category("Data"), ! RecommendedAsConfigurableAttribute(true), ! RefreshProperties(RefreshProperties.All), ! DefaultValue("")] ! // Editor(typeof(DesingTime.ConnectionStringUIEditor), typeof(System.Drawing.Design.UITypeEditor))] public string ConnectionString { *************** *** 68,71 **** --- 72,92 ---- } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public int ConnectionTimeout + { + get + { + if (dbConnection != null) + { + return dbConnection.Settings.Timeout; + } + else + { + return 15; + } + } + } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string Database { *************** *** 83,86 **** --- 104,108 ---- } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string DataSource { *************** *** 98,117 **** } ! public int ConnectionTimeout { get { if (dbConnection != null) { ! return dbConnection.Settings.Timeout; ! } ! else ! { ! return 15; } } } ! [Browsable(false)] public string ServerVersion { --- 120,140 ---- } ! [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] ! public int PacketSize { get { + int packetSize = 8192; if (dbConnection != null) { ! packetSize = dbConnection.Settings.PacketSize; } + + return packetSize; } } ! [Browsable(false), ! DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string ServerVersion { *************** *** 129,149 **** } public ConnectionState State { get { return state; } - } - - public int PacketSize - { - get - { - int packetSize = 8192; - if (dbConnection != null) - { - packetSize = dbConnection.Settings.PacketSize; - } - - return packetSize; - } } --- 152,160 ---- } + [Browsable(false), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ConnectionState State { get { return state; } } Index: PGDataAdapter.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/PGDataAdapter.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PGDataAdapter.cs 13 Jul 2003 14:07:33 -0000 1.2 --- PGDataAdapter.cs 16 Jul 2003 19:33:21 -0000 1.3 *************** *** 33,38 **** #endregion ! [ToolboxBitmap(typeof(PGDataAdapter), "Resources.ToolboxBitmaps.PGDataAdapter.bmp")] ! [DefaultEvent("RowUpdated")] public sealed class PGDataAdapter : DbDataAdapter, IDbDataAdapter { --- 33,39 ---- #endregion ! [ToolboxBitmap(typeof(PGDataAdapter), "Resources.ToolboxBitmaps.PGDataAdapter.bmp"), ! DesignerCategory("Component"), ! DefaultEvent("RowUpdated")] public sealed class PGDataAdapter : DbDataAdapter, IDbDataAdapter { *************** *** 50,54 **** private PGCommand updateCommand; private PGCommand deleteCommand; - private bool disposed; --- 51,54 ---- *************** *** 81,84 **** --- 81,85 ---- } + [Category("DataCategory_Update"), DefaultValue(null)] public PGCommand SelectCommand { *************** *** 87,90 **** --- 88,92 ---- } + [Category("DataCategory_Update"), DefaultValue(null)] public PGCommand InsertCommand { *************** *** 93,96 **** --- 95,99 ---- } + [Category("DataCategory_Fill"), DefaultValue(null)] public PGCommand UpdateCommand { *************** *** 99,102 **** --- 102,106 ---- } + [Category("DataCategory_Update"), DefaultValue(null)] public PGCommand DeleteCommand { *************** *** 175,178 **** --- 179,183 ---- } + [Category("DataCategory_Update")] public event PGRowUpdatingEventHandler RowUpdating { Index: PGDataReader.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/PGDataReader.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PGDataReader.cs 14 Jul 2003 12:48:53 -0000 1.6 --- PGDataReader.cs 16 Jul 2003 19:33:21 -0000 1.7 *************** *** 22,26 **** using System.Data.Common; using System.Globalization; ! using PostgreSql.Data.NPGClient; using PostgreSql.Data.PGSqlClient.DbSchema; --- 22,27 ---- using System.Data.Common; using System.Globalization; ! using System.Reflection; ! using System.ComponentModel; using PostgreSql.Data.NPGClient; using PostgreSql.Data.PGSqlClient.DbSchema; *************** *** 367,370 **** --- 368,372 ---- } + [EditorBrowsable(EditorBrowsableState.Never)] public String GetDataTypeName(int i) { *************** *** 438,441 **** --- 440,444 ---- } + [EditorBrowsable(EditorBrowsableState.Never)] public char GetChar(int i) { |
From: <car...@us...> - 2003-07-16 14:12:07
|
Update of /cvsroot/pgsqlclient/pgsqlclient In directory sc8-pr-cvs1:/tmp/cvs-serv3053 Modified Files: changelog.txt Log Message: Updated CHANGELOG.TXT Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/changelog.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** changelog.txt 15 Jul 2003 19:12:46 -0000 1.10 --- changelog.txt 16 Jul 2003 14:12:03 -0000 1.11 *************** *** 3,6 **** --- 3,19 ---- + 2003-07-16 Carlos Guzmán Álvarez <car...@te...> + + * source/PGParameter.cs: + + - Added better use of design time attributes. + + - Added new constructor. + + * source/PGCommand.cs: + + - Added better use of design time attributes. + + 2003-07-15 Carlos Guzmán Álvarez <car...@te...> |
From: <car...@us...> - 2003-07-16 14:09:16
|
Update of /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source In directory sc8-pr-cvs1:/tmp/cvs-serv2528 Modified Files: PGCommand.cs PGParameter.cs Log Message: * source/PGParameter.cs: - Added better use of design time attributes. - Added new constructor. * source/PGCommand.cs: - Added better use of design time attributes. Index: PGCommand.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/PGCommand.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PGCommand.cs 14 Jul 2003 11:59:06 -0000 1.3 --- PGCommand.cs 16 Jul 2003 14:09:12 -0000 1.4 *************** *** 52,56 **** #region PROPERTIES ! [Category("Data"), DefaultValue("")] public string CommandText { --- 52,58 ---- #region PROPERTIES ! [Category("Data"), ! DefaultValue(""), ! RefreshProperties(RefreshProperties.All)] public string CommandText { *************** *** 67,70 **** --- 69,81 ---- } } + + [Category("Data"), + DefaultValue(CommandType.Text), + RefreshProperties(RefreshProperties.All)] + public CommandType CommandType + { + get { return commandType; } + set { commandType = value; } + } [DefaultValue(30)] *************** *** 85,95 **** } - [Category("Data"), DefaultValue(CommandType.Text)] - public CommandType CommandType - { - get { return commandType; } - set { commandType = value; } - } - IDbConnection IDbCommand.Connection { --- 96,99 ---- *************** *** 122,126 **** } ! [DefaultValue(true)] public bool DesignTimeVisible { --- 126,132 ---- } ! [Browsable(false), ! DesignOnly(true), ! DefaultValue(true)] public bool DesignTimeVisible { *************** *** 134,139 **** } ! [DesignerSerializationVisibility(DesignerSerializationVisibility.Content), ! Category("Data")] public PGParameterCollection Parameters { --- 140,145 ---- } ! [Category("Data"), ! DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] public PGParameterCollection Parameters { *************** *** 147,151 **** } ! [Browsable(false)] public PGTransaction Transaction { --- 153,159 ---- } ! [Browsable(false), ! DataSysDescription("Tansaction context used by the command."), ! DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public PGTransaction Transaction { Index: PGParameter.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/PGParameter.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PGParameter.cs 14 Jul 2003 10:28:49 -0000 1.2 --- PGParameter.cs 16 Jul 2003 14:09:12 -0000 1.3 *************** *** 29,40 **** ParameterDirection direction; DataRowVersion sourceVersion; ! bool nullable; ! string name; string sourceColumn; ! object pValue; byte precision; byte scale; int size; ! PGDbType pgType; #endregion --- 29,40 ---- ParameterDirection direction; DataRowVersion sourceVersion; ! bool isNullable; ! string parameterName; string sourceColumn; ! object value; byte precision; byte scale; int size; ! PGDbType pgDbType; #endregion *************** *** 42,59 **** #region PROPERTIES ! public string ParameterName { ! get { return name; } ! set { name = value; } } ! [Category("Data"), DefaultValue("")] ! public string SourceColumn { ! get { return sourceColumn; } ! set { sourceColumn = value; } } ! [Category("Data"), DefaultValue(0)] public byte Precision { --- 42,59 ---- #region PROPERTIES ! string IDataParameter.ParameterName { ! get { return ParameterName; } ! set { ParameterName = value; } } ! [DefaultValue("")] ! public string ParameterName { ! get { return parameterName; } ! set { parameterName = value; } } ! [Category("Data"), DefaultValue((byte)0)] public byte Precision { *************** *** 62,66 **** } ! [Category("Data"), DefaultValue(0)] public byte Scale { --- 62,66 ---- } ! [Category("Data"), DefaultValue((byte)0)] public byte Scale { *************** *** 76,91 **** } ! [Browsable(false)] public DbType DbType { ! get { return pgTypeToDbType(pgType); } ! set { pgType = dbTypeToPGType(value); } } ! [Category("Data"), DefaultValue(PGDbType.VarChar), RefreshProperties(RefreshProperties.All)] public PGDbType PGType { ! get { return pgType; } ! set { pgType = value; } } --- 76,96 ---- } ! [Browsable(false), ! Category("Data"), ! RefreshProperties(RefreshProperties.All), ! DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public DbType DbType { ! get { return pgDbTypeToDbType(pgDbType); } ! set { pgDbType = dbTypeToPGType(value); } } ! [RefreshProperties(RefreshProperties.All), ! Category("Data"), ! DefaultValue(PGDbType.VarChar)] public PGDbType PGType { ! get { return pgDbType; } ! set { pgDbType = value; } } *************** *** 97,105 **** } ! [Browsable(false)] ! public bool IsNullable { ! get { return nullable; } ! set { nullable = value; } } --- 102,120 ---- } ! [Browsable(false), ! DesignOnly(true), ! DefaultValue(false), ! EditorBrowsable(EditorBrowsableState.Advanced)] ! public bool IsNullable { ! get { return isNullable; } ! set { isNullable = value; } ! } ! ! [Category("Data"), DefaultValue("")] ! public string SourceColumn ! { ! get { return sourceColumn; } ! set { sourceColumn = value; } } *************** *** 114,122 **** public object Value { ! get { return pValue; } set ! { ! pValue = value; ! setPGTypeFromValue(pValue); } } --- 129,137 ---- public object Value { ! get { return this.value; } set ! { ! this.value = value; ! setPGTypeFromValue(this.value); } } *************** *** 130,162 **** direction = ParameterDirection.Input; sourceVersion = DataRowVersion.Current; ! nullable = false; ! pgType = PGDbType.VarChar; } ! public PGParameter(string parameterName, PGDbType pgType) : this() { ! this.name = parameterName; ! this.pgType = pgType; } ! public PGParameter(string parameterName, object paramValue) : this() { ! this.name = parameterName; ! this.Value = paramValue; } ! public PGParameter(string parameterName, PGDbType pgType, string sourceColumn) : this() { ! this.name = parameterName; ! this.pgType = pgType; this.sourceColumn = sourceColumn; } ! public PGParameter(string parameterName, PGDbType pgType, int size, string sourceColumn) : this() { ! this.name = parameterName; this.sourceColumn = sourceColumn; ! this.pgType = pgType; this.size = size; } --- 145,201 ---- direction = ParameterDirection.Input; sourceVersion = DataRowVersion.Current; ! isNullable = false; ! pgDbType = PGDbType.VarChar; } ! public PGParameter(string parameterName, PGDbType dbType) : this() { ! this.parameterName = parameterName; ! this.pgDbType = dbType; } ! public PGParameter(string parameterName, object value) : this() { ! this.parameterName = parameterName; ! this.value = value; } ! public PGParameter(string parameterName, PGDbType dbType, string sourceColumn) : this() { ! this.parameterName = parameterName; ! this.pgDbType = dbType; this.sourceColumn = sourceColumn; } ! public PGParameter(string parameterName, PGDbType dbType, int size, string sourceColumn) : this() { ! this.parameterName = parameterName; this.sourceColumn = sourceColumn; ! this.pgDbType = dbType; ! this.size = size; ! } ! ! [EditorBrowsable(EditorBrowsableState.Advanced)] ! public PGParameter(string parameterName, ! PGDbType dbType, ! int size, ! ParameterDirection direction, ! bool isNullable, ! byte precision, ! byte scale, ! string sourceColumn, ! DataRowVersion sourceVersion, ! object value) ! { ! this.parameterName = parameterName; ! this.pgDbType = dbType; this.size = size; + this.direction = direction; + this.isNullable = isNullable; + this.precision = precision; + this.scale = scale; + this.sourceColumn = sourceColumn; + this.sourceVersion = sourceVersion; + this.value = value; } *************** *** 167,181 **** object ICloneable.Clone() { ! PGParameter parameter = new PGParameter(name, pgType, size, sourceColumn); ! ! parameter.SourceVersion = this.SourceVersion; ! parameter.Direction = this.Direction; ! parameter.DbType = this.DbType; ! parameter.IsNullable = this.IsNullable; ! parameter.Precision = this.Precision; ! parameter.Scale = this.Scale; ! parameter.Value = this.Value; ! ! return parameter; } --- 206,219 ---- object ICloneable.Clone() { ! return new PGParameter(parameterName, ! pgDbType, ! size, ! direction, ! isNullable, ! precision, ! scale, ! sourceColumn, ! sourceVersion, ! value); } *************** *** 189,234 **** { case TypeCode.Byte: ! pgType = PGDbType.Byte; break; case TypeCode.Boolean: ! pgType = PGDbType.Boolean; break; case TypeCode.Object: ! pgType = PGDbType.Binary; break; case TypeCode.String: case TypeCode.Char: ! pgType = PGDbType.Char; break; case TypeCode.Int16: ! pgType = PGDbType.Int2; break; case TypeCode.Int32: ! pgType = PGDbType.Int4; break; case TypeCode.Int64: ! pgType = PGDbType.Int8; break; case TypeCode.Single: ! pgType = PGDbType.Float; break; case TypeCode.Double: ! pgType = PGDbType.Double; break; case TypeCode.Decimal: ! pgType = PGDbType.Decimal; break; case TypeCode.DateTime: ! pgType = PGDbType.TimeStamp; break; --- 227,272 ---- { case TypeCode.Byte: ! pgDbType = PGDbType.Byte; break; case TypeCode.Boolean: ! pgDbType = PGDbType.Boolean; break; case TypeCode.Object: ! pgDbType = PGDbType.Binary; break; case TypeCode.String: case TypeCode.Char: ! pgDbType = PGDbType.Char; break; case TypeCode.Int16: ! pgDbType = PGDbType.Int2; break; case TypeCode.Int32: ! pgDbType = PGDbType.Int4; break; case TypeCode.Int64: ! pgDbType = PGDbType.Int8; break; case TypeCode.Single: ! pgDbType = PGDbType.Float; break; case TypeCode.Double: ! pgDbType = PGDbType.Double; break; case TypeCode.Decimal: ! pgDbType = PGDbType.Decimal; break; case TypeCode.DateTime: ! pgDbType = PGDbType.TimeStamp; break; *************** *** 246,252 **** } ! private DbType pgTypeToDbType(PGDbType pgType) { ! switch(pgType) { case PGDbType.Boolean: --- 284,290 ---- } ! private DbType pgDbTypeToDbType(PGDbType pgDbType) { ! switch(pgDbType) { case PGDbType.Boolean: |
From: <car...@us...> - 2003-07-15 19:13:04
|
Update of /cvsroot/pgsqlclient/pgsqlclient In directory sc8-pr-cvs1:/tmp/cvs-serv18846 Modified Files: changelog.txt Log Message: Updated CHANGELOG.TXT Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/changelog.txt,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** changelog.txt 14 Jul 2003 19:13:00 -0000 1.9 --- changelog.txt 15 Jul 2003 19:12:46 -0000 1.10 *************** *** 3,6 **** --- 3,13 ---- + 2003-07-15 Carlos Guzmán Álvarez <car...@te...> + + * Updated NAnt build file for MS.NET. + + * Moved the tests to NUnit. + + 2003-07-14 Carlos Guzmán Álvarez <car...@te...> |
From: <car...@us...> - 2003-07-15 19:12:36
|
Update of /cvsroot/pgsqlclient/pgsqlclient In directory sc8-pr-cvs1:/tmp/cvs-serv18776 Modified Files: PGSqlClient.build Log Message: Updated NAnt build file for MS.NET Index: PGSqlClient.build =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PGSqlClient.build,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PGSqlClient.build 12 Jul 2003 08:11:20 -0000 1.1.1.1 --- PGSqlClient.build 15 Jul 2003 19:12:18 -0000 1.2 *************** *** 5,16 **** --- 5,20 ---- <property name="project.FormalName" value="PostgreSql.Data.PGSqlClient" /> <property name="project.version" value="1.0" /> + <!-- Build properties --> <property name="build.debug" value="true" /> <property name="build.define" value="_DEBUG" /> + <!-- Paths properties --> <property name="base.dir" value="." /> <property name="build.dir" value="build" /> <property name="src.dir" value="${project.FormalName}\source" /> + <property name="nunit.test.dir" value="PostgreSql.Data.PGSqlClient.UnitTests\source"/> <property name="resources.dir" value="${src.dir}\Resources" /> + <!-- Check for Html Help Compiler --> <target name="check-htmlhelp-compiler"> *************** *** 26,33 **** --- 30,54 ---- </ifnot> </target> + + <!-- Check for NUnit --> + <target name="check-nunit-framework"> + <ifnot propertyexists="nunit.framework.dll"> + <sysinfo /> + <property name="nunit.framework.dll" value="${sys.os.folder.programfiles}\NUnit V2.0\bin\nunit.framework.dll" + readonly="false" /> + </ifnot> + </target> + + <!-- Target for check build configuration --> + <target name="check-build-config" depends="clean"> + <call target="check-htmlhelp-compiler" /> + <call target="check-nunit-framework" /> + </target> + <!-- Target for clean destination directory --> <target name="clean" description="cleans build directory"> <delete dir="${build.dir}" failonerror="false" verbose="true" /> </target> + <!-- Target for build in DEBUG mode --> <target name="debug" depends="clean"> *************** *** 35,38 **** --- 56,60 ---- <call target="build-all" /> </target> + <!-- Target for build in RELEASE mode --> <target name="release" depends="clean"> *************** *** 41,56 **** <call target="build-all" /> </target> <!-- Target for check build configuration --> ! <target name="build-all"> ! <call target="build-pgsqlclient" /> ! <if propertyexists="htmlhelp.compiler"> ! <call target="build-sdk" /> ! </if> </target> <!-- Taget for build PGSqlClient .NET Data Provider Assembly --> <target name="build-pgsqlclient"> <mkdir dir="${build.dir}" /> <!-- compile PostgreSql.Data.PGSqlClient --> - <!-- doc="${build.dir}\${project.FormalName}.xml" --> <csc output="${build.dir}\${project.FormalName}.dll" target="library" debug="${build.debug}" define="${build.define}"> <sources> --- 63,79 ---- <call target="build-all" /> </target> + <!-- Target for check build configuration --> ! <target name="build-all" depends="check-build-config"> ! <call target="build-pgsqlclient" /> ! <if propertyexists="nunit.framework.dll"> ! <call target="build-nunit-tests" /> ! </if> </target> + <!-- Taget for build PGSqlClient .NET Data Provider Assembly --> <target name="build-pgsqlclient"> <mkdir dir="${build.dir}" /> <!-- compile PostgreSql.Data.PGSqlClient --> <csc output="${build.dir}\${project.FormalName}.dll" target="library" debug="${build.debug}" define="${build.define}"> <sources> *************** *** 68,75 **** </csc> </target> <!-- Target for build csUnit Tests --> ! <target name="build-csnit-tests"> <copy todir="${build.dir}"> ! <fileset basedir="${base.dir}/tests"> <includes name="${project.FormalName}.Tests.dll.config" /> </fileset> --- 91,99 ---- </csc> </target> + <!-- Target for build csUnit Tests --> ! <target name="build-nunit-tests"> <copy todir="${build.dir}"> ! <fileset basedir="${nunit.test.dir}"> <includes name="${project.FormalName}.Tests.dll.config" /> </fileset> *************** *** 78,82 **** <csc output="${build.dir}\${project.FormalName}.Tests.dll" target="library"> <sources> ! <includes name="${base.dir}/tests/**/*.cs" /> </sources> <references> --- 102,106 ---- <csc output="${build.dir}\${project.FormalName}.Tests.dll" target="library"> <sources> ! <includes name="${nunit.test.dir}/**/*.cs" /> </sources> <references> *************** *** 84,91 **** <absolute file="System.Data.dll" /> <absolute file="System.XML.dll" /> ! <absolute file="csUnit.dll" /> <includes name="${build.dir}/${project.FormalName}.dll" /> </references> </csc> ! </target> </project> --- 108,115 ---- <absolute file="System.Data.dll" /> <absolute file="System.XML.dll" /> ! <includes name="${nunit.framework.dll}"/> <includes name="${build.dir}/${project.FormalName}.dll" /> </references> </csc> ! </target> </project> |
Update of /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient.UnitTests/source In directory sc8-pr-cvs1:/tmp/cvs-serv18675 Modified Files: PGBaseTest.cs PGCommandTest.cs PGConnectionTest.cs PGDataAdapterTest.cs PGDataReaderTest.cs PGTransactionTest.cs Log Message: Moved the tests to NUnit. Index: PGBaseTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient.UnitTests/source/PGBaseTest.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PGBaseTest.cs 14 Jul 2003 19:11:26 -0000 1.3 --- PGBaseTest.cs 15 Jul 2003 19:11:39 -0000 1.4 *************** *** 21,25 **** using System.Data; using System.Configuration; ! using csUnit; namespace PostgreSql.Data.PGSqlClient.UnitTests --- 21,25 ---- using System.Data; using System.Configuration; ! using NUnit.Framework; namespace PostgreSql.Data.PGSqlClient.UnitTests Index: PGCommandTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient.UnitTests/source/PGCommandTest.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PGCommandTest.cs 13 Jul 2003 13:55:31 -0000 1.3 --- PGCommandTest.cs 15 Jul 2003 19:11:39 -0000 1.4 *************** *** 20,24 **** using System.Data; using PostgreSql.Data.PGSqlClient; ! using csUnit; namespace PostgreSql.Data.PGSqlClient.UnitTests --- 20,24 ---- using System.Data; using PostgreSql.Data.PGSqlClient; ! using NUnit.Framework; namespace PostgreSql.Data.PGSqlClient.UnitTests Index: PGConnectionTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient.UnitTests/source/PGConnectionTest.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PGConnectionTest.cs 12 Jul 2003 08:11:23 -0000 1.1.1.1 --- PGConnectionTest.cs 15 Jul 2003 19:11:39 -0000 1.2 *************** *** 20,24 **** using System.Data; using PostgreSql.Data.PGSqlClient; ! using csUnit; namespace PostgreSql.Data.PGSqlClient.UnitTests --- 20,24 ---- using System.Data; using PostgreSql.Data.PGSqlClient; ! using NUnit.Framework; namespace PostgreSql.Data.PGSqlClient.UnitTests Index: PGDataAdapterTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient.UnitTests/source/PGDataAdapterTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PGDataAdapterTest.cs 14 Jul 2003 19:10:44 -0000 1.1 --- PGDataAdapterTest.cs 15 Jul 2003 19:11:39 -0000 1.2 *************** *** 20,24 **** using System.Data; using PostgreSql.Data.PGSqlClient; ! using csUnit; namespace PostgreSql.Data.PGSqlClient.UnitTests --- 20,24 ---- using System.Data; using PostgreSql.Data.PGSqlClient; ! using NUnit.Framework; namespace PostgreSql.Data.PGSqlClient.UnitTests Index: PGDataReaderTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient.UnitTests/source/PGDataReaderTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PGDataReaderTest.cs 13 Jul 2003 11:06:12 -0000 1.1 --- PGDataReaderTest.cs 15 Jul 2003 19:11:39 -0000 1.2 *************** *** 20,24 **** using System.Data; using PostgreSql.Data.PGSqlClient; ! using csUnit; namespace PostgreSql.Data.PGSqlClient.UnitTests --- 20,24 ---- using System.Data; using PostgreSql.Data.PGSqlClient; ! using NUnit.Framework; namespace PostgreSql.Data.PGSqlClient.UnitTests Index: PGTransactionTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient.UnitTests/source/PGTransactionTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PGTransactionTest.cs 13 Jul 2003 11:06:59 -0000 1.1 --- PGTransactionTest.cs 15 Jul 2003 19:11:39 -0000 1.2 *************** *** 20,24 **** using System.Data; using PostgreSql.Data.PGSqlClient; ! using csUnit; namespace PostgreSql.Data.PGSqlClient.UnitTests --- 20,24 ---- using System.Data; using PostgreSql.Data.PGSqlClient; ! using NUnit.Framework; namespace PostgreSql.Data.PGSqlClient.UnitTests |
From: <car...@us...> - 2003-07-14 19:13:03
|
Update of /cvsroot/pgsqlclient/pgsqlclient In directory sc8-pr-cvs1:/tmp/cvs-serv10797 Modified Files: changelog.txt Log Message: Update CHANGELOG.TXT Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/changelog.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** changelog.txt 14 Jul 2003 12:50:40 -0000 1.8 --- changelog.txt 14 Jul 2003 19:13:00 -0000 1.9 *************** *** 5,8 **** --- 5,10 ---- 2003-07-14 Carlos Guzmán Álvarez <car...@te...> + * Added new Unit Test case for PGDataAdapter class. + * source/PGCommand.cs: |
From: <car...@us...> - 2003-07-14 19:12:51
|
Update of /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient.UnitTests/source In directory sc8-pr-cvs1:/tmp/cvs-serv10525 Modified Files: PGBaseTest.cs Log Message: Minor changes Index: PGBaseTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient.UnitTests/source/PGBaseTest.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PGBaseTest.cs 13 Jul 2003 13:54:58 -0000 1.2 --- PGBaseTest.cs 14 Jul 2003 19:11:26 -0000 1.3 *************** *** 138,145 **** commandText.Append("time_field time,"); commandText.Append("timestamp_field timestamp,"); ! commandText.Append("serial_field serial NOT NULL,"); commandText.Append("blob_field bytea,"); commandText.Append("bool_field bool,"); commandText.Append("bigint_field int8,"); commandText.Append("smallint_field int2,"); commandText.Append("array_int int2[],"); --- 138,146 ---- commandText.Append("time_field time,"); commandText.Append("timestamp_field timestamp,"); ! // commandText.Append("serial_field serial NOT NULL,"); commandText.Append("blob_field bytea,"); commandText.Append("bool_field bool,"); commandText.Append("bigint_field int8,"); + // commandText.Append("decimal_field decimal(8,2),"); commandText.Append("smallint_field int2,"); commandText.Append("array_int int2[],"); |
From: <car...@us...> - 2003-07-14 19:10:49
|
Update of /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient.UnitTests/source In directory sc8-pr-cvs1:/tmp/cvs-serv10381 Added Files: PGDataAdapterTest.cs Log Message: Added new Unit Test for PGDataAdapter class --- NEW FILE: PGDataAdapterTest.cs --- (This appears to be a binary file; contents omitted.) |
From: <car...@us...> - 2003-07-14 12:50:44
|
Update of /cvsroot/pgsqlclient/pgsqlclient In directory sc8-pr-cvs1:/tmp/cvs-serv20986 Modified Files: changelog.txt Log Message: Updated CHANGELOG.TXT Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/changelog.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** changelog.txt 14 Jul 2003 12:00:31 -0000 1.7 --- changelog.txt 14 Jul 2003 12:50:40 -0000 1.8 *************** *** 19,22 **** --- 19,24 ---- - Improved GetSchemaTable. + - Fixed Primary Key info retrieval. + * source/NPGClient/PGType.cs: * source/NPGClient/PGTypeCollection.cs: |
From: <car...@us...> - 2003-07-14 12:48:56
|
Update of /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source In directory sc8-pr-cvs1:/tmp/cvs-serv20649 Modified Files: PGDataReader.cs Log Message: Fixed Primary Key info retrieval. Index: PGDataReader.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/PGDataReader.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PGDataReader.cs 14 Jul 2003 11:58:44 -0000 1.5 --- PGDataReader.cs 14 Jul 2003 12:48:53 -0000 1.6 *************** *** 329,333 **** private bool isPrimaryKey(System.Array pKeyInfo, short ordinal) { ! for (int i = 1; i < pKeyInfo.Length; i++) { if ((short)pKeyInfo.GetValue(i) == ordinal) --- 329,333 ---- private bool isPrimaryKey(System.Array pKeyInfo, short ordinal) { ! for (int i = pKeyInfo.GetLowerBound(0); i <= pKeyInfo.GetUpperBound(0); i++) { if ((short)pKeyInfo.GetValue(i) == ordinal) |
From: <car...@us...> - 2003-07-14 12:00:35
|
Update of /cvsroot/pgsqlclient/pgsqlclient In directory sc8-pr-cvs1:/tmp/cvs-serv13915 Modified Files: changelog.txt Log Message: Updated CHANGELOG.TXT Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/changelog.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** changelog.txt 14 Jul 2003 10:29:07 -0000 1.6 --- changelog.txt 14 Jul 2003 12:00:31 -0000 1.7 *************** *** 5,12 **** --- 5,28 ---- 2003-07-14 Carlos Guzmán Álvarez <car...@te...> + * source/PGCommand.cs: + + - Fixed exception throw. + * source/PGCommandBuilder.cs: - Fixed casing in private methods and visibility level. + - Added better handling of table names. + + * source/PGDataReader.cs: + + - Improved GetSchemaTable. + + * source/NPGClient/PGType.cs: + * source/NPGClient/PGTypeCollection.cs: + * source/NPGClient/PGDbClient.cs: + + - Added changes for know if a datatype is serial. + * source/PGDataReader.cs: * source/PGDbType.cs: *************** *** 14,18 **** * source/NPGClient/PGType.cs: ! - Added better andling of datatypes. --- 30,34 ---- * source/NPGClient/PGType.cs: ! - Added better handling of datatypes. |
From: <car...@us...> - 2003-07-14 11:59:47
|
Update of /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/NPGClient In directory sc8-pr-cvs1:/tmp/cvs-serv13678 Modified Files: PGDbClient.cs PGType.cs PGTypeCollection.cs Log Message: Added changes for know if a datatype is serial Index: PGDbClient.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/NPGClient/PGDbClient.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PGDbClient.cs 12 Jul 2003 08:11:23 -0000 1.1.1.1 --- PGDbClient.cs 14 Jul 2003 11:59:44 -0000 1.2 *************** *** 515,553 **** types = new PGTypeCollection(); ! types.Add(-2 , "serial8" , DbType.Int64 , Type.GetType("System.Int64") , 0, 1, 8, false); ! types.Add(-1 , "serial" , DbType.Int32 , Type.GetType("System.Int32") , 0, 1, 4, false); ! types.Add(16 , "bool" , DbType.Boolean , Type.GetType("System.Boolean") , 0, 1, 1, false); ! types.Add(17 , "bytea" , DbType.Binary , Type.GetType("System.Array") , 0, 1, 0, false); ! types.Add(18 , "char" , DbType.String , Type.GetType("System.String") , 0, 0, 0, false); ! types.Add(19 , "name" , DbType.String , Type.GetType("System.String") , 0, 0, 0, false); ! types.Add(20 , "int8" , DbType.Int64 , Type.GetType("System.Int64") , 0, 1, 8, false); ! types.Add(21 , "int2" , DbType.Int16 , Type.GetType("System.Int16") , 0, 1, 2, false); ! types.Add(22 , "int2vector", DbType.Object , Type.GetType("System.Array") , 21, 1, 2, true); ! types.Add(23 , "int4" , DbType.Int32 , Type.GetType("System.Int32") , 0, 1, 4, false); ! types.Add(24 , "regproc" , DbType.String , Type.GetType("System.String") , 0, 0, 0, false); ! types.Add(25 , "text" , DbType.String , Type.GetType("System.String") , 0, 0, 0, false); ! types.Add(26 , "oid" , DbType.Int32 , Type.GetType("System.Int32") , 0, 1, 4, false); ! types.Add(30 , "oidvector", DbType.Object , Type.GetType("System.Array") , 26, 1, 4, true); ! types.Add(700 , "float4" , DbType.Single , Type.GetType("System.Single") , 0, 1, 4, false); ! types.Add(701 , "float8" , DbType.Double , Type.GetType("System.Double") , 0, 1, 8, false); ! types.Add(705 , "unknown" , DbType.Object , Type.GetType("System.Object") , 0, 0, 0, false); ! types.Add(790 , "money" , DbType.Currency , Type.GetType("System.Decimal") , 0, 1, 4, false); ! types.Add(829 , "macaddr" , DbType.String , Type.GetType("System.String") , 0, 0, 6, false); ! types.Add(869 , "inet" , DbType.String , Type.GetType("System.String") , 0, 0, 0, false); ! types.Add(1005 , "_int2" , DbType.Object , Type.GetType("System.Array") , 21, 1, 0, false); ! types.Add(1007 , "_int4" , DbType.Object , Type.GetType("System.Array") , 23, 1, 0, false); ! types.Add(1009 , "_text" , DbType.Object , Type.GetType("System.Array") , 25, 1, 0, false); ! types.Add(1021 , "_float4" , DbType.Object , Type.GetType("System.Array") , 700, 1, 4, false); ! types.Add(1033 , "aclitem" , DbType.String , Type.GetType("System.String") , 0, 0, 12, false); ! types.Add(1034 , "_aclitem", DbType.Object , Type.GetType("System.Array") , 1033, 0, 0, false); ! types.Add(1042 , "bpchar" , DbType.String , Type.GetType("System.String") , 0, 0, 0, false); ! types.Add(1043 , "varchar" , DbType.String , Type.GetType("System.String") , 0, 0, 0, false); ! types.Add(1082 , "date" , DbType.Date , Type.GetType("System.DateTime") , 0, 1, 4, false); ! types.Add(1083 , "time" , DbType.Time , Type.GetType("System.DateTime") , 0, 1, 8, false); ! types.Add(1114 , "timestamp", DbType.DateTime , Type.GetType("System.DateTime") , 0, 1, 8, false); ! types.Add(1560 , "bit" , DbType.Byte , Type.GetType("System.Byte") , 0, 0, 1, false); ! types.Add(1562 , "varbit" , DbType.Byte , Type.GetType("System.Byte") , 0, 1, 0, false); ! types.Add(1700 , "numeric" , DbType.Decimal , Type.GetType("System.Decimal") , 0, 1, 8, false); ! types.Add(2277 , "anyarray", DbType.Object , Type.GetType("System.Array") , 0, 1, 8, false); } --- 515,553 ---- types = new PGTypeCollection(); ! types.Add(-2 , "serial8" , DbType.Int64 , Type.GetType("System.Int64") , 0, 1, 8, false, true); ! types.Add(-1 , "serial" , DbType.Int32 , Type.GetType("System.Int32") , 0, 1, 4, false, true); ! types.Add(16 , "bool" , DbType.Boolean , Type.GetType("System.Boolean") , 0, 1, 1, false, false); ! types.Add(17 , "bytea" , DbType.Binary , Type.GetType("System.Array") , 0, 1, 0, false, false); ! types.Add(18 , "char" , DbType.String , Type.GetType("System.String") , 0, 0, 0, false, false); ! types.Add(19 , "name" , DbType.String , Type.GetType("System.String") , 0, 0, 0, false, false); ! types.Add(20 , "int8" , DbType.Int64 , Type.GetType("System.Int64") , 0, 1, 8, false, false); ! types.Add(21 , "int2" , DbType.Int16 , Type.GetType("System.Int16") , 0, 1, 2, false, false); ! types.Add(22 , "int2vector", DbType.Object , Type.GetType("System.Array") , 21, 1, 2, true, false); ! types.Add(23 , "int4" , DbType.Int32 , Type.GetType("System.Int32") , 0, 1, 4, false, false); ! types.Add(24 , "regproc" , DbType.String , Type.GetType("System.String") , 0, 0, 0, false, false); ! types.Add(25 , "text" , DbType.String , Type.GetType("System.String") , 0, 0, 0, false, false); ! types.Add(26 , "oid" , DbType.Int32 , Type.GetType("System.Int32") , 0, 1, 4, false, false); ! types.Add(30 , "oidvector", DbType.Object , Type.GetType("System.Array") , 26, 1, 4, true, false); ! types.Add(700 , "float4" , DbType.Single , Type.GetType("System.Single") , 0, 1, 4, false, false); ! types.Add(701 , "float8" , DbType.Double , Type.GetType("System.Double") , 0, 1, 8, false, false); ! types.Add(705 , "unknown" , DbType.Object , Type.GetType("System.Object") , 0, 0, 0, false, false); ! types.Add(790 , "money" , DbType.Currency , Type.GetType("System.Decimal") , 0, 1, 4, false, false); ! types.Add(829 , "macaddr" , DbType.String , Type.GetType("System.String") , 0, 0, 6, false, false); ! types.Add(869 , "inet" , DbType.String , Type.GetType("System.String") , 0, 0, 0, false, false); ! types.Add(1005 , "_int2" , DbType.Object , Type.GetType("System.Array") , 21, 1, 0, false, false); ! types.Add(1007 , "_int4" , DbType.Object , Type.GetType("System.Array") , 23, 1, 0, false, false); ! types.Add(1009 , "_text" , DbType.Object , Type.GetType("System.Array") , 25, 1, 0, false, false); ! types.Add(1021 , "_float4" , DbType.Object , Type.GetType("System.Array") , 700, 1, 4, false, false); ! types.Add(1033 , "aclitem" , DbType.String , Type.GetType("System.String") , 0, 0, 12, false, false); ! types.Add(1034 , "_aclitem", DbType.Object , Type.GetType("System.Array") , 1033, 0, 0, false, false); ! types.Add(1042 , "bpchar" , DbType.String , Type.GetType("System.String") , 0, 0, 0, false, false); ! types.Add(1043 , "varchar" , DbType.String , Type.GetType("System.String") , 0, 0, 0, false, false); ! types.Add(1082 , "date" , DbType.Date , Type.GetType("System.DateTime") , 0, 1, 4, false, false); ! types.Add(1083 , "time" , DbType.Time , Type.GetType("System.DateTime") , 0, 1, 8, false, false); ! types.Add(1114 , "timestamp", DbType.DateTime , Type.GetType("System.DateTime") , 0, 1, 8, false, false); ! types.Add(1560 , "bit" , DbType.Byte , Type.GetType("System.Byte") , 0, 0, 1, false, false); ! types.Add(1562 , "varbit" , DbType.Byte , Type.GetType("System.Byte") , 0, 1, 0, false, false); ! types.Add(1700 , "numeric" , DbType.Decimal , Type.GetType("System.Decimal") , 0, 1, 8, false, false); ! types.Add(2277 , "anyarray", DbType.Object , Type.GetType("System.Array") , 0, 1, 8, false, false); } Index: PGType.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/NPGClient/PGType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PGType.cs 14 Jul 2003 10:28:23 -0000 1.2 --- PGType.cs 14 Jul 2003 11:59:44 -0000 1.3 *************** *** 36,39 **** --- 36,40 ---- private int size; private bool isVector; + private bool isSerial; private PGDbType providerType; *************** *** 82,85 **** --- 83,91 ---- } + public bool IsSerial + { + get { return isSerial; } + } + public PGDbType ProviderType { *************** *** 91,99 **** #region CONSTRUCTORS public PGType() { } ! public PGType(int oid, string name, DbType dbType, Type systemType, int arrayType, short formatCode, int size, bool isVector) { this.oid = oid; --- 97,107 ---- #region CONSTRUCTORS + /* public PGType() { } + */ ! public PGType(int oid, string name, DbType dbType, Type systemType, int arrayType, short formatCode, int size, bool isVector, bool isSerial) { this.oid = oid; *************** *** 105,108 **** --- 113,117 ---- this.size = size; this.isVector = isVector; + this.isSerial = isSerial; setProviderType(); Index: PGTypeCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/NPGClient/PGTypeCollection.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PGTypeCollection.cs 12 Jul 2003 08:11:23 -0000 1.1.1.1 --- PGTypeCollection.cs 14 Jul 2003 11:59:44 -0000 1.2 *************** *** 109,115 **** } ! public PGType Add(int oid, string name, DbType dbType, Type systemType, int arrayType, short formatCode, int size, bool isVector) { ! PGType type = new PGType(oid, name, dbType, systemType, arrayType, formatCode, size, isVector); base.Add(type); --- 109,115 ---- } ! public PGType Add(int oid, string name, DbType dbType, Type systemType, int arrayType, short formatCode, int size, bool isVector, bool isSerial) { ! PGType type = new PGType(oid, name, dbType, systemType, arrayType, formatCode, size, isVector, isSerial); base.Add(type); |
From: <car...@us...> - 2003-07-14 11:59:09
|
Update of /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source In directory sc8-pr-cvs1:/tmp/cvs-serv13630 Modified Files: PGCommand.cs Log Message: Fixed exception throw. Index: PGCommand.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/PGCommand.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PGCommand.cs 13 Jul 2003 13:39:00 -0000 1.2 --- PGCommand.cs 14 Jul 2003 11:59:06 -0000 1.3 *************** *** 500,504 **** catch (PGClientException ex) { ! throw ex; } } --- 500,504 ---- catch (PGClientException ex) { ! throw new PGException(ex.Message, ex); } } |
From: <car...@us...> - 2003-07-14 11:58:47
|
Update of /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source In directory sc8-pr-cvs1:/tmp/cvs-serv13574 Modified Files: PGDataReader.cs Log Message: Improved GetSchemaTable. Index: PGDataReader.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/PGDataReader.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PGDataReader.cs 14 Jul 2003 10:28:49 -0000 1.4 --- PGDataReader.cs 14 Jul 2003 11:58:44 -0000 1.5 *************** *** 256,260 **** { schemaRow["IsKey"] = isPrimaryKey(pKeyInfo, (short)columnInfo[6]); ! schemaRow["AllowDBNull"] = columnInfo[9]; schemaRow["BaseSchemaName"] = columnInfo[0].ToString(); schemaRow["BaseTableName"] = columnInfo[1].ToString(); --- 256,260 ---- { schemaRow["IsKey"] = isPrimaryKey(pKeyInfo, (short)columnInfo[6]); ! schemaRow["AllowDBNull"] = ((bool)columnInfo[9]) ? false : true; schemaRow["BaseSchemaName"] = columnInfo[0].ToString(); schemaRow["BaseTableName"] = columnInfo[1].ToString(); *************** *** 683,689 **** private bool isReadOnly(int i) ! { ! /* TODO: Add implementation */ ! return false; } --- 683,690 ---- private bool isReadOnly(int i) ! { ! PGType type = command.Statement.RowDescriptor.Fields[i].DataType; ! ! return type.IsSerial ? true : false; } *************** *** 694,708 **** throw new IndexOutOfRangeException("Could not find specified column in results."); } ! bool returnValue = false; ! ! PGFieldDescriptor field = command.Statement.RowDescriptor.Fields[i]; ! ! if (field.DataType.Name.StartsWith("serial")) ! { ! returnValue = true; ! } ! ! return returnValue; } --- 695,702 ---- throw new IndexOutOfRangeException("Could not find specified column in results."); } + + PGType type = command.Statement.RowDescriptor.Fields[i].DataType; ! return type.IsSerial ? true : false; } |
From: <car...@us...> - 2003-07-14 11:57:31
|
Update of /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source In directory sc8-pr-cvs1:/tmp/cvs-serv13362 Modified Files: PGCommandBuilder.cs Log Message: Added better handling of table names. Index: PGCommandBuilder.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/PGCommandBuilder.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PGCommandBuilder.cs 14 Jul 2003 10:28:49 -0000 1.2 --- PGCommandBuilder.cs 14 Jul 2003 11:57:25 -0000 1.3 *************** *** 481,485 **** private PGParameter createParameter(DataRow schemaRow, int index, bool isWhereParameter) { ! PGParameter parameter = new PGParameter(String.Format("@p{0}", index), (PGDbType)schemaRow["ProviderType"]); parameter.Size = Convert.ToInt32(schemaRow["ColumnSize"]); --- 481,485 ---- private PGParameter createParameter(DataRow schemaRow, int index, bool isWhereParameter) { ! PGParameter parameter = new PGParameter(String.Format("@param_{0}", index), (PGDbType)schemaRow["ProviderType"]); parameter.Size = Convert.ToInt32(schemaRow["ColumnSize"]); *************** *** 596,602 **** if (tableName.Length == 0) { ! tableName = (string)schemaRow["BaseTableName"]; } ! if (tableName != (string)schemaRow["BaseTableName"] && !(bool)schemaRow["IsExpression"]) { --- 596,603 ---- if (tableName.Length == 0) { ! tableName = (string)schemaRow["BaseSchemaName"] + "." + ! (string)schemaRow["BaseTableName"]; } ! if (tableName != (string)schemaRow["BaseSchemaName"] + "." + (string)schemaRow["BaseTableName"] && !(bool)schemaRow["IsExpression"]) { |
From: <car...@us...> - 2003-07-14 10:29:11
|
Update of /cvsroot/pgsqlclient/pgsqlclient In directory sc8-pr-cvs1:/tmp/cvs-serv32687 Modified Files: changelog.txt Log Message: Updated CHANGELOG.TXT Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/changelog.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** changelog.txt 13 Jul 2003 14:08:05 -0000 1.5 --- changelog.txt 14 Jul 2003 10:29:07 -0000 1.6 *************** *** 3,6 **** --- 3,20 ---- + 2003-07-14 Carlos Guzmán Álvarez <car...@te...> + + * source/PGCommandBuilder.cs: + + - Fixed casing in private methods and visibility level. + + * source/PGDataReader.cs: + * source/PGDbType.cs: + * source/PGParameter.cs: + * source/NPGClient/PGType.cs: + + - Added better andling of datatypes. + + 2003-07-13 Carlos Guzmán Álvarez <car...@te...> |
Update of /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source In directory sc8-pr-cvs1:/tmp/cvs-serv32603 Modified Files: PGCommandBuilder.cs PGDataReader.cs PGDbType.cs PGParameter.cs Log Message: * source/PGCommandBuilder.cs: - Fixed casing in private methods and visibility level. * source/PGDataReader.cs: * source/PGDbType.cs: * source/PGParameter.cs: * source/NPGClient/PGType.cs: - Added better andling of datatypes. Index: PGCommandBuilder.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/PGCommandBuilder.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PGCommandBuilder.cs 12 Jul 2003 08:11:21 -0000 1.1.1.1 --- PGCommandBuilder.cs 14 Jul 2003 10:28:49 -0000 1.2 *************** *** 63,67 **** if (dataAdapter != null) { ! dataAdapter.RowUpdating += new PGRowUpdatingEventHandler (RowUpdatingHandler); } } --- 63,67 ---- if (dataAdapter != null) { ! dataAdapter.RowUpdating += new PGRowUpdatingEventHandler(rowUpdatingHandler); } } *************** *** 96,100 **** } ! private PGCommand SelectCommand { get --- 96,100 ---- } ! private PGCommand selectCommand { get *************** *** 192,197 **** if (insertCommand == null) { ! BuildSchemaTable(); ! BuildInsertCommand(null, null); } --- 192,197 ---- if (insertCommand == null) { ! buildSchemaTable(); ! buildInsertCommand(null, null); } *************** *** 203,208 **** if (updateCommand == null) { ! BuildSchemaTable(); ! BuildUpdateCommand(null, null); } --- 203,208 ---- if (updateCommand == null) { ! buildSchemaTable(); ! buildUpdateCommand(null, null); } *************** *** 214,219 **** if (deleteCommand == null) { ! BuildSchemaTable(); ! BuildDeleteCommand(null, null); } --- 214,219 ---- if (deleteCommand == null) { ! buildSchemaTable(); ! buildDeleteCommand(null, null); } *************** *** 233,237 **** #region BUILD_COMMAND_METHODS ! private PGCommand BuildInsertCommand(DataRow row, DataTableMapping tableMapping) { StringBuilder sql = new StringBuilder(); --- 233,237 ---- #region BUILD_COMMAND_METHODS ! private PGCommand buildInsertCommand(DataRow row, DataTableMapping tableMapping) { StringBuilder sql = new StringBuilder(); *************** *** 240,249 **** string dsColumnName = String.Empty; ! insertCommand = new PGCommand(sql.ToString(), SelectCommand.Connection, SelectCommand.Transaction); int i = 0; foreach (DataRow schemaRow in schemaTable.Rows) { ! if (IsUpdatable(schemaRow, row)) { if (fields.Length > 0) --- 240,249 ---- string dsColumnName = String.Empty; ! insertCommand = new PGCommand(sql.ToString(), selectCommand.Connection, selectCommand.Transaction); int i = 0; foreach (DataRow schemaRow in schemaTable.Rows) { ! if (isUpdatable(schemaRow, row)) { if (fields.Length > 0) *************** *** 262,266 **** values.Append("@param_" + i.ToString()); ! PGParameter parameter = CreateParameter(schemaRow, i, false); if (tableMapping != null) --- 262,266 ---- values.Append("@param_" + i.ToString()); ! PGParameter parameter = createParameter(schemaRow, i, false); if (tableMapping != null) *************** *** 301,305 **** } ! public PGCommand BuildUpdateCommand(DataRow row, DataTableMapping tableMapping) { StringBuilder sql = new StringBuilder(); --- 301,305 ---- } ! private PGCommand buildUpdateCommand(DataRow row, DataTableMapping tableMapping) { StringBuilder sql = new StringBuilder(); *************** *** 310,322 **** if (!hasPrimaryKey && !hasUniqueKey) { ! throw new InvalidOperationException ("Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information."); } ! updateCommand = new PGCommand(sql.ToString(), SelectCommand.Connection, SelectCommand.Transaction); int i = 0; foreach (DataRow schemaRow in schemaTable.Rows) { ! if (IsUpdatable(schemaRow, row)) { if (sets.Length > 0) --- 310,322 ---- if (!hasPrimaryKey && !hasUniqueKey) { ! throw new InvalidOperationException("Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information."); } ! updateCommand = new PGCommand(sql.ToString(), selectCommand.Connection, selectCommand.Transaction); int i = 0; foreach (DataRow schemaRow in schemaTable.Rows) { ! if (isUpdatable(schemaRow, row)) { if (sets.Length > 0) *************** *** 330,334 **** "@param_" + i.ToString()); ! PGParameter parameter = CreateParameter(schemaRow, i, false); if (tableMapping != null) --- 330,334 ---- "@param_" + i.ToString()); ! PGParameter parameter = createParameter(schemaRow, i, false); if (tableMapping != null) *************** *** 362,366 **** foreach (DataRow schemaRow in schemaTable.Rows) { ! if (IncludedInWhereClause (schemaRow)) { if (where.Length > 0) --- 362,366 ---- foreach (DataRow schemaRow in schemaTable.Rows) { ! if (includedInWhereClause (schemaRow)) { if (where.Length > 0) *************** *** 373,377 **** "@param_" + i.ToString()); ! PGParameter parameter = CreateParameter(schemaRow, i, true); if (tableMapping != null) --- 373,377 ---- "@param_" + i.ToString()); ! PGParameter parameter = createParameter(schemaRow, i, true); if (tableMapping != null) *************** *** 412,416 **** } ! public PGCommand BuildDeleteCommand(DataRow row, DataTableMapping tableMapping) { StringBuilder sql = new StringBuilder(); --- 412,416 ---- } ! private PGCommand buildDeleteCommand(DataRow row, DataTableMapping tableMapping) { StringBuilder sql = new StringBuilder(); *************** *** 420,427 **** if (!hasPrimaryKey && !hasUniqueKey) { ! throw new InvalidOperationException ("Dynamic SQL generation for the DeleteCommand is not supported against a SelectCommand that does not return any key column information."); } ! deleteCommand = new PGCommand(sql.ToString(), SelectCommand.Connection, SelectCommand.Transaction); // Build where clausule --- 420,427 ---- if (!hasPrimaryKey && !hasUniqueKey) { ! throw new InvalidOperationException("Dynamic SQL generation for the DeleteCommand is not supported against a SelectCommand that does not return any key column information."); } ! deleteCommand = new PGCommand(sql.ToString(), selectCommand.Connection, selectCommand.Transaction); // Build where clausule *************** *** 429,433 **** foreach (DataRow schemaRow in schemaTable.Rows) { ! if (IncludedInWhereClause (schemaRow)) { if (where.Length > 0) --- 429,433 ---- foreach (DataRow schemaRow in schemaTable.Rows) { ! if (includedInWhereClause(schemaRow)) { if (where.Length > 0) *************** *** 440,444 **** "@param_" + i.ToString()); ! PGParameter parameter = CreateParameter(schemaRow, i, true); if (tableMapping != null) --- 440,444 ---- "@param_" + i.ToString()); ! PGParameter parameter = createParameter(schemaRow, i, true); if (tableMapping != null) *************** *** 479,485 **** } ! private PGParameter CreateParameter(DataRow schemaRow, int index, bool isWhereParameter) { ! PGParameter parameter = new PGParameter(String.Format("@p{0}", index), (PGType)schemaRow["ProviderType"]); parameter.Size = Convert.ToInt32(schemaRow["ColumnSize"]); --- 479,485 ---- } ! private PGParameter createParameter(DataRow schemaRow, int index, bool isWhereParameter) { ! PGParameter parameter = new PGParameter(String.Format("@p{0}", index), (PGDbType)schemaRow["ProviderType"]); parameter.Size = Convert.ToInt32(schemaRow["ColumnSize"]); *************** *** 506,510 **** } ! private bool IsUpdatable(DataRow schemaRow, DataRow row) { if (row != null) --- 506,510 ---- } ! private bool isUpdatable(DataRow schemaRow, DataRow row) { if (row != null) *************** *** 550,554 **** } ! private bool IncludedInWhereClause(DataRow schemaRow) { if (!(bool)schemaRow["IsKey"]) --- 550,554 ---- } ! private bool includedInWhereClause(DataRow schemaRow) { if (!(bool)schemaRow["IsKey"]) *************** *** 565,590 **** } ! private void BuildSchemaTable() { ! if (SelectCommand == null) { throw new InvalidOperationException("The DataAdapter.SelectCommand property needs to be initialized."); } ! if (SelectCommand.Connection == null) { ! throw new InvalidOperationException ("The DataAdapter.SelectCommand.Connection property needs to be initialized."); } if (schemaTable == null) { ! PGDataReader reader = SelectCommand.ExecuteReader(CommandBehavior.SchemaOnly); schemaTable = reader.GetSchemaTable(); reader.Close(); ! CheckSchemaTable(); } } ! private void CheckSchemaTable() { tableName = String.Empty; --- 565,590 ---- } ! private void buildSchemaTable() { ! if (selectCommand == null) { throw new InvalidOperationException("The DataAdapter.SelectCommand property needs to be initialized."); } ! if (selectCommand.Connection == null) { ! throw new InvalidOperationException("The DataAdapter.selectCommand.Connection property needs to be initialized."); } if (schemaTable == null) { ! PGDataReader reader = selectCommand.ExecuteReader(CommandBehavior.SchemaOnly); schemaTable = reader.GetSchemaTable(); reader.Close(); ! checkSchemaTable(); } } ! private void checkSchemaTable() { tableName = String.Empty; *************** *** 623,627 **** #region EVENT_HANDLER ! private void RowUpdatingHandler (object sender, PGRowUpdatingEventArgs e) { if (e.Status != UpdateStatus.Continue) --- 623,627 ---- #region EVENT_HANDLER ! private void rowUpdatingHandler(object sender, PGRowUpdatingEventArgs e) { if (e.Status != UpdateStatus.Continue) *************** *** 650,669 **** try { ! BuildSchemaTable(); switch (e.StatementType) { case StatementType.Insert: ! e.Command = BuildInsertCommand(e.Row, e.TableMapping); e.Status = UpdateStatus.Continue; break; case StatementType.Update: ! e.Command = BuildUpdateCommand(e.Row, e.TableMapping); e.Status = UpdateStatus.Continue; break; case StatementType.Delete: ! e.Command = BuildDeleteCommand(e.Row, e.TableMapping); e.Status = UpdateStatus.Continue; break; --- 650,669 ---- try { ! buildSchemaTable(); switch (e.StatementType) { case StatementType.Insert: ! e.Command = buildInsertCommand(e.Row, e.TableMapping); e.Status = UpdateStatus.Continue; break; case StatementType.Update: ! e.Command = buildUpdateCommand(e.Row, e.TableMapping); e.Status = UpdateStatus.Continue; break; case StatementType.Delete: ! e.Command = buildDeleteCommand(e.Row, e.TableMapping); e.Status = UpdateStatus.Continue; break; Index: PGDataReader.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/PGDataReader.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PGDataReader.cs 13 Jul 2003 13:41:25 -0000 1.3 --- PGDataReader.cs 14 Jul 2003 10:28:49 -0000 1.4 *************** *** 622,628 **** } ! private int getProviderType(int i) { ! return command.Statement.RowDescriptor.Fields[i].DataType.Oid; } --- 622,628 ---- } ! private PGDbType getProviderType(int i) { ! return command.Statement.RowDescriptor.Fields[i].DataType.ProviderType; } Index: PGDbType.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/PGDbType.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PGDbType.cs 12 Jul 2003 08:11:21 -0000 1.1.1.1 --- PGDbType.cs 14 Jul 2003 10:28:49 -0000 1.2 *************** *** 36,40 **** Int4 , Int8 , - LongVarBinary , Numeric , Text , --- 36,39 ---- Index: PGParameter.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/PGParameter.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PGParameter.cs 12 Jul 2003 08:11:21 -0000 1.1.1.1 --- PGParameter.cs 14 Jul 2003 10:28:49 -0000 1.2 *************** *** 79,84 **** public DbType DbType { ! get { return PGTypeToDbType(pgType); } ! set { pgType = DbTypeToPGType(value); } } --- 79,84 ---- public DbType DbType { ! get { return pgTypeToDbType(pgType); } ! set { pgType = dbTypeToPGType(value); } } *************** *** 118,126 **** { pValue = value; ! if (pValue == null || Convert.IsDBNull(pValue)) ! { ! throw new ArgumentException("Type infering from null or DBNull is not supported.", "paramValue"); ! } ! pgType = GetPGTypeFromValue(pValue); } } --- 118,122 ---- { pValue = value; ! setPGTypeFromValue(pValue); } } *************** *** 188,231 **** #region PRIVATE_METHODS ! private PGDbType GetPGTypeFromValue(object value) { switch (Type.GetTypeCode(value.GetType())) { case TypeCode.Byte: ! return PGDbType.Byte; case TypeCode.Boolean: ! return PGDbType.Boolean; case TypeCode.Object: ! return PGDbType.Binary; case TypeCode.String: case TypeCode.Char: ! return PGDbType.Char; case TypeCode.Int16: ! return PGDbType.Int2; case TypeCode.Int32: ! return PGDbType.Int4; case TypeCode.Int64: ! return PGDbType.Int8; case TypeCode.Single: ! return PGDbType.Float; case TypeCode.Double: ! return PGDbType.Double; case TypeCode.Decimal: ! return PGDbType.Decimal; case TypeCode.DateTime: ! return PGDbType.TimeStamp; case TypeCode.Empty: - case TypeCode.DBNull: case TypeCode.SByte: case TypeCode.UInt16: --- 184,240 ---- #region PRIVATE_METHODS ! private void setPGTypeFromValue(object value) { switch (Type.GetTypeCode(value.GetType())) { case TypeCode.Byte: ! pgType = PGDbType.Byte; ! break; case TypeCode.Boolean: ! pgType = PGDbType.Boolean; ! break; case TypeCode.Object: ! pgType = PGDbType.Binary; ! break; case TypeCode.String: case TypeCode.Char: ! pgType = PGDbType.Char; ! break; case TypeCode.Int16: ! pgType = PGDbType.Int2; ! break; case TypeCode.Int32: ! pgType = PGDbType.Int4; ! break; case TypeCode.Int64: ! pgType = PGDbType.Int8; ! break; case TypeCode.Single: ! pgType = PGDbType.Float; ! break; case TypeCode.Double: ! pgType = PGDbType.Double; ! break; case TypeCode.Decimal: ! pgType = PGDbType.Decimal; ! break; case TypeCode.DateTime: ! pgType = PGDbType.TimeStamp; ! break; ! ! case TypeCode.DBNull: ! break; case TypeCode.Empty: case TypeCode.SByte: case TypeCode.UInt16: *************** *** 237,241 **** } ! private DbType PGTypeToDbType(PGDbType pgType) { switch(pgType) --- 246,250 ---- } ! private DbType pgTypeToDbType(PGDbType pgType) { switch(pgType) *************** *** 248,252 **** case PGDbType.Binary: - case PGDbType.LongVarBinary: return DbType.Binary; --- 257,260 ---- *************** *** 288,300 **** } } ! private PGDbType DbTypeToPGType(DbType dbType) { switch(dbType) { - case DbType.Guid: - case DbType.VarNumeric: - case DbType.SByte: - throw new SystemException("Invalid data type"); - case DbType.Byte: return PGDbType.Byte; --- 296,304 ---- } } ! ! private PGDbType dbTypeToPGType(DbType dbType) { switch(dbType) { case DbType.Byte: return PGDbType.Byte; *************** *** 345,348 **** --- 349,358 ---- return PGDbType.Double; + case DbType.Currency: + return PGDbType.Currency; + + case DbType.Guid: + case DbType.VarNumeric: + case DbType.SByte: default: throw new InvalidOperationException("Invalid data type specified."); |
From: <car...@us...> - 2003-07-14 10:28:25
|
Update of /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/NPGClient In directory sc8-pr-cvs1:/tmp/cvs-serv32566 Modified Files: PGType.cs Log Message: * source/PGCommandBuilder.cs: - Fixed casing in private methods and visibility level. * source/PGDataReader.cs: * source/PGDbType.cs: * source/PGParameter.cs: * source/NPGClient/PGType.cs: - Added better andling of datatypes. Index: PGType.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/NPGClient/PGType.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PGType.cs 12 Jul 2003 08:11:23 -0000 1.1.1.1 --- PGType.cs 14 Jul 2003 10:28:23 -0000 1.2 *************** *** 20,23 **** --- 20,25 ---- using System.Data; + using PostgreSql.Data.PGSqlClient; + namespace PostgreSql.Data.NPGClient { *************** *** 26,37 **** #region FIELDS ! private int oid; ! private string name; ! private DbType dbType; ! private Type systemType; ! private int arrayType; ! private short formatCode; ! private int size; ! private bool isVector; #endregion --- 28,40 ---- #region FIELDS ! private int oid; ! private string name; ! private DbType dbType; ! private Type systemType; ! private int arrayType; ! private short formatCode; ! private int size; ! private bool isVector; ! private PGDbType providerType; #endregion *************** *** 79,82 **** --- 82,90 ---- } + public PGDbType ProviderType + { + get { return providerType; } + } + #endregion *************** *** 97,100 **** --- 105,192 ---- this.size = size; this.isVector = isVector; + + setProviderType(); + } + + #endregion + + #region PRIVATE_METHODS + + private void setProviderType() + { + switch(dbType) + { + case DbType.Byte: + providerType = PGDbType.Byte; + break; + + case DbType.Boolean: + providerType = PGDbType.Boolean; + break; + + case DbType.AnsiString: + case DbType.String: + providerType = PGDbType.VarChar; + break; + + case DbType.AnsiStringFixedLength: + case DbType.StringFixedLength: + providerType = PGDbType.Char; + break; + + case DbType.Binary: + case DbType.Object: + providerType = PGDbType.Binary; + break; + + case DbType.Date: + providerType = PGDbType.Date; + break; + + case DbType.Time: + providerType = PGDbType.Time; + break; + + case DbType.DateTime: + providerType = PGDbType.TimeStamp; + break; + + case DbType.Int16: + case DbType.UInt16: + providerType = PGDbType.Int2; + break; + + case DbType.Int32: + case DbType.UInt32: + providerType = PGDbType.Int4; + break; + + case DbType.Int64: + case DbType.UInt64: + providerType = PGDbType.Int8; + break; + + case DbType.Single: + providerType = PGDbType.Float; + break; + + case DbType.Decimal: + providerType = PGDbType.Decimal; + break; + + case DbType.Double: + providerType = PGDbType.Double; + break; + + case DbType.Currency: + providerType = PGDbType.Currency; + break; + + case DbType.Guid: + case DbType.VarNumeric: + case DbType.SByte: + default: + throw new InvalidOperationException("Invalid data type specified."); + } } |
From: <car...@us...> - 2003-07-13 14:08:08
|
Update of /cvsroot/pgsqlclient/pgsqlclient In directory sc8-pr-cvs1:/tmp/cvs-serv32098 Modified Files: changelog.txt Log Message: Updated CHANGELOG.TXT Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/changelog.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** changelog.txt 13 Jul 2003 13:44:17 -0000 1.4 --- changelog.txt 13 Jul 2003 14:08:05 -0000 1.5 *************** *** 16,19 **** --- 16,20 ---- * source/PGException.cs: + * source/PGDataAdapter.cs: - Fixed constructors. |
From: <car...@us...> - 2003-07-13 14:07:36
|
Update of /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source In directory sc8-pr-cvs1:/tmp/cvs-serv32033 Modified Files: PGDataAdapter.cs Log Message: Fixed constructors Index: PGDataAdapter.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/PGDataAdapter.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PGDataAdapter.cs 12 Jul 2003 08:11:21 -0000 1.1.1.1 --- PGDataAdapter.cs 13 Jul 2003 14:07:33 -0000 1.2 *************** *** 115,129 **** public PGDataAdapter(PGCommand selectCommand) : this() { ! selectCommand = selectCommand; } public PGDataAdapter(string commandText, PGConnection connection) : this() { ! selectCommand = new PGCommand(commandText, connection); } public PGDataAdapter(string commandText, string connectionString) : this() { ! selectCommand = new PGCommand(commandText, new PGConnection(connectionString)); } --- 115,129 ---- public PGDataAdapter(PGCommand selectCommand) : this() { ! this.selectCommand = selectCommand; } public PGDataAdapter(string commandText, PGConnection connection) : this() { ! this.selectCommand = new PGCommand(commandText, connection); } public PGDataAdapter(string commandText, string connectionString) : this() { ! this.selectCommand = new PGCommand(commandText, new PGConnection(connectionString)); } |
From: <car...@us...> - 2003-07-13 13:55:34
|
Update of /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient.UnitTests/source In directory sc8-pr-cvs1:/tmp/cvs-serv30721 Modified Files: PGCommandTest.cs Log Message: Added new tests cases Index: PGCommandTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient.UnitTests/source/PGCommandTest.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PGCommandTest.cs 13 Jul 2003 12:39:30 -0000 1.2 --- PGCommandTest.cs 13 Jul 2003 13:55:31 -0000 1.3 *************** *** 74,78 **** Console.WriteLine("\r\nPGCommandTest.ExecuteReaderTest"); ! PGCommand command = new PGCommand("select * from public.test_table order by date_field", Connection); PGDataReader reader = command.ExecuteReader(); --- 74,78 ---- Console.WriteLine("\r\nPGCommandTest.ExecuteReaderTest"); ! PGCommand command = new PGCommand("SELECT * FROM public.test_table ORDER BY date_field", Connection); PGDataReader reader = command.ExecuteReader(); *************** *** 99,102 **** --- 99,179 ---- public void ExecuteScalarTest() { + PGCommand command = Connection.CreateCommand(); + + command.CommandText = "SELECT char_field FROM public.test_table where int_field = @int_field"; + + command.Parameters.Add("@int_Field", 2); + + string charFieldValue = command.ExecuteScalar().ToString(); + + Console.WriteLine("Scalar value: {0}", charFieldValue); + + command.Dispose(); + } + + [Test] + public void PrepareTest() + { + PGCommand command = Connection.CreateCommand(); + + command.CommandText = "SELECT char_field FROM public.test_table where int_field = @int_field"; + + command.Parameters.Add("@int_field", 2); + command.Prepare(); + command.Dispose(); + } + + [Test] + public void NamedParametersTest() + { + PGCommand command = Connection.CreateCommand(); + + command.CommandText = "SELECT char_field FROM public.test_table where int_field = @int_field or char_field = @char_field"; + + command.Parameters.Add("@int_field", 2); + command.Parameters.Add("@char_field", "IRow 20"); + + PGDataReader reader = command.ExecuteReader(); + + int count = 0; + while (reader.Read()) + { + Console.WriteLine(reader.GetValue(0)); + count++; + } + + Console.WriteLine("\r\n Record fetched {0} \r\n", count); + + reader.Close(); + command.Dispose(); + } + + [Test] + [Ignore("Not implemented.")] + public void ExecuteStoredProcTest() + { + } + + [Test] + public void RecordsAffectedTest() + { + PGCommand selectCommand = new PGCommand("SELECT * FROM public.test_table WHERE int_field = 100", Connection); + int recordsAffected = selectCommand.ExecuteNonQuery(); + Console.WriteLine("\r\nRecords Affected by SELECT command: {0}", recordsAffected); + if (recordsAffected != -1) + { + throw new EvaluateException("Invalid RecordsAffected value for SELECT command"); + } + selectCommand.Dispose(); + + PGCommand deleteCommand = new PGCommand("DELETE FROM public.test_table WHERE int_field = 45", Connection); + recordsAffected = deleteCommand.ExecuteNonQuery(); + Console.WriteLine("\r\nRecords Affected by DELETE command: {0}", recordsAffected); + if (recordsAffected != 1) + { + throw new EvaluateException("Invalid RecordsAffected value for DELETE command"); + } + // Assertion.Assert(recordsAffected == 1); + deleteCommand.Dispose(); } } |
From: <car...@us...> - 2003-07-13 13:55:01
|
Update of /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient.UnitTests/source In directory sc8-pr-cvs1:/tmp/cvs-serv30658 Modified Files: PGBaseTest.cs Log Message: Removed disposed field Index: PGBaseTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient.UnitTests/source/PGBaseTest.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PGBaseTest.cs 12 Jul 2003 08:11:23 -0000 1.1.1.1 --- PGBaseTest.cs 13 Jul 2003 13:54:58 -0000 1.2 *************** *** 28,32 **** { private PGConnection connection; - private bool disposed; public PGConnection Connection --- 28,31 ---- |
From: <car...@us...> - 2003-07-13 13:54:08
|
Update of /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source In directory sc8-pr-cvs1:/tmp/cvs-serv30570 Modified Files: PGException.cs Log Message: Fixed error with latest commit Index: PGException.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/PGException.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PGException.cs 13 Jul 2003 13:43:46 -0000 1.2 --- PGException.cs 13 Jul 2003 13:54:02 -0000 1.3 *************** *** 19,22 **** --- 19,23 ---- using System; using System.Text; + using System.Runtime.Serialization; using PostgreSql.Data.NPGClient; *************** *** 29,33 **** #region FIELDS - private string message; private PGErrorCollection errors; --- 30,33 ---- *************** *** 36,44 **** #region PROPERTIES - public new string Message - { - get { return this.message; } - } - public PGErrorCollection Errors { --- 36,39 ---- *************** *** 67,73 **** internal PGException(string message, PGClientException ex) : base(message, ex) { ! errors = new PGErrorCollection(); ! errorCode = ex.ErrorCode; ! Source = ex.Source; getPGExceptionErrors(ex); --- 62,67 ---- internal PGException(string message, PGClientException ex) : base(message, ex) { ! errors = new PGErrorCollection(); ! Source = ex.Source; getPGExceptionErrors(ex); |