[pgsqlclient-checkins] SF.net SVN: pgsqlclient: [165] trunk/PostgreSqlClient/source/PostgreSql/Data/
Status: Inactive
Brought to you by:
carlosga_fb
From: <car...@us...> - 2006-05-31 18:35:31
|
Revision: 165 Author: carlosga_fb Date: 2006-05-31 11:35:17 -0700 (Wed, 31 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=165&view=rev Log Message: ----------- 2006-05-31 Carlos Guzman Alvarez (car...@gm...) - Committed initial support for fetching PostGIS Box2D values. Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDataType.cs trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatement.cs trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgType.cs trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgTypeCollection.cs Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDataType.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDataType.cs 2006-05-29 07:28:34 UTC (rev 164) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDataType.cs 2006-05-31 18:35:17 UTC (rev 165) @@ -28,6 +28,8 @@ Binary , Boolean , Box , + Box2D , + Box3D , Byte , Char , Circle , Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs 2006-05-29 07:28:34 UTC (rev 164) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs 2006-05-31 18:35:17 UTC (rev 165) @@ -61,14 +61,14 @@ DataTypes.Add(25 , "text" , PgDataType.Text , 0, PgTypeFormat.Text, Int32.MaxValue); DataTypes.Add(26 , "oid" , PgDataType.Int4 , 0, PgTypeFormat.Binary, 4); DataTypes.Add(30 , "oidvector" , PgDataType.Vector , 26, PgTypeFormat.Binary, 4); - DataTypes.Add(600 , "point" , PgDataType.Point , 701, PgTypeFormat.Binary, 16); - DataTypes.Add(601 , "lseg" , PgDataType.LSeg , 600, PgTypeFormat.Binary, 32); - DataTypes.Add(602 , "path" , PgDataType.Path , 0, PgTypeFormat.Binary, 16); - DataTypes.Add(603 , "box" , PgDataType.Box , 600, PgTypeFormat.Binary, 32); - DataTypes.Add(604 , "polygon" , PgDataType.Polygon , 0, PgTypeFormat.Binary, 16); - DataTypes.Add(628 , "line" , PgDataType.Line , 701, PgTypeFormat.Binary, 32); + DataTypes.Add(600 , "point" , PgDataType.Point , 701, PgTypeFormat.Binary, 16, ","); + DataTypes.Add(601 , "lseg" , PgDataType.LSeg , 600, PgTypeFormat.Binary, 32, ","); + DataTypes.Add(602 , "path" , PgDataType.Path , 0, PgTypeFormat.Binary, 16, ","); + DataTypes.Add(603 , "box" , PgDataType.Box , 600, PgTypeFormat.Binary, 32, ";"); + DataTypes.Add(604 , "polygon" , PgDataType.Polygon , 0, PgTypeFormat.Binary, 16, ","); + DataTypes.Add(628 , "line" , PgDataType.Line , 701, PgTypeFormat.Binary, 32, ","); DataTypes.Add(629 , "_line" , PgDataType.Array , 628, PgTypeFormat.Binary, 32); - DataTypes.Add(718 , "circle" , PgDataType.Circle , 0, PgTypeFormat.Binary, 24); + DataTypes.Add(718 , "circle" , PgDataType.Circle , 0, PgTypeFormat.Binary, 24, ","); DataTypes.Add(719 , "_circle" , PgDataType.Array , 718, PgTypeFormat.Binary, 24); DataTypes.Add(700 , "float4" , PgDataType.Float , 0, PgTypeFormat.Text, 4); DataTypes.Add(701 , "float8" , PgDataType.Double , 0, PgTypeFormat.Binary, 8); @@ -105,6 +105,10 @@ DataTypes.Add(1790 , "refcursor" , PgDataType.Refcursor , 0, PgTypeFormat.Text, 0); DataTypes.Add(2205 , "regclass" , PgDataType.VarChar , 0, PgTypeFormat.Text, 0); DataTypes.Add(2277 , "anyarray" , PgDataType.Array , 0, PgTypeFormat.Binary, 8); + + // PostGIS datatypes + DataTypes.Add(16418 , "box3d" , PgDataType.Box3D , 0, PgTypeFormat.Text, 48, ","); + DataTypes.Add(17335 , "box2d" , PgDataType.Box2D , 0, PgTypeFormat.Text, 16, ","); } public static void InitializeCharSets() Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs 2006-05-29 07:28:34 UTC (rev 164) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs 2006-05-31 18:35:17 UTC (rev 165) @@ -378,9 +378,9 @@ #endregion - #region \xB7 Common Methods \xB7 + #region \xB7 Common Methods \xB7 - public object ReadValue(PgType type, int length) + public object ReadValue(PgType type, int length) { switch (type.DataType) { @@ -560,6 +560,9 @@ case PgDataType.Path: return PgPath.Parse(stringValue); + case PgDataType.Box2D: + return PgBox2D.Parse(stringValue); + default: return this.packet.ReadBytes(length); } Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatement.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatement.cs 2006-05-29 07:28:34 UTC (rev 164) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatement.cs 2006-05-31 18:35:17 UTC (rev 165) @@ -245,7 +245,7 @@ } while (!response.IsRowDescription && !response.IsNoData); - // Review if there are some parameter witha domain as a Data Type + // Review if there are some parameter with a domain as a Data Type foreach (PgParameter parameter in this.parameters) { if (parameter.DataType == null) Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgType.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgType.cs 2006-05-29 07:28:34 UTC (rev 164) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgType.cs 2006-05-31 18:35:17 UTC (rev 165) @@ -30,7 +30,8 @@ private Type systemType; private int elementType; private PgTypeFormat formatCode; - private int size; + private int size; + private string delimiter; #endregion @@ -138,21 +139,39 @@ get { return (this.DataType == PgDataType.Refcursor); } } + public string Delimiter + { + get { return this.delimiter; } + } + #endregion #region \xB7 Constructors \xB7 public PgType(int oid, string name, PgDataType dataType, int elementType, PgTypeFormat formatCode, int size) + : this(oid, name, dataType, elementType, formatCode, size, "") { - this.oid = oid; - this.name = name; - this.dataType = dataType; - this.elementType = elementType; - this.formatCode = formatCode; - this.size = size; - this.systemType = this.InferSystemType(); } + public PgType( + int oid, + string name, + PgDataType dataType, + int elementType, + PgTypeFormat formatCode, + int size, + string delimiter) + { + this.oid = oid; + this.name = name; + this.dataType = dataType; + this.elementType = elementType; + this.formatCode = formatCode; + this.size = size; + this.systemType = this.InferSystemType(); + this.delimiter = delimiter; + } + #endregion #region \xB7 Private Methods \xB7 Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgTypeCollection.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgTypeCollection.cs 2006-05-29 07:28:34 UTC (rev 164) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgTypeCollection.cs 2006-05-31 18:35:17 UTC (rev 165) @@ -91,11 +91,29 @@ return type; } - public PgType Add(int oid, string name, PgDataType dataType, int elementType, PgTypeFormat formatCode, int size) + public PgType Add( + int oid, + string name, + PgDataType dataType, + int elementType, + PgTypeFormat formatCode, + int size) { return this.Add(new PgType(oid, name, dataType, elementType, formatCode, size)); } + public PgType Add( + int oid, + string name, + PgDataType dataType, + int elementType, + PgTypeFormat formatCode, + int size, + string delimiter) + { + return this.Add(new PgType(oid, name, dataType, elementType, formatCode, size, delimiter)); + } + #endregion #region \xB7 Private Methods \xB7 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |