diff --git a/OpenSim/Framework/ClientManager.cs b/OpenSim/Framework/ClientManager.cs index baff2f4354..45c54e4989 100644 --- a/OpenSim/Framework/ClientManager.cs +++ b/OpenSim/Framework/ClientManager.cs @@ -27,10 +27,8 @@ using System; using System.Collections.Generic; -using System.Reflection; using System.Net; using OpenMetaverse; -using OpenMetaverse.Packets; namespace OpenSim.Framework { @@ -76,20 +74,16 @@ namespace OpenSim.Framework { lock (m_syncRoot) { - if (m_dict1.ContainsKey(value.AgentId) || m_dict2.ContainsKey(value.RemoteEndPoint)) - return false; + // allow self healing +// if (m_dict1.ContainsKey(value.AgentId) || m_dict2.ContainsKey(value.RemoteEndPoint)) +// return false; m_dict1[value.AgentId] = value; m_dict2[value.RemoteEndPoint] = value; - IClientAPI[] oldArray = m_array; - int oldLength = oldArray.Length; - - IClientAPI[] newArray = new IClientAPI[oldLength + 1]; - for (int i = 0; i < oldLength; i++) - newArray[i] = oldArray[i]; - newArray[oldLength] = value; - + // dict1 is the master + IClientAPI[] newArray = new IClientAPI[m_dict1.Count]; + m_dict1.Values.CopyTo(newArray, 0); m_array = newArray; } @@ -112,22 +106,12 @@ namespace OpenSim.Framework m_dict1.Remove(key); m_dict2.Remove(value.RemoteEndPoint); - IClientAPI[] oldArray = m_array; - int oldLength = oldArray.Length; - - IClientAPI[] newArray = new IClientAPI[oldLength - 1]; - int j = 0; - for (int i = 0; i < oldLength; i++) - { - if (oldArray[i] != value) - newArray[j++] = oldArray[i]; - } - + IClientAPI[] newArray = new IClientAPI[m_dict1.Count]; + m_dict1.Values.CopyTo(newArray, 0); m_array = newArray; return true; } } - return false; } @@ -196,26 +180,12 @@ namespace OpenSim.Framework } } - /// - /// Performs a given task in parallel for each of the elements in the - /// collection - /// - /// Action to perform on each element - public void ForEach(Action action) - { - IClientAPI[] localArray = m_array; - Parallel.For(0, localArray.Length, - delegate(int i) - { action(localArray[i]); } - ); - } - /// /// Performs a given task synchronously for each of the elements in /// the collection /// /// Action to perform on each element - public void ForEachSync(Action action) + public void ForEach(Action action) { IClientAPI[] localArray = m_array; for (int i = 0; i < localArray.Length; i++) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index e709d6cbed..439f79dfe2 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -5446,7 +5446,7 @@ Label_GroupsDone: /// public void ForEachClient(Action action) { - m_clientManager.ForEachSync(action); + m_clientManager.ForEach(action); } public int GetNumberOfClients() diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 2000c44628..d5f2e78756 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -28,6 +28,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Collections.Specialized; using System.Diagnostics; using System.Drawing; using System.Drawing.Imaging; @@ -40,7 +41,7 @@ using Nini.Config; using log4net; using OpenMetaverse; using OpenMetaverse.Assets; -using OpenMetaverse.StructuredData; +using OpenMetaverse.StructuredData; // LitJson is hidden on this using OpenMetaverse.Packets; using OpenMetaverse.Rendering; using OpenSim; @@ -16700,92 +16701,158 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return String.Empty; } - public LSL_String llJsonGetValue(LSL_String json, LSL_List specifiers) - { - OSD o = OSDParser.DeserializeJson(json); - OSD specVal = JsonGetSpecific(o, specifiers, 0); - - return specVal.AsString(); - } - public LSL_List llJson2List(LSL_String json) { + if(String.IsNullOrEmpty(json)) + return new LSL_List(); + if(json == "[]") + return new LSL_List(); + if(json == "{}") + return new LSL_List(); + char first = ((string)json)[0]; + + if(first != '[' && first !='{') + { + // we already have a single element + LSL_List l = new LSL_List(); + l.Add(json); + return l; + } + + LitJson.JsonData jsdata; try { - OSD o = OSDParser.DeserializeJson(json); - return (LSL_List)ParseJsonNode(o); + jsdata = LitJson.JsonMapper.ToObject(json); } - catch (Exception) + catch (Exception e) { - return new LSL_List(ScriptBaseClass.JSON_INVALID); + string m = e.Message; // debug point + return json; + } + try + { + return JsonParseTop(jsdata); + } + catch (Exception e) + { + string m = e.Message; // debug point + return (LSL_String)ScriptBaseClass.JSON_INVALID; } } - private object ParseJsonNode(OSD node) + private LSL_List JsonParseTop(LitJson.JsonData elem) { - if (node.Type == OSDType.Integer) - return new LSL_Integer(node.AsInteger()); - if (node.Type == OSDType.Boolean) - return new LSL_Integer(node.AsBoolean() ? 1 : 0); - if (node.Type == OSDType.Real) - return new LSL_Float(node.AsReal()); - if (node.Type == OSDType.UUID || node.Type == OSDType.String) - return new LSL_String(node.AsString()); - if (node.Type == OSDType.Array) + LSL_List retl = new LSL_List(); + if(elem == null) + retl.Add((LSL_String)ScriptBaseClass.JSON_NULL); + + LitJson.JsonType elemType = elem.GetJsonType(); + switch (elemType) { - LSL_List resp = new LSL_List(); - OSDArray ar = node as OSDArray; - foreach (OSD o in ar) - resp.Add(ParseJsonNode(o)); - return resp; + case LitJson.JsonType.Int: + retl.Add(new LSL_Integer((int)elem)); + return retl; + case LitJson.JsonType.Boolean: + retl.Add((LSL_String)((bool)elem ? ScriptBaseClass.JSON_TRUE : ScriptBaseClass.JSON_FALSE)); + return retl; + case LitJson.JsonType.Double: + retl.Add(new LSL_Float((float)elem)); + return retl; + case LitJson.JsonType.None: + retl.Add((LSL_String)ScriptBaseClass.JSON_NULL); + return retl; + case LitJson.JsonType.String: + retl.Add(new LSL_String((string)elem)); + return retl; + case LitJson.JsonType.Array: + foreach (LitJson.JsonData subelem in elem) + retl.Add(JsonParseTopNodes(subelem)); + return retl; + case LitJson.JsonType.Object: + IDictionaryEnumerator e = ((IOrderedDictionary)elem).GetEnumerator(); + while (e.MoveNext()) + { + retl.Add(new LSL_String((string)e.Key)); + retl.Add(JsonParseTopNodes((LitJson.JsonData)e.Value)); + } + return retl; + default: + throw new Exception(ScriptBaseClass.JSON_INVALID); } - if (node.Type == OSDType.Map) + } + + private object JsonParseTopNodes(LitJson.JsonData elem) + { + if(elem == null) + return ((LSL_String)ScriptBaseClass.JSON_NULL); + + LitJson.JsonType elemType = elem.GetJsonType(); + switch (elemType) { - LSL_List resp = new LSL_List(); - OSDMap ar = node as OSDMap; - foreach (KeyValuePair o in ar) - { - resp.Add(new LSL_String(o.Key)); - resp.Add(ParseJsonNode(o.Value)); - } - return resp; + case LitJson.JsonType.Int: + return (new LSL_Integer((int)elem)); + case LitJson.JsonType.Boolean: + return ((bool)elem ? (LSL_String)ScriptBaseClass.JSON_TRUE : (LSL_String)ScriptBaseClass.JSON_FALSE); + case LitJson.JsonType.Double: + return (new LSL_Float((float)elem)); + case LitJson.JsonType.None: + return ((LSL_String)ScriptBaseClass.JSON_NULL); + case LitJson.JsonType.String: + return (new LSL_String((string)elem)); + case LitJson.JsonType.Array: + case LitJson.JsonType.Object: + string s = LitJson.JsonMapper.ToJson(elem); + return (LSL_String)s; + default: + throw new Exception(ScriptBaseClass.JSON_INVALID); } - throw new Exception(ScriptBaseClass.JSON_INVALID); } public LSL_String llList2Json(LSL_String type, LSL_List values) { try { + StringBuilder sb = new StringBuilder(); if (type == ScriptBaseClass.JSON_ARRAY) { - OSDArray array = new OSDArray(); + sb.Append("["); + int i= 0; foreach (object o in values.Data) { - array.Add(ListToJson(o)); + sb.Append(ListToJson(o)); + if((i++) < values.Data.Length - 1) + sb.Append(","); } - return OSDParser.SerializeJsonString(array); + sb.Append("]"); + return (LSL_String)sb.ToString();; } else if (type == ScriptBaseClass.JSON_OBJECT) { - OSDMap map = new OSDMap(); + sb.Append("{"); for (int i = 0; i < values.Data.Length; i += 2) { if (!(values.Data[i] is LSL_String)) return ScriptBaseClass.JSON_INVALID; - map.Add(((LSL_String)values.Data[i]).m_string, ListToJson(values.Data[i + 1])); + string key = ((LSL_String)values.Data[i]).m_string; + key = EscapeForJSON(key, true); + sb.Append(key); + sb.Append(":"); + sb.Append(ListToJson(values.Data[i+1])); + if(i < values.Data.Length - 2) + sb.Append(","); } - return OSDParser.SerializeJsonString(map); + sb.Append("}"); + return (LSL_String)sb.ToString(); } return ScriptBaseClass.JSON_INVALID; } - catch (Exception ex) + catch { - return ex.Message; + return ScriptBaseClass.JSON_INVALID; } } - private OSD ListToJson(object o) + private string ListToJson(object o) { if (o is LSL_Float || o is double) { @@ -16795,7 +16862,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api else float_val = ((LSL_Float)o).value; - return OSD.FromReal(float_val); + if(double.IsInfinity(float_val)) + return "\"Inf\""; + if(double.IsNaN(float_val)) + return "\"NaN\""; + + return ((LSL_Float)float_val).ToString(); } if (o is LSL_Integer || o is int) { @@ -16804,17 +16876,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api i = ((int)o); else i = ((LSL_Integer)o).value; - - if (i == 0) - return OSD.FromBoolean(false); - else if (i == 1) - return OSD.FromBoolean(true); - return OSD.FromInteger(i); + return i.ToString(); } if (o is LSL_Rotation) - return OSD.FromString(((LSL_Rotation)o).ToString()); + return ((LSL_Rotation)o).ToString(); if (o is LSL_Vector) - return OSD.FromString(((LSL_Vector)o).ToString()); + return ((LSL_Vector)o).ToString(); if (o is LSL_String || o is string) { string str; @@ -16823,137 +16890,579 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api else str = ((LSL_String)o).m_string; - if (str == ScriptBaseClass.JSON_NULL) - return new OSD(); - return OSD.FromString(str); + if(str == ScriptBaseClass.JSON_TRUE || str == "true") + return "true"; + if(str == ScriptBaseClass.JSON_FALSE ||str == "false") + return "false"; + if(str == ScriptBaseClass.JSON_NULL || str == "null") + return "null"; + str.Trim(); + if (str[0] == '{') + return str; + if (str[0] == '[') + return str; + return EscapeForJSON(str, true); } - throw new Exception(ScriptBaseClass.JSON_INVALID); + throw new IndexOutOfRangeException(); } - private OSD JsonGetSpecific(OSD o, LSL_List specifiers, int i) + private string EscapeForJSON(string s, bool AddOuter) { - object spec = specifiers.Data[i]; - OSD nextVal = null; - if (o is OSDArray) + int i; + char c; + String t; + int len = s.Length; + + StringBuilder sb = new StringBuilder(len + 64); + if(AddOuter) + sb.Append("\""); + + for (i = 0; i < len; i++) { - if (spec is LSL_Integer) - nextVal = ((OSDArray)o)[((LSL_Integer)spec).value]; + c = s[i]; + switch (c) + { + case '\\': + case '"': + case '/': + sb.Append('\\'); + sb.Append(c); + break; + case '\b': + sb.Append("\\b"); + break; + case '\t': + sb.Append("\\t"); + break; + case '\n': + sb.Append("\\n"); + break; + case '\f': + sb.Append("\\f"); + break; + case '\r': + sb.Append("\\r"); + break; + default: + if (c < ' ') + { + t = "000" + String.Format("X", c); + sb.Append("\\u" + t.Substring(t.Length - 4)); + } + else + { + sb.Append(c); + } + break; + } } - if (o is OSDMap) - { - if (spec is LSL_String) - nextVal = ((OSDMap)o)[((LSL_String)spec).m_string]; - } - if (nextVal != null) - { - if (specifiers.Data.Length - 1 > i) - return JsonGetSpecific(nextVal, specifiers, i + 1); - } - return nextVal; + if(AddOuter) + sb.Append("\""); + return sb.ToString(); } public LSL_String llJsonSetValue(LSL_String json, LSL_List specifiers, LSL_String value) { + bool noSpecifiers = specifiers.Length == 0; + LitJson.JsonData workData; try { - OSD o = OSDParser.DeserializeJson(json); - JsonSetSpecific(o, specifiers, 0, value); - return OSDParser.SerializeJsonString(o); + if(noSpecifiers) + specifiers.Add(new LSL_Integer(0)); + + if(!String.IsNullOrEmpty(json)) + workData = LitJson.JsonMapper.ToObject(json); + else + { + workData = new LitJson.JsonData(); + workData.SetJsonType(LitJson.JsonType.Array); + } } - catch (Exception) + catch (Exception e) { + string m = e.Message; // debug point + return ScriptBaseClass.JSON_INVALID; + } + try + { + LitJson.JsonData replace = JsonSetSpecific(workData, specifiers, 0, value); + if(replace != null) + workData = replace; + } + catch (Exception e) + { + string m = e.Message; // debug point + return ScriptBaseClass.JSON_INVALID; + } + + try + { + string r = LitJson.JsonMapper.ToJson(workData); + if(noSpecifiers) + r = r.Substring(1,r.Length -2); // strip leading and trailing brakets + return r; + } + catch (Exception e) + { + string m = e.Message; // debug point } return ScriptBaseClass.JSON_INVALID; } - private void JsonSetSpecific(OSD o, LSL_List specifiers, int i, LSL_String val) + private LitJson.JsonData JsonSetSpecific(LitJson.JsonData elem, LSL_List specifiers, int level, LSL_String val) { - object spec = specifiers.Data[i]; - // 20131224 not used object specNext = i+1 == specifiers.Data.Length ? null : specifiers.Data[i+1]; - OSD nextVal = null; - if (o is OSDArray) + object spec = specifiers.Data[level]; + if(spec is LSL_String) + spec = ((LSL_String)spec).m_string; + else if (spec is LSL_Integer) + spec = ((LSL_Integer)spec).value; + + if(!(spec is string || spec is int)) + throw new IndexOutOfRangeException(); + + int speclen = specifiers.Data.Length - 1; + + bool hasvalue = false; + LitJson.JsonData value = null; + + LitJson.JsonType elemType = elem.GetJsonType(); + if (elemType == LitJson.JsonType.Array) + { + if (spec is int) + { + int v = (int)spec; + int c = elem.Count; + if(v < 0 || (v != 0 && v > c)) + throw new IndexOutOfRangeException(); + if(v == c) + elem.Add(JsonBuildRestOfSpec(specifiers, level + 1, val)); + else + { + hasvalue = true; + value = elem[v]; + } + } + else if (spec is string) + { + if((string)spec == ScriptBaseClass.JSON_APPEND) + elem.Add(JsonBuildRestOfSpec(specifiers, level + 1, val)); + else if(elem.Count < 2) + { + // our initial guess of array was wrong + LitJson.JsonData newdata = new LitJson.JsonData(); + newdata.SetJsonType(LitJson.JsonType.Object); + IOrderedDictionary no = newdata as IOrderedDictionary; + no.Add((string)spec,JsonBuildRestOfSpec(specifiers, level + 1, val)); + return newdata; + } + } + } + else if (elemType == LitJson.JsonType.Object) + { + if (spec is string) + { + IOrderedDictionary e = elem as IOrderedDictionary; + string key = (string)spec; + if(e.Contains(key)) + { + hasvalue = true; + value = (LitJson.JsonData)e[key]; + } + else + e.Add(key, JsonBuildRestOfSpec(specifiers, level + 1, val)); + } + else if(spec is int && (int)spec == 0) + { + //we are replacing a object by a array + LitJson.JsonData newData = new LitJson.JsonData(); + newData.SetJsonType(LitJson.JsonType.Array); + newData.Add(JsonBuildRestOfSpec(specifiers, level + 1, val)); + return newData; + } + } + else + { + LitJson.JsonData newData = JsonBuildRestOfSpec(specifiers, level, val); + return newData; + } + + if (hasvalue) + { + if (level < speclen) + { + LitJson.JsonData replace = JsonSetSpecific(value, specifiers, level + 1, val); + if(replace != null) + { + if(elemType == LitJson.JsonType.Array) + { + if(spec is int) + elem[(int)spec] = replace; + else if( spec is string) + { + LitJson.JsonData newdata = new LitJson.JsonData(); + newdata.SetJsonType(LitJson.JsonType.Object); + IOrderedDictionary no = newdata as IOrderedDictionary; + no.Add((string)spec, replace); + return newdata; + } + } + else if(elemType == LitJson.JsonType.Object) + { + if(spec is string) + elem[(string)spec] = replace; + else if(spec is int && (int)spec == 0) + { + LitJson.JsonData newdata = new LitJson.JsonData(); + newdata.SetJsonType(LitJson.JsonType.Array); + newdata.Add(replace); + return newdata; + } + } + } + return null; + } + else if(speclen == level) + { + if(val == ScriptBaseClass.JSON_DELETE) + { + if(elemType == LitJson.JsonType.Array) + { + if(spec is int) + { + IList el = elem as IList; + el.RemoveAt((int)spec); + } + } + else if(elemType == LitJson.JsonType.Object) + { + if(spec is string) + { + IOrderedDictionary eo = elem as IOrderedDictionary; + eo.Remove((string) spec); + } + } + return null; + } + + LitJson.JsonData newval = null; + float num; + if(val == null || val == ScriptBaseClass.JSON_NULL || val == "null") + newval = null; + else if(val == ScriptBaseClass.JSON_TRUE || val == "true") + newval = new LitJson.JsonData(true); + else if(val == ScriptBaseClass.JSON_FALSE || val == "false") + newval = new LitJson.JsonData(false); + else if(float.TryParse(val, out num)) + { + // assuming we are at en.us already + if(num - (int)num == 0.0f && !val.Contains(".")) + newval = new LitJson.JsonData((int)num); + else + { + num = (float)Math.Round(num,6); + newval = new LitJson.JsonData((double)num); + } + } + else + { + string str = val.m_string; + newval = new LitJson.JsonData(str); + } + + if(elemType == LitJson.JsonType.Array) + { + if(spec is int) + elem[(int)spec] = newval; + else if( spec is string) + { + LitJson.JsonData newdata = new LitJson.JsonData(); + newdata.SetJsonType(LitJson.JsonType.Object); + IOrderedDictionary no = newdata as IOrderedDictionary; + no.Add((string)spec,newval); + return newdata; + } + } + else if(elemType == LitJson.JsonType.Object) + { + if(spec is string) + elem[(string)spec] = newval; + else if(spec is int && (int)spec == 0) + { + LitJson.JsonData newdata = new LitJson.JsonData(); + newdata.SetJsonType(LitJson.JsonType.Array); + newdata.Add(newval); + return newdata; + } + } + } + } + if(val == ScriptBaseClass.JSON_DELETE) + throw new IndexOutOfRangeException(); + return null; + } + + private LitJson.JsonData JsonBuildRestOfSpec(LSL_List specifiers, int level, LSL_String val) + { + object spec = level >= specifiers.Data.Length ? null : specifiers.Data[level]; + // 20131224 not used object specNext = i+1 >= specifiers.Data.Length ? null : specifiers.Data[i+1]; + + float num; + if (spec == null) + { + if(val == null || val == ScriptBaseClass.JSON_NULL || val == "null") + return null; + if(val == ScriptBaseClass.JSON_DELETE) + throw new IndexOutOfRangeException(); + if(val == ScriptBaseClass.JSON_TRUE || val == "true") + return new LitJson.JsonData(true); + if(val == ScriptBaseClass.JSON_FALSE || val == "false") + return new LitJson.JsonData(false); + if(val == null || val == ScriptBaseClass.JSON_NULL || val == "null") + return null; + if(float.TryParse(val, out num)) + { + // assuming we are at en.us already + if(num - (int)num == 0.0f && !val.Contains(".")) + return new LitJson.JsonData((int)num); + else + { + num = (float)Math.Round(num,6); + return new LitJson.JsonData(num); + } + } + else + { + string str = val.m_string; + return new LitJson.JsonData(str); + } + throw new IndexOutOfRangeException(); + } + + if(spec is LSL_String) + spec = ((LSL_String)spec).m_string; + else if (spec is LSL_Integer) + spec = ((LSL_Integer)spec).value; + + if (spec is int || + (spec is string && ((string)spec) == ScriptBaseClass.JSON_APPEND) ) + { + if(spec is int && (int)spec != 0) + throw new IndexOutOfRangeException(); + LitJson.JsonData newdata = new LitJson.JsonData(); + newdata.SetJsonType(LitJson.JsonType.Array); + newdata.Add(JsonBuildRestOfSpec(specifiers, level + 1, val)); + return newdata; + } + else if (spec is string) + { + LitJson.JsonData newdata = new LitJson.JsonData(); + newdata.SetJsonType(LitJson.JsonType.Object); + IOrderedDictionary no = newdata as IOrderedDictionary; + no.Add((string)spec,JsonBuildRestOfSpec(specifiers, level + 1, val)); + return newdata; + } + throw new IndexOutOfRangeException(); + } + + private bool JsonFind(LitJson.JsonData elem, LSL_List specifiers, int level, out LitJson.JsonData value) + { + value = null; + if(elem == null) + return false; + + object spec; + spec = specifiers.Data[level]; + + bool haveVal = false; + LitJson.JsonData next = null; + + if (elem.GetJsonType() == LitJson.JsonType.Array) { - OSDArray array = ((OSDArray)o); if (spec is LSL_Integer) { - int v = ((LSL_Integer)spec).value; - if (v >= array.Count) - array.Add(JsonBuildRestOfSpec(specifiers, i + 1, val)); - else - nextVal = ((OSDArray)o)[v]; + int indx = (LSL_Integer)spec; + if(indx >= 0 && indx < elem.Count) + { + haveVal = true; + next = (LitJson.JsonData)elem[indx]; + } } - else if (spec is LSL_String && ((LSL_String)spec) == ScriptBaseClass.JSON_APPEND) - array.Add(JsonBuildRestOfSpec(specifiers, i + 1, val)); } - if (o is OSDMap) + else if (elem.GetJsonType() == LitJson.JsonType.Object) { if (spec is LSL_String) { - OSDMap map = ((OSDMap)o); - if (map.ContainsKey(((LSL_String)spec).m_string)) - nextVal = map[((LSL_String)spec).m_string]; - else - map.Add(((LSL_String)spec).m_string, JsonBuildRestOfSpec(specifiers, i + 1, val)); + IOrderedDictionary e = elem as IOrderedDictionary; + string key = (LSL_String)spec; + if(e.Contains(key)) + { + haveVal = true; + next = (LitJson.JsonData)e[key]; + } } } - if (nextVal != null) + + if (haveVal) { - if (specifiers.Data.Length - 1 > i) + if(level == specifiers.Data.Length - 1) { - JsonSetSpecific(nextVal, specifiers, i + 1, val); - return; + value = next; + return true; } + + level++; + if(next == null) + return false; + + LitJson.JsonType nextType = next.GetJsonType(); + if(nextType != LitJson.JsonType.Object && nextType != LitJson.JsonType.Array) + return false; + + return JsonFind(next, specifiers, level, out value); } + return false; } - private OSD JsonBuildRestOfSpec(LSL_List specifiers, int i, LSL_String val) + public LSL_String llJsonGetValue(LSL_String json, LSL_List specifiers) { - object spec = i >= specifiers.Data.Length ? null : specifiers.Data[i]; - // 20131224 not used object specNext = i+1 >= specifiers.Data.Length ? null : specifiers.Data[i+1]; + if(String.IsNullOrWhiteSpace(json)) + return ScriptBaseClass.JSON_INVALID; - if (spec == null) - return OSD.FromString(val); + if(specifiers.Length > 0 && (json == "{}" || json == "[]")) + return ScriptBaseClass.JSON_INVALID; - if (spec is LSL_Integer || - (spec is LSL_String && ((LSL_String)spec) == ScriptBaseClass.JSON_APPEND)) + char first = ((string)json)[0]; + if((first != '[' && first !='{')) { - OSDArray array = new OSDArray(); - array.Add(JsonBuildRestOfSpec(specifiers, i + 1, val)); - return array; + if(specifiers.Length > 0) + return ScriptBaseClass.JSON_INVALID; + json = "[" + json + "]"; // could handle single element case.. but easier like this + specifiers.Add((LSL_Integer)0); } - else if (spec is LSL_String) + + LitJson.JsonData jsonData; + try { - OSDMap map = new OSDMap(); - map.Add((LSL_String)spec, JsonBuildRestOfSpec(specifiers, i + 1, val)); - return map; + jsonData = LitJson.JsonMapper.ToObject(json); + } + catch (Exception e) + { + string m = e.Message; // debug point + return ScriptBaseClass.JSON_INVALID; + } + + LitJson.JsonData elem = null; + if(specifiers.Length == 0) + elem = jsonData; + else + { + if(!JsonFind(jsonData, specifiers, 0, out elem)) + return ScriptBaseClass.JSON_INVALID; + } + return JsonElementToString(elem); + } + + private LSL_String JsonElementToString(LitJson.JsonData elem) + { + if(elem == null) + return ScriptBaseClass.JSON_NULL; + + LitJson.JsonType elemType = elem.GetJsonType(); + switch(elemType) + { + case LitJson.JsonType.Array: + return new LSL_String(LitJson.JsonMapper.ToJson(elem)); + case LitJson.JsonType.Boolean: + return new LSL_String((bool)elem ? ScriptBaseClass.JSON_TRUE : ScriptBaseClass.JSON_FALSE); + case LitJson.JsonType.Double: + double d= (double)elem; + string sd = String.Format(Culture.FormatProvider, "{0:0.0#####}",d); + return new LSL_String(sd); + case LitJson.JsonType.Int: + int i = (int)elem; + return new LSL_String(i.ToString()); + case LitJson.JsonType.Long: + long l = (long)elem; + return new LSL_String(l.ToString()); + case LitJson.JsonType.Object: + return new LSL_String(LitJson.JsonMapper.ToJson(elem)); + case LitJson.JsonType.String: + string s = (string)elem; + return new LSL_String(s); + case LitJson.JsonType.None: + return ScriptBaseClass.JSON_NULL; + default: + return ScriptBaseClass.JSON_INVALID; } - return new OSD(); } public LSL_String llJsonValueType(LSL_String json, LSL_List specifiers) { - OSD o = OSDParser.DeserializeJson(json); - OSD specVal = JsonGetSpecific(o, specifiers, 0); - if (specVal == null) + if(String.IsNullOrWhiteSpace(json)) return ScriptBaseClass.JSON_INVALID; - switch (specVal.Type) + + if(specifiers.Length > 0 && (json == "{}" || json == "[]")) + return ScriptBaseClass.JSON_INVALID; + + char first = ((string)json)[0]; + if((first != '[' && first !='{')) { - case OSDType.Array: - return ScriptBaseClass.JSON_ARRAY; - case OSDType.Boolean: - return specVal.AsBoolean() ? ScriptBaseClass.JSON_TRUE : ScriptBaseClass.JSON_FALSE; - case OSDType.Integer: - case OSDType.Real: - return ScriptBaseClass.JSON_NUMBER; - case OSDType.Map: - return ScriptBaseClass.JSON_OBJECT; - case OSDType.String: - case OSDType.UUID: - return ScriptBaseClass.JSON_STRING; - case OSDType.Unknown: - return ScriptBaseClass.JSON_NULL; + if(specifiers.Length > 0) + return ScriptBaseClass.JSON_INVALID; + json = "[" + json + "]"; // could handle single element case.. but easier like this + specifiers.Add((LSL_Integer)0); + } + + LitJson.JsonData jsonData; + try + { + jsonData = LitJson.JsonMapper.ToObject(json); + } + catch (Exception e) + { + string m = e.Message; // debug point + return ScriptBaseClass.JSON_INVALID; + } + + LitJson.JsonData elem = null; + if(specifiers.Length == 0) + elem = jsonData; + else + { + if(!JsonFind(jsonData, specifiers, 0, out elem)) + return ScriptBaseClass.JSON_INVALID; + } + + if(elem == null) + return ScriptBaseClass.JSON_NULL; + + LitJson.JsonType elemType = elem.GetJsonType(); + switch(elemType) + { + case LitJson.JsonType.Array: + return ScriptBaseClass.JSON_ARRAY; + case LitJson.JsonType.Boolean: + return (bool)elem ? ScriptBaseClass.JSON_TRUE : ScriptBaseClass.JSON_FALSE; + case LitJson.JsonType.Double: + case LitJson.JsonType.Int: + case LitJson.JsonType.Long: + return ScriptBaseClass.JSON_NUMBER; + case LitJson.JsonType.Object: + return ScriptBaseClass.JSON_OBJECT; + case LitJson.JsonType.String: + string s = (string)elem; + if(s == ScriptBaseClass.JSON_NULL) + return ScriptBaseClass.JSON_NULL; + if(s == ScriptBaseClass.JSON_TRUE) + return ScriptBaseClass.JSON_TRUE; + if(s == ScriptBaseClass.JSON_FALSE) + return ScriptBaseClass.JSON_FALSE; + return ScriptBaseClass.JSON_STRING; + case LitJson.JsonType.None: + return ScriptBaseClass.JSON_NULL; + default: + return ScriptBaseClass.JSON_INVALID; } - return ScriptBaseClass.JSON_INVALID; } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index ce0fa4824c..a277f6c4fc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs @@ -29,6 +29,7 @@ using System; using vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3; using rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion; using LSLInteger = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger; +using LSLString = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString; namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { @@ -834,15 +835,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public const int KFM_CMD_STOP = 1; public const int KFM_CMD_PAUSE = 2; - public const string JSON_ARRAY = "JSON_ARRAY"; - public const string JSON_OBJECT = "JSON_OBJECT"; - public const string JSON_INVALID = "JSON_INVALID"; - public const string JSON_NUMBER = "JSON_NUMBER"; - public const string JSON_STRING = "JSON_STRING"; - public const string JSON_TRUE = "JSON_TRUE"; - public const string JSON_FALSE = "JSON_FALSE"; - public const string JSON_NULL = "JSON_NULL"; - public const string JSON_APPEND = "JSON_APPEND"; + public const string JSON_INVALID = "\uFDD0"; + public const string JSON_OBJECT = "\uFDD1"; + public const string JSON_ARRAY = "\uFDD2"; + public const string JSON_NUMBER = "\uFDD3"; + public const string JSON_STRING = "\uFDD4"; + public const string JSON_NULL = "\uFDD5"; + public const string JSON_TRUE = "\uFDD6"; + public const string JSON_FALSE = "\uFDD7"; + public const string JSON_DELETE = "\uFDD8"; + public const string JSON_APPEND = "-1"; /// /// process name parameter as regex diff --git a/bin/Npgsql.dll b/bin/Npgsql.dll old mode 100755 new mode 100644 index 24ca4bde64..693cccb425 Binary files a/bin/Npgsql.dll and b/bin/Npgsql.dll differ diff --git a/bin/Npgsql.xml b/bin/Npgsql.xml index a51252d119..81334301da 100644 --- a/bin/Npgsql.xml +++ b/bin/Npgsql.xml @@ -4,1379 +4,6 @@ Npgsql - - - This class represents a parameter to a command that will be sent to server - - - - - Initializes a new instance of the NpgsqlParameter class. - - - - - Initializes a new instance of the NpgsqlParameter - class with the parameter m_Name and a value of the new NpgsqlParameter. - - The m_Name of the parameter to map. - An Object that is the value of the NpgsqlParameter. - -

When you specify an Object - in the value parameter, the DbType is - inferred from the .NET Framework type of the Object.

-

When using this constructor, you must be aware of a possible misuse of the constructor which takes a DbType parameter. - This happens when calling this constructor passing an int 0 and the compiler thinks you are passing a value of DbType. - Use Convert.ToInt32(value) for example to have compiler calling the correct constructor.

-
-
- - - Initializes a new instance of the NpgsqlParameter - class with the parameter m_Name and the data type. - - The m_Name of the parameter to map. - One of the DbType values. - - - - Initializes a new instance of the NpgsqlParameter - class with the parameter m_Name, the DbType, and the size. - - The m_Name of the parameter to map. - One of the DbType values. - The length of the parameter. - - - - Initializes a new instance of the NpgsqlParameter - class with the parameter m_Name, the DbType, the size, - and the source column m_Name. - - The m_Name of the parameter to map. - One of the DbType values. - The length of the parameter. - The m_Name of the source column. - - - - Initializes a new instance of the NpgsqlParameter - class with the parameter m_Name, the DbType, the size, - the source column m_Name, a ParameterDirection, - the precision of the parameter, the scale of the parameter, a - DataRowVersion to use, and the - value of the parameter. - - The m_Name of the parameter to map. - One of the DbType values. - The length of the parameter. - The m_Name of the source column. - One of the ParameterDirection values. - true if the value of the field can be null, otherwise false. - The total number of digits to the left and right of the decimal point to which - Value is resolved. - The total number of decimal places to which - Value is resolved. - One of the DataRowVersion values. - An Object that is the value - of the NpgsqlParameter. - - - - Creates a new NpgsqlParameter that - is a copy of the current instance. - - A new NpgsqlParameter that is a copy of this instance. - - - - Gets or sets the maximum number of digits used to represent the - Value property. - - The maximum number of digits used to represent the - Value property. - The default value is 0, which indicates that the data provider - sets the precision for Value. - - - - Gets or sets the number of decimal places to which - Value is resolved. - - The number of decimal places to which - Value is resolved. The default is 0. - - - - Gets or sets the maximum size, in bytes, of the data within the column. - - The maximum size, in bytes, of the data within the column. - The default value is inferred from the parameter value. - - - - Gets or sets the DbType of the parameter. - - One of the DbType values. The default is String. - - - - Gets or sets the DbType of the parameter. - - One of the DbType values. The default is String. - - - - Gets or sets a value indicating whether the parameter is input-only, - output-only, bidirectional, or a stored procedure return value parameter. - - One of the ParameterDirection - values. The default is Input. - - - - Gets or sets a value indicating whether the parameter accepts null values. - - true if null values are accepted; otherwise, false. The default is false. - - - - Gets or sets the m_Name of the NpgsqlParameter. - - The m_Name of the NpgsqlParameter. - The default is an empty string. - - - - The m_Name scrubbed of any optional marker - - - - - Gets or sets the m_Name of the source column that is mapped to the - DataSet and used for loading or - returning the Value. - - The m_Name of the source column that is mapped to the - DataSet. The default is an empty string. - - - - Gets or sets the DataRowVersion - to use when loading Value. - - One of the DataRowVersion values. - The default is Current. - - - - Gets or sets the value of the parameter. - - An Object that is the value of the parameter. - The default value is null. - - - - Gets or sets the value of the parameter. - - An Object that is the value of the parameter. - The default value is null. - - - - This class represents the Parse message sent to PostgreSQL - server. - - - - - - For classes representing messages sent from the client to the server. - - - - - Writes given objects into a stream for PostgreSQL COPY in default copy format (not CSV or BINARY). - - - - - Return an exact copy of this NpgsqlConnectionString. - - - - - This function will set value for known key, both private member and base[key]. - - - - - - - The function will modify private member only, not base[key]. - - - - - - - Clear the member and assign them to the default value. - - - - - Compatibilty version. When possible, behaviour caused by breaking changes will be preserved - if this version is less than that where the breaking change was introduced. - - - - - Case insensative accessor for indivual connection string values. - - - - - Common base class for all derived MD5 implementations. - - - - - Called from constructor of derived class. - - - - - Finalizer for HashAlgorithm - - - - - Computes the entire hash of all the bytes in the byte array. - - - - - When overridden in a derived class, drives the hashing function. - - - - - - - - When overridden in a derived class, this pads and hashes whatever data might be left in the buffers and then returns the hash created. - - - - - When overridden in a derived class, initializes the object to prepare for hashing. - - - - - Used for stream chaining. Computes hash as data passes through it. - - The buffer from which to grab the data to be copied. - The offset into the input buffer to start reading at. - The number of bytes to be copied. - The buffer to write the copied data to. - At what point in the outputBuffer to write the data at. - - - - Used for stream chaining. Computes hash as data passes through it. Finishes off the hash. - - The buffer from which to grab the data to be copied. - The offset into the input buffer to start reading at. - The number of bytes to be copied. - - - - Get whether or not the hash can transform multiple blocks at a time. - Note: MUST be overriden if descendant can transform multiple block - on a single call! - - - - - Gets the previously computed hash. - - - - - Returns the size in bits of the hash. - - - - - Must be overriden if not 1 - - - - - Must be overriden if not 1 - - - - - Called from constructor of derived class. - - - - - Creates the default derived class. - - - - - Given a join expression and a projection, fetch all columns in the projection - that reference columns in the join. - - - - - Given an InputExpression append all from names (including nested joins) to the list. - - - - - Get new ColumnExpression that will be used in projection that had it's existing columns moved. - These should be simple references to the inner column - - - - - Every property accessed in the list of columns must be adjusted for a new scope - - - - - This class provides many util methods to handle - reading and writing of PostgreSQL protocol messages. - - - - - This method takes a ProtocolVersion and returns an integer - version number that the Postgres backend will recognize in a - startup packet. - - - - - This method takes a version string as returned by SELECT VERSION() and returns - a valid version string ("7.2.2" for example). - This is only needed when running protocol version 2. - This does not do any validity checks. - - - - - This method gets a C NULL terminated string from the network stream. - It keeps reading a byte in each time until a NULL byte is returned. - It returns the resultant string of bytes read. - This string is sent from backend. - - - - - Reads requested number of bytes from stream with retries until Stream.Read returns 0 or count is reached. - - Stream to read - byte buffer to fill - starting position to fill the buffer - number of bytes to read - The number of bytes read. May be less than count if no more bytes are available. - - - - This method writes a C NULL terminated string to the network stream. - It appends a NULL terminator to the end of the String. - - - This method writes a C NULL terminated string to the network stream. - It appends a NULL terminator to the end of the String. - - - - - This method writes a set of bytes to the stream. It also enables logging of them. - - - - - This method writes a C NULL terminated string limited in length to the - backend server. - It pads the string with null bytes to the size specified. - - - - - Write a 32-bit integer to the given stream in the correct byte order. - - - - - Read a 32-bit integer from the given stream in the correct byte order. - - - - - Write a 16-bit integer to the given stream in the correct byte order. - - - - - Read a 16-bit integer from the given stream in the correct byte order. - - - - - Represent the frontend/backend protocol version. - - - - - Represent the backend server version. - As this class offers no functionality beyond that offered by it has been - deprecated in favour of that class. - - - - - - Returns the string representation of this version in three place dot notation (Major.Minor.Patch). - - - - - Server version major number. - - - - - Server version minor number. - - - - - Server version patch level number. - - - - - Represents a PostgreSQL COPY TO STDOUT operation with a corresponding SQL statement - to execute against a PostgreSQL database - and an associated stream used to write results to (if provided by user) - or for reading the results (when generated by driver). - Eg. new NpgsqlCopyOut("COPY (SELECT * FROM mytable) TO STDOUT", connection, streamToWrite).Start(); - - - - - Creates NpgsqlCommand to run given query upon Start(), after which CopyStream provides data from database as requested in the query. - - - - - Given command is run upon Start(), after which CopyStream provides data from database as requested in the query. - - - - - Given command is executed upon Start() and all requested copy data is written to toStream immediately. - - - - - Returns true if this operation is currently active and field at given location is in binary format. - - - - - Command specified upon creation is executed as a non-query. - If CopyStream is set upon creation, all copy data from server will be written to it, and operation will be finished immediately. - Otherwise the CopyStream member can be used for reading copy data from server until no more data is available. - - - - - Flush generated CopyStream at once. Effectively reads and discard all the rest of copy data from server. - - - - - Returns true if the connection is currently reserved for this operation. - - - - - The stream provided by user or generated upon Start() - - - - - The Command used to execute this copy operation. - - - - - Returns true if this operation is currently active and in binary format. - - - - - Returns number of fields if this operation is currently active, otherwise -1 - - - - - Faster alternative to using the generated CopyStream. - - - - - This class manages all connector objects, pooled AND non-pooled. - - - - Unique static instance of the connector pool - mamager. - - - Map of index to unused pooled connectors, avaliable to the - next RequestConnector() call. - This hashmap will be indexed by connection string. - This key will hold a list of queues of pooled connectors available to be used. - - - Timer for tracking unused connections in pools. - - - - Searches the shared and pooled connector lists for a - matching connector object or creates a new one. - - The NpgsqlConnection that is requesting - the connector. Its ConnectionString will be used to search the - pool for available connectors. - A connector object. - - - - Find a pooled connector. Handle locking and timeout here. - - - - - Find a pooled connector. Handle shared/non-shared here. - - - - - Releases a connector, possibly back to the pool for future use. - - - Pooled connectors will be put back into the pool if there is room. - Shared connectors should just have their use count decremented - since they always stay in the shared pool. - - The connector to release. - - - - Release a pooled connector. Handle locking here. - - - - - Release a pooled connector. Handle shared/non-shared here. - - - - - Create a connector without any pooling functionality. - - - - - Find an available pooled connector in the non-shared pool, or create - a new one if none found. - - - - - This method is only called when NpgsqlConnection.Dispose(false) is called which means a - finalization. This also means, an NpgsqlConnection was leak. We clear pool count so that - client doesn't end running out of connections from pool. When the connection is finalized, its underlying - socket is closed. - - - - - Close the connector. - - - Connector to release - - - - Put a pooled connector into the pool queue. - - Connector to pool - - - - A queue with an extra Int32 for keeping track of busy connections. - - - - - Connections available to the end user - - - - - Connections currently in use - - - - - This class represents a BackEndKeyData message received - from PostgreSQL - - - - - Used when a connection is closed - - - - - Summary description for NpgsqlQuery - - - - - Represents the method that handles the Notice events. - - A NpgsqlNoticeEventArgs that contains the event data. - - - - Represents the method that handles the Notification events. - - The source of the event. - A NpgsqlNotificationEventArgs that contains the event data. - - - - This class represents a connection to a - PostgreSQL server. - - - - - Initializes a new instance of the - NpgsqlConnection class. - - - - - Initializes a new instance of the - NpgsqlConnection class - and sets the ConnectionString. - - The connection used to open the PostgreSQL database. - - - - Begins a database transaction with the specified isolation level. - - The isolation level under which the transaction should run. - An DbTransaction - object representing the new transaction. - - Currently the IsolationLevel ReadCommitted and Serializable are supported by the PostgreSQL backend. - There's no support for nested transactions. - - - - - Begins a database transaction. - - A NpgsqlTransaction - object representing the new transaction. - - Currently there's no support for nested transactions. - - - - - Begins a database transaction with the specified isolation level. - - The isolation level under which the transaction should run. - A NpgsqlTransaction - object representing the new transaction. - - Currently the IsolationLevel ReadCommitted and Serializable are supported by the PostgreSQL backend. - There's no support for nested transactions. - - - - - Opens a database connection with the property settings specified by the - ConnectionString. - - - - - This method changes the current database by disconnecting from the actual - database and connecting to the specified. - - The name of the database to use in place of the current database. - - - - Releases the connection to the database. If the connection is pooled, it will be - made available for re-use. If it is non-pooled, the actual connection will be shutdown. - - - - - Creates and returns a DbCommand - object associated with the IDbConnection. - - A DbCommand object. - - - - Creates and returns a NpgsqlCommand - object associated with the NpgsqlConnection. - - A NpgsqlCommand object. - - - - Releases all resources used by the - NpgsqlConnection. - - true when called from Dispose(); - false when being called from the finalizer. - - - - Create a new connection based on this one. - - A new NpgsqlConnection object. - - - - Create a new connection based on this one. - - A new NpgsqlConnection object. - - - - Default SSL CertificateSelectionCallback implementation. - - - - - Default SSL CertificateValidationCallback implementation. - - - - - Default SSL PrivateKeySelectionCallback implementation. - - - - - Default SSL ProvideClientCertificatesCallback implementation. - - - - - Write each key/value pair in the connection string to the log. - - - - - Returns the supported collections - - - - - Returns the schema collection specified by the collection name. - - The collection name. - The collection specified. - - - - Returns the schema collection specified by the collection name filtered by the restrictions. - - The collection name. - - The restriction values to filter the results. A description of the restrictions is contained - in the Restrictions collection. - - The collection specified. - - - - Occurs on NoticeResponses from the PostgreSQL backend. - - - - - Occurs on NotificationResponses from the PostgreSQL backend. - - - - - Called to provide client certificates for SSL handshake. - - - - - Mono.Security.Protocol.Tls.CertificateSelectionCallback delegate. - - - - - Mono.Security.Protocol.Tls.CertificateValidationCallback delegate. - - - - - Mono.Security.Protocol.Tls.PrivateKeySelectionCallback delegate. - - - - - Gets or sets the string used to connect to a PostgreSQL database. - Valid values are: -
    -
  • - Server: Address/Name of Postgresql Server; -
  • -
  • - Port: Port to connect to; -
  • -
  • - Protocol: Protocol version to use, instead of automatic; Integer 2 or 3; -
  • -
  • - Database: Database name. Defaults to user name if not specified; -
  • -
  • - User Id: User name; -
  • -
  • - Password: Password for clear text authentication; -
  • -
  • - SSL: True or False. Controls whether to attempt a secure connection. Default = False; -
  • -
  • - Pooling: True or False. Controls whether connection pooling is used. Default = True; -
  • -
  • - MinPoolSize: Min size of connection pool; -
  • -
  • - MaxPoolSize: Max size of connection pool; -
  • -
  • - Timeout: Time to wait for connection open in seconds. Default is 15. -
  • -
  • - CommandTimeout: Time to wait for command to finish execution before throw an exception. In seconds. Default is 20. -
  • -
  • - Sslmode: Mode for ssl connection control. Can be Prefer, Require, Allow or Disable. Default is Disable. Check user manual for explanation of values. -
  • -
  • - ConnectionLifeTime: Time to wait before closing unused connections in the pool in seconds. Default is 15. -
  • -
  • - SyncNotification: Specifies if Npgsql should use synchronous notifications. -
  • -
  • - SearchPath: Changes search path to specified and public schemas. -
  • -
-
- The connection string that includes the server name, - the database name, and other parameters needed to establish - the initial connection. The default value is an empty string. - -
- - - Backend server host name. - - - - - Backend server port. - - - - - If true, the connection will attempt to use SSL. - - - - - Gets the time to wait while trying to establish a connection - before terminating the attempt and generating an error. - - The time (in seconds) to wait for a connection to open. The default value is 15 seconds. - - - - Gets the time to wait while trying to execute a command - before terminating the attempt and generating an error. - - The time (in seconds) to wait for a command to complete. The default value is 20 seconds. - - - - Gets the time to wait before closing unused connections in the pool if the count - of all connections exeeds MinPoolSize. - - - If connection pool contains unused connections for ConnectionLifeTime seconds, - the half of them will be closed. If there will be unused connections in a second - later then again the half of them will be closed and so on. - This strategy provide smooth change of connection count in the pool. - - The time (in seconds) to wait. The default value is 15 seconds. - - - - Gets the name of the current database or the database to be used after a connection is opened. - - The name of the current database or the name of the database to be - used after a connection is opened. The default value is the empty string. - - - - Whether datareaders are loaded in their entirety (for compatibility with earlier code). - - - - - Gets the database server name. - - - - - Gets flag indicating if we are using Synchronous notification or not. - The default value is false. - - - - - Gets the current state of the connection. - - A bitwise combination of the ConnectionState values. The default is Closed. - - - - Gets whether the current state of the connection is Open or Closed - - ConnectionState.Open or ConnectionState.Closed - - - - Version of the PostgreSQL backend. - This can only be called when there is an active connection. - - - - - Protocol version in use. - This can only be called when there is an active connection. - - - - - Process id of backend server. - This can only be called when there is an active connection. - - - - - The connector object connected to the backend. - - - - - Gets the NpgsqlConnectionStringBuilder containing the parsed connection string values. - - - - - User name. - - - - - Password. - - - - - Determine if connection pooling will be used for this connection. - - - - - This class represents the CancelRequest message sent to PostgreSQL - server. - - - - - - - - - - - - - - - - - - - A time period expressed in 100ns units. - - - A time period expressed in a - - - Number of 100ns units. - - - Number of seconds. - - - Number of milliseconds. - - - Number of milliseconds. - - - Number of milliseconds. - - - A d with the given number of ticks. - - - A d with the given number of microseconds. - - - A d with the given number of milliseconds. - - - A d with the given number of seconds. - - - A d with the given number of minutes. - - - A d with the given number of hours. - - - A d with the given number of days. - - - A d with the given number of months. - - - An whose values are the sums of the two instances. - - - An whose values are the differences of the two instances. - - - An whose value is the negated value of this instance. - - - An whose value is the absolute value of this instance. - - - - An based on this one, but with any days converted to multiples of ±24hours. - - - - An based on this one, but with any months converted to multiples of ±30days. - - - - An based on this one, but with any months converted to multiples of ±30days and then any days converted to multiples of ±24hours; - - - - An eqivalent, canonical, . - - - An equivalent . - - - - - - An signed integer. - - - - The argument is not an . - - - The string was not in a format that could be parsed to produce an . - - - true if the parsing succeeded, false otherwise. - - - The representation. - - - An whose values are the sum of the arguments. - - - An whose values are the difference of the arguments - - - true if the two arguments are exactly the same, false otherwise. - - - false if the two arguments are exactly the same, true otherwise. - - - true if the first is less than second, false otherwise. - - - true if the first is less than or equivalent to second, false otherwise. - - - true if the first is greater than second, false otherwise. - - - true if the first is greater than or equivalent to the second, false otherwise. - - - The argument. - - - The negation of the argument. - - - - - - - - - - - - - - - - - - - - This time, normalised - - - - - - - - - This time, normalised - - - An integer which is 0 if they are equal, < 0 if this is the smaller and > 0 if this is the larger. - - - - - - - - - A class to handle everything associated with SSPI authentication - - - - - Simplified SecBufferDesc struct with only one SecBuffer - - - - - This class represents the Parse message sent to PostgreSQL - server. - - - - - - EventArgs class to send Notice parameters, which are just NpgsqlError's in a lighter context. - - - - - Notice information. - - - - - This class represents the ErrorResponse and NoticeResponse - message sent from PostgreSQL server. - - - - - Return a string representation of this error object. - - - - - Severity code. All versions. - - - - - Error code. PostgreSQL 7.4 and up. - - - - - Terse error message. All versions. - - - - - Detailed error message. PostgreSQL 7.4 and up. - - - - - Suggestion to help resolve the error. PostgreSQL 7.4 and up. - - - - - Position (one based) within the query string where the error was encounterd. PostgreSQL 7.4 and up. - - - - - Position (one based) within the query string where the error was encounterd. This position refers to an internal command executed for example inside a PL/pgSQL function. PostgreSQL 7.4 and up. - - - - - Internal query string where the error was encounterd. This position refers to an internal command executed for example inside a PL/pgSQL function. PostgreSQL 7.4 and up. - - - - - Trace back information. PostgreSQL 7.4 and up. - - - - - Source file (in backend) reporting the error. PostgreSQL 7.4 and up. - - - - - Source file line number (in backend) reporting the error. PostgreSQL 7.4 and up. - - - - - Source routine (in backend) reporting the error. PostgreSQL 7.4 and up. - - - - - String containing the sql sent which produced this error. - - - - - Backend protocol version in use. - - - - - Represents an ongoing COPY TO STDOUT operation. - Provides methods to read data from server or end the operation. - - - - This class represents the base class for the state pattern design pattern - implementation. - - - - - - This method is used by the states to change the state of the context. - - - - - This method is responsible to handle all protocol messages sent from the backend. - It holds all the logic to do it. - To exchange data, it uses a Mediator object from which it reads/writes information - to handle backend requests. - - - - - - This method is responsible to handle all protocol messages sent from the backend. - It holds all the logic to do it. - To exchange data, it uses a Mediator object from which it reads/writes information - to handle backend requests. - - - - - - Called from NpgsqlState.ProcessBackendResponses upon CopyOutResponse. - If CopyStream is already set, it is used to write data received from server, after which the copy ends. - Otherwise CopyStream is set to a readable NpgsqlCopyOutStream that receives data from server. - - - - - Called from NpgsqlOutStream.Read to read copy data from server. - - - - - Copy format information returned from server. - - Handles serialisation of .NET array or IEnumeration to pg format. @@ -1394,11 +21,22 @@ The that would be used to serialise the element type. - + Serialise the enumeration or array. + + + Convert a System.Array to PG binary format. + Write the array header and prepare to write array data to the stream. + + + + + Append all array data to the binary stream. + + Handles parsing of pg arrays into .NET arrays. @@ -1434,9 +72,9 @@ for the element type. - + - Creates an array from pg representation. + Creates an array from pg text representation. @@ -1448,1692 +86,33 @@ Creates an n-dimensional array from an ArrayList of ArrayLists or - a 1-dimensional array from something else. + a 1-dimensional array from something else. to convert + Type of the elements in the list produced. + + + Creates an n-dimensional System.Array from PG binary representation. + This function reads the array header and sets up an n-dimensional System.Array object to hold its data. + PopulateArrayFromBinaryArray() is then called to carry out array population. + + + + + Recursively populates an array from PB binary data representation. + + - - Takes an array of ints and treats them like the limits of a set of counters. - Retains a matching set of ints that is set to all zeros on the first ++ - On a ++ it increments the "right-most" int. If that int reaches it's - limit it is set to zero and the one before it is incremented, and so on. - - Making this a more general purpose class is pretty straight-forward, but we'll just put what we need here. - - - - This class represents the ParameterStatus message sent from PostgreSQL - server. - + Takes an array of ints and treats them like the limits of a set of counters. + Retains a matching set of ints that is set to all zeros on the first ++ + On a ++ it increments the "right-most" int. If that int reaches it's + limit it is set to zero and the one before it is incremented, and so on. - - - - This class is responsible for serving as bridge between the backend - protocol handling and the core classes. It is used as the mediator for - exchanging data generated/sent from/to backend. + Making this a more general purpose class is pretty straight-forward, but we'll just put what we need here. - - - - - This class is responsible to create database commands for automatic insert, update and delete operations. - - - - - - This method is reponsible to derive the command parameter list with values obtained from function definition. - It clears the Parameters collection of command. Also, if there is any parameter type which is not supported by Npgsql, an InvalidOperationException will be thrown. - Parameters name will be parameter1, parameter2, ... - For while, only parameter name and NpgsqlDbType are obtained. - - NpgsqlCommand whose function parameters will be obtained. - - - - Represents a completed response message. - - - - - - Marker interface which identifies a class which may take possession of a stream for the duration of - it's lifetime (possibly temporarily giving that possession to another class for part of that time. - - It inherits from IDisposable, since any such class must make sure it leaves the stream in a valid state. - - The most important such class is that compiler-generated from ProcessBackendResponsesEnum. Of course - we can't make that inherit from this interface, alas. - - - - - The exception that is thrown when the PostgreSQL backend reports errors. - - - - - Construct a backend error exception based on a list of one or more - backend errors. The basic Exception.Message will be built from the - first (usually the only) error in the list. - - - - - Format a .NET style exception string. - Include all errors in the list, including any hints. - - - - - Append a line to the given Stream, first checking for zero-length. - - - - - Provide access to the entire list of errors provided by the PostgreSQL backend. - - - - - Severity code. All versions. - - - - - Error code. PostgreSQL 7.4 and up. - - - - - Basic error message. All versions. - - - - - Detailed error message. PostgreSQL 7.4 and up. - - - - - Suggestion to help resolve the error. PostgreSQL 7.4 and up. - - - - - Position (one based) within the query string where the error was encounterd. PostgreSQL 7.4 and up. - - - - - Trace back information. PostgreSQL 7.4 and up. - - - - - Source file (in backend) reporting the error. PostgreSQL 7.4 and up. - - - - - Source file line number (in backend) reporting the error. PostgreSQL 7.4 and up. - - - - - Source routine (in backend) reporting the error. PostgreSQL 7.4 and up. - - - - - String containing the sql sent which produced this error. - - - - - Returns the entire list of errors provided by the PostgreSQL backend. - - - - - The level of verbosity of the NpgsqlEventLog - - - - - Don't log at all - - - - - Only log the most common issues - - - - - Log everything - - - - - This class handles all the Npgsql event and debug logging - - - - - Writes a string to the Npgsql event log if msglevel is bigger then NpgsqlEventLog.Level - - - This method is obsolete and should no longer be used. - It is likely to be removed in future versions of Npgsql - - The message to write to the event log - The minimum LogLevel for which this message should be logged. - - - - Writes a string to the Npgsql event log if msglevel is bigger then NpgsqlEventLog.Level - - The ResourceManager to get the localized resources - The name of the resource that should be fetched by the ResourceManager - The minimum LogLevel for which this message should be logged. - The additional parameters that shall be included into the log-message (must be compatible with the string in the resource): - - - - Writes the default log-message for the action of calling the Get-part of an Indexer to the log file. - - The minimum LogLevel for which this message should be logged. - The name of the class that contains the Indexer - The parameter given to the Indexer - - - - Writes the default log-message for the action of calling the Set-part of an Indexer to the logfile. - - The minimum LogLevel for which this message should be logged. - The name of the class that contains the Indexer - The parameter given to the Indexer - The value the Indexer is set to - - - - Writes the default log-message for the action of calling the Get-part of a Property to the logfile. - - The minimum LogLevel for which this message should be logged. - The name of the class that contains the Property - The name of the Property - - - - Writes the default log-message for the action of calling the Set-part of a Property to the logfile. - - The minimum LogLevel for which this message should be logged. - The name of the class that contains the Property - The name of the Property - The value the Property is set to - - - - Writes the default log-message for the action of calling a Method without Arguments to the logfile. - - The minimum LogLevel for which this message should be logged. - The name of the class that contains the Method - The name of the Method - - - - Writes the default log-message for the action of calling a Method with one Argument to the logfile. - - The minimum LogLevel for which this message should be logged. - The name of the class that contains the Method - The name of the Method - The value of the Argument of the Method - - - - Writes the default log-message for the action of calling a Method with two Arguments to the logfile. - - The minimum LogLevel for which this message should be logged. - The name of the class that contains the Method - The name of the Method - The value of the first Argument of the Method - The value of the second Argument of the Method - - - - Writes the default log-message for the action of calling a Method with three Arguments to the logfile. - - The minimum LogLevel for which this message should be logged. - The name of the class that contains the Method - The name of the Method - The value of the first Argument of the Method - The value of the second Argument of the Method - The value of the third Argument of the Method - - - - Writes the default log-message for the action of calling a Method with more than three Arguments to the logfile. - - The minimum LogLevel for which this message should be logged. - The name of the class that contains the Method - The name of the Method - A Object-Array with zero or more Ojects that are Arguments of the Method. - - - - Sets/Returns the level of information to log to the logfile. - - The current LogLevel - - - - Sets/Returns the filename to use for logging. - - The filename of the current Log file. - - - - Sets/Returns whether Log messages should be echoed to the console - - true if Log messages are echoed to the console, otherwise false - - - - This class represents the Parse message sent to PostgreSQL - server. - - - - - - Represents a PostgreSQL COPY FROM STDIN operation with a corresponding SQL statement - to execute against a PostgreSQL database - and an associated stream used to read data from (if provided by user) - or for writing it (when generated by driver). - Eg. new NpgsqlCopyIn("COPY mytable FROM STDIN", connection, streamToRead).Start(); - - - - - Creates NpgsqlCommand to run given query upon Start(). Data for the requested COPY IN operation can then be written to CopyData stream followed by a call to End() or Cancel(). - - - - - Given command is run upon Start(). Data for the requested COPY IN operation can then be written to CopyData stream followed by a call to End() or Cancel(). - - - - - Given command is executed upon Start() and all data from fromStream is passed to it as copy data. - - - - - Returns true if this operation is currently active and field at given location is in binary format. - - - - - Command specified upon creation is executed as a non-query. - If CopyStream is set upon creation, it will be flushed to server as copy data, and operation will be finished immediately. - Otherwise the CopyStream member can be used for writing copy data to server and operation finished with a call to End() or Cancel(). - - - - - Called after writing all data to CopyStream to successfully complete this copy operation. - - - - - Withdraws an already started copy operation. The operation will fail with given error message. - Will do nothing if current operation is not active. - - - - - Returns true if the connection is currently reserved for this operation. - - - - - The stream provided by user or generated upon Start(). - User may provide a stream to constructor; it is used to pass to server all data read from it. - Otherwise, call to Start() sets this to a writable NpgsqlCopyInStream that passes all data written to it to server. - In latter case this is only available while the copy operation is active and null otherwise. - - - - - Returns true if this operation is currently active and in binary format. - - - - - Returns number of fields expected on each input row if this operation is currently active, otherwise -1 - - - - - The Command used to execute this copy operation. - - - - - Set before a COPY IN query to define size of internal buffer for reading from given CopyStream. - - - - - Represents information about COPY operation data transfer format as returned by server. - - - - - Only created when a CopyInResponse or CopyOutResponse is received by NpgsqlState.ProcessBackendResponses() - - - - - Returns true if this operation is currently active and field at given location is in binary format. - - - - - Returns true if this operation is currently active and in binary format. - - - - - Returns number of fields if this operation is currently active, otherwise -1 - - - - - - - - - Provide event handlers to convert all native supported basic data types from their backend - text representation to a .NET object. - - - - - Binary data. - - - - - Convert a postgresql boolean to a System.Boolean. - - - - - Convert a postgresql bit to a System.Boolean. - - - - - Convert a postgresql datetime to a System.DateTime. - - - - - Convert a postgresql date to a System.DateTime. - - - - - Convert a postgresql time to a System.DateTime. - - - - - Convert a postgresql money to a System.Decimal. - - - - - Provide event handlers to convert the basic native supported data types from - native form to backend representation. - - - - - Binary data. - - - - - Convert to a postgresql boolean. - - - - - Convert to a postgresql bit. - - - - - Convert to a postgresql timestamp. - - - - - Convert to a postgresql date. - - - - - Convert to a postgresql time. - - - - - Convert to a postgres money. - - - - - Convert to a postgres double with maximum precision. - - - - - Provide event handlers to convert extended native supported data types from their backend - text representation to a .NET object. - - - - - Convert a postgresql point to a System.NpgsqlPoint. - - - - - Convert a postgresql point to a System.RectangleF. - - - - - LDeg. - - - - - Path. - - - - - Polygon. - - - - - Circle. - - - - - Inet. - - - - - MAC Address. - - - - - interval - - - - - Provide event handlers to convert extended native supported data types from - native form to backend representation. - - - - - Point. - - - - - Box. - - - - - LSeg. - - - - - Open path. - - - - - Polygon. - - - - - Convert to a postgres MAC Address. - - - - - Circle. - - - - - Convert to a postgres inet. - - - - - Convert to a postgres interval - - - - - EventArgs class to send Notification parameters. - - - - - Process ID of the PostgreSQL backend that sent this notification. - - - - - Condition that triggered that notification. - - - - - Additional Information From Notifiying Process (for future use, currently postgres always sets this to an empty string) - - - - - Resolve a host name or IP address. - This is needed because if you call Dns.Resolve() with an IP address, it will attempt - to resolve it as a host name, when it should just convert it to an IP address. - - - - - - This class represents a RowDescription message sent from - the PostgreSQL. - - - - - - This struct represents the internal data of the RowDescription message. - - - - - This class represents the Parse message sent to PostgreSQL - server. - - - - - - A factory to create instances of various Npgsql objects. - - - - - Creates an NpgsqlCommand object. - - - - - This class represents the Parse message sent to PostgreSQL - server. - - - - - - Represents the method that handles the RowUpdated events. - - The source of the event. - A NpgsqlRowUpdatedEventArgs that contains the event data. - - - - Represents the method that handles the RowUpdating events. - - The source of the event. - A NpgsqlRowUpdatingEventArgs that contains the event data. - - - - This class represents an adapter from many commands: select, update, insert and delete to fill Datasets. - - - - - Stream for reading data from a table or select on a PostgreSQL version 7.4 or newer database during an active COPY TO STDOUT operation. - Passes data exactly as provided by the server. - - - - - Created only by NpgsqlCopyOutState.StartCopy() - - - - - Discards copy data as long as server pushes it. Returns after operation is finished. - Does nothing if this stream is not the active copy operation reader. - - - - - Not writable. - - - - - Not flushable. - - - - - Copies data read from server to given byte buffer. - Since server returns data row by row, length will differ each time, but it is only zero once the operation ends. - Can be mixed with calls to the more efficient NpgsqlCopyOutStream.Read() : byte[] though that would not make much sense. - - - - - Not seekable - - - - - Not supported - - - - - Returns a whole row of data from server without extra work. - If standard Stream.Read(...) has been called before, it's internal buffers remains are returned. - - - - - True while this stream can be used to read copy data from server - - - - - True - - - - - False - - - - - False - - - - - Number of bytes read so far - - - - - Number of bytes read so far; can not be set. - - - - - This class represents the Bind message sent to PostgreSQL - server. - - - - - - Summary description for LargeObjectManager. - - - - - Represents a transaction to be made in a PostgreSQL database. This class cannot be inherited. - - - - - Commits the database transaction. - - - - - Rolls back a transaction from a pending state. - - - - - Rolls back a transaction from a pending savepoint state. - - - - - Creates a transaction save point. - - - - - Cancel the transaction without telling the backend about it. This is - used to make the transaction go away when closing a connection. - - - - - Gets the NpgsqlConnection - object associated with the transaction, or a null reference if the - transaction is no longer valid. - - The NpgsqlConnection - object associated with the transaction. - - - - Specifies the IsolationLevel for this transaction. - - The IsolationLevel for this transaction. - The default is ReadCommitted. - - - - This class represents a StartupPacket message of PostgreSQL - protocol. - - - - - - Provides a means of reading a forward-only stream of rows from a PostgreSQL backend. This class cannot be inherited. - - - - - Return the data type name of the column at index . - - - - - Return the data type of the column at index . - - - - - Return the Npgsql specific data type of the column at requested ordinal. - - column position - Appropriate Npgsql type for column. - - - - Return the column name of the column at index . - - - - - Return the data type OID of the column at index . - - FIXME: Why this method returns String? - - - - Return the column name of the column named . - - - - - Return the data DbType of the column at index . - - - - - Return the data NpgsqlDbType of the column at index . - - - - - Get the value of a column as a . - If the differences between and - in handling of days and months is not important to your application, use - instead. - - Index of the field to find. - value of the field. - - - - Gets the value of a column converted to a Guid. - - - - - Gets the value of a column as Int16. - - - - - Gets the value of a column as Int32. - - - - - Gets the value of a column as Int64. - - - - - Gets the value of a column as Single. - - - - - Gets the value of a column as Double. - - - - - Gets the value of a column as String. - - - - - Gets the value of a column as Decimal. - - - - - Gets the value of a column as TimeSpan. - - - - - Copy values from each column in the current row into . - - The number of column values copied. - - - - Copy values from each column in the current row into . - - An array appropriately sized to store values from all columns. - The number of column values copied. - - - - Gets the value of a column as Boolean. - - - - - Gets the value of a column as Byte. Not implemented. - - - - - Gets the value of a column as Char. - - - - - Gets the value of a column as DateTime. - - - - - Returns a System.Data.DataTable that describes the column metadata of the DataReader. - - - - - This methods parses the command text and tries to get the tablename - from it. - - - - - Is raised whenever Close() is called. - - - - - Gets the number of columns in the current row. - - - - - Gets the value of a column in its native format. - - - - - Gets the value of a column in its native format. - - - - - Gets a value indicating the depth of nesting for the current row. Always returns zero. - - - - - Gets a value indicating whether the data reader is closed. - - - - - Contains the column names as the keys - - - - - Contains all unique columns - - - - - This is the primary implementation of NpgsqlDataReader. It is the one used in normal cases (where the - preload-reader option is not set in the connection string to resolve some potential backwards-compatibility - issues), the only implementation used internally, and in cases where CachingDataReader is used, it is still - used to do the actual "leg-work" of turning a response stream from the server into a datareader-style - object - with CachingDataReader then filling it's cache from here. - - - - - Iterate through the objects returned through from the server. - If it's a CompletedResponse the rowsaffected count is updated appropriately, - and we iterate again, otherwise we return it (perhaps updating our cache of pending - rows if appropriate). - - The next we will deal with. - - - - Advances the data reader to the next result, when multiple result sets were returned by the PostgreSQL backend. - - True if the reader was advanced, otherwise false. - - - - Releases the resources used by the NpgsqlCommand. - - - - - Closes the data reader object. - - - - - Advances the data reader to the next result, when multiple result sets were returned by the PostgreSQL backend. - - True if the reader was advanced, otherwise false. - - - - Advances the data reader to the next row. - - True if the reader was advanced, otherwise false. - - - - Return the value of the column at index . - - - - - Gets raw data from a column. - - - - - Gets raw data from a column. - - - - - Report whether the value in a column is DBNull. - - - - - Gets the number of rows changed, inserted, or deleted by execution of the SQL statement. - - - - - Indicates if NpgsqlDatareader has rows to be read. - - - - - Provides an implementation of NpgsqlDataReader in which all data is pre-loaded into memory. - This operates by first creating a ForwardsOnlyDataReader as usual, and then loading all of it's - Rows into memory. There is a general principle that when there is a trade-off between a class design that - is more efficient and/or scalable on the one hand and one that is less efficient but has more functionality - (in this case the internal-only functionality of caching results) that one can build the less efficent class - from the most efficient without significant extra loss in efficiency, but not the other way around. The relationship - between ForwardsOnlyDataReader and CachingDataReader is an example of this). - Since the interface presented to the user is still forwards-only, queues are used to - store this information, so that dequeueing as we go we give the garbage collector the best opportunity - possible to reclaim any memory that is no longer in use. - ForwardsOnlyDataReader being used to actually - obtain the information from the server means that the "leg-work" is still only done (and need only be - maintained) in one place. - This class exists to allow for certain potential backwards-compatibility issues to be resolved - with little effort on the part of affected users. It is considerably less efficient than ForwardsOnlyDataReader - and hence never used internally. - - - - - Represents the method that allows the application to provide a certificate collection to be used for SSL clien authentication - - A X509CertificateCollection to be filled with one or more client certificates. - - - - !!! Helper class, for compilation only. - Connector implements the logic for the Connection Objects to - access the physical connection to the database, and isolate - the application developer from connection pooling internals. - - - - - Constructor. - - Controls whether the connector can be shared. - - - - This method checks if the connector is still ok. - We try to send a simple query text, select 1 as ConnectionTest; - - - - - This method is responsible for releasing all resources associated with this Connector. - - - - - This method is responsible to release all portals used by this Connector. - - - - - Default SSL CertificateSelectionCallback implementation. - - - - - Default SSL CertificateValidationCallback implementation. - - - - - Default SSL PrivateKeySelectionCallback implementation. - - - - - Default SSL ProvideClientCertificatesCallback implementation. - - - - - This method is required to set all the version dependent features flags. - SupportsPrepare means the server can use prepared query plans (7.3+) - - - - - Opens the physical connection to the server. - - Usually called by the RequestConnector - Method of the connection pool manager. - - - - Closes the physical connection to the server. - - - - - Returns next portal index. - - - - - Returns next plan index. - - - - - Occurs on NoticeResponses from the PostgreSQL backend. - - - - - Occurs on NotificationResponses from the PostgreSQL backend. - - - - - Called to provide client certificates for SSL handshake. - - - - - Mono.Security.Protocol.Tls.CertificateSelectionCallback delegate. - - - - - Mono.Security.Protocol.Tls.CertificateValidationCallback delegate. - - - - - Mono.Security.Protocol.Tls.PrivateKeySelectionCallback delegate. - - - - - Gets the current state of the connection. - - - - - Return Connection String. - - - - - Version of backend server this connector is connected to. - - - - - Backend protocol version in use by this connector. - - - - - The physical connection stream to the backend. - - - - - The physical connection socket to the backend. - - - - - Reports if this connector is fully connected. - - - - - The connection mediator. - - - - - Report if the connection is in a transaction. - - - - - Report whether the current connection can support prepare functionality. - - - - - This class contains helper methods for type conversion between - the .Net type system and postgresql. - - - - - A cache of basic datatype mappings keyed by server version. This way we don't - have to load the basic type mappings for every connection. - - - - - Find a NpgsqlNativeTypeInfo in the default types map that can handle objects - of the given NpgsqlDbType. - - - - - Find a NpgsqlNativeTypeInfo in the default types map that can handle objects - of the given NpgsqlDbType. - - - - - Find a NpgsqlNativeTypeInfo in the default types map that can handle objects - of the given DbType. - - - - - Find a NpgsqlNativeTypeInfo in the default types map that can handle objects - of the given System.Type. - - - - - This method is responsible to convert the string received from the backend - to the corresponding NpgsqlType. - The given TypeInfo is called upon to do the conversion. - If no TypeInfo object is provided, no conversion is performed. - - - - - Create the one and only native to backend type map. - This map is used when formatting native data - types to backend representations. - - - - - This method creates (or retrieves from cache) a mapping between type and OID - of all natively supported postgresql data types. - This is needed as from one version to another, this mapping can be changed and - so we avoid hardcoding them. - - NpgsqlTypeMapping containing all known data types. The mapping must be - cloned before it is modified because it is cached; changes made by one connection may - effect another connection. - - - - Attempt to map types by issuing a query against pg_type. - This function takes a list of NpgsqlTypeInfo and attempts to resolve the OID field - of each by querying pg_type. If the mapping is found, the type info object is - updated (OID) and added to the provided NpgsqlTypeMapping object. - - NpgsqlConnector to send query through. - Mapping object to add types too. - List of types that need to have OID's mapped. - - - - Delegate called to convert the given backend data to its native representation. - - - - - Delegate called to convert the given native data to its backand representation. - - - - - Represents a backend data type. - This class can be called upon to convert a backend field representation to a native object. - - - - - Construct a new NpgsqlTypeInfo with the given attributes and conversion handlers. - - Type OID provided by the backend server. - Type name provided by the backend server. - NpgsqlDbType - System type to convert fields of this type to. - Data conversion handler. - - - - Perform a data conversion from a backend representation to - a native object. - - Data sent from the backend. - Type modifier field sent from the backend. - - - - Type OID provided by the backend server. - - - - - Type name provided by the backend server. - - - - - NpgsqlDbType. - - - - - NpgsqlDbType. - - - - - Provider type to convert fields of this type to. - - - - - System type to convert fields of this type to. - - - - - Represents a backend data type. - This class can be called upon to convert a native object to its backend field representation, - - - - - Returns an NpgsqlNativeTypeInfo for an array where the elements are of the type - described by the NpgsqlNativeTypeInfo supplied. - - - - - Construct a new NpgsqlTypeInfo with the given attributes and conversion handlers. - - Type name provided by the backend server. - NpgsqlDbType - Data conversion handler. - - - - Perform a data conversion from a native object to - a backend representation. - DBNull and null values are handled differently depending if a plain query is used - When - - Native .NET object to be converted. - Flag indicating if the conversion has to be done for - plain queries or extended queries - - - - Type name provided by the backend server. - - - - - NpgsqlDbType. - - - - - DbType. - - - - - Apply quoting. - - - - - Use parameter size information. - - - - - Provide mapping between type OID, type name, and a NpgsqlBackendTypeInfo object that represents it. - - - - - Construct an empty mapping. - - - - - Copy constuctor. - - - - - Add the given NpgsqlBackendTypeInfo to this mapping. - - - - - Add a new NpgsqlBackendTypeInfo with the given attributes and conversion handlers to this mapping. - - Type OID provided by the backend server. - Type name provided by the backend server. - NpgsqlDbType - System type to convert fields of this type to. - Data conversion handler. - - - - Make a shallow copy of this type mapping. - - - - - Determine if a NpgsqlBackendTypeInfo with the given backend type OID exists in this mapping. - - - - - Determine if a NpgsqlBackendTypeInfo with the given backend type name exists in this mapping. - - - - - Get the number of type infos held. - - - - - Retrieve the NpgsqlBackendTypeInfo with the given backend type OID, or null if none found. - - - - - Retrieve the NpgsqlBackendTypeInfo with the given backend type name, or null if none found. - - - - - Provide mapping between type Type, NpgsqlDbType and a NpgsqlNativeTypeInfo object that represents it. - - - - - Add the given NpgsqlNativeTypeInfo to this mapping. - - - - - Add a new NpgsqlNativeTypeInfo with the given attributes and conversion handlers to this mapping. - - Type name provided by the backend server. - NpgsqlDbType - Data conversion handler. - - - - Retrieve the NpgsqlNativeTypeInfo with the given NpgsqlDbType. - - - - - Retrieve the NpgsqlNativeTypeInfo with the given DbType. - - - - - Retrieve the NpgsqlNativeTypeInfo with the given Type. - - - - - Determine if a NpgsqlNativeTypeInfo with the given backend type name exists in this mapping. - - - - - Determine if a NpgsqlNativeTypeInfo with the given NpgsqlDbType exists in this mapping. - - - - - Determine if a NpgsqlNativeTypeInfo with the given Type name exists in this mapping. - - - - - Get the number of type infos held. - - - - - Implements for version 3 of the protocol. - - - - - Reads a row, field by field, allowing a DataRow to be built appropriately. - - - - - Reads part of a field, as needed (for - and - - - - - Adds further functionality to stream that is dependant upon the type of data read. - - - - - Completes the implementation of Streamer for char data. - - - - - Completes the implementation of Streamer for byte data. - - - - - Implements for version 2 of the protocol. - - - - - Encapsulates the null mapping bytes sent at the start of a version 2 - datarow message, and the process of identifying the nullity of the data - at a particular index - - - - - Provides the underlying mechanism for reading schema information. - - - - - Creates an NpgsqlSchema that can read schema information from the database. - - An open database connection for reading metadata. - - - - Returns the MetaDataCollections that lists all possible collections. - - The MetaDataCollections - - - - Returns the Restrictions that contains the meaning and position of the values in the restrictions array. - - The Restrictions - - - - Returns the Databases that contains a list of all accessable databases. - - The restrictions to filter the collection. - The Databases - - - - Returns the Tables that contains table and view names and the database and schema they come from. - - The restrictions to filter the collection. - The Tables - - - - Returns the Columns that contains information about columns in tables. - - The restrictions to filter the collection. - The Columns. - - - - Returns the Views that contains view names and the database and schema they come from. - - The restrictions to filter the collection. - The Views - - - - Returns the Users containing user names and the sysid of those users. - - The restrictions to filter the collection. - The Users. - - - - This is the abstract base class for NpgsqlAsciiRow and NpgsqlBinaryRow. - @@ -3166,7 +145,7 @@ Creats a bitstring from a string. The string to copy from. - + @@ -3322,7 +301,7 @@ The object to compare with. If the object is null then this string is considered greater. If the object is another BitString - then they are compared as in the explicit comparison for BitStrings + then they are compared as in the explicit comparison for BitStrings in any other case a is thrown. @@ -3534,6 +513,1605 @@ Retrieves the value of the bit at the given index.
+ + + Represents the PostgreSQL interval datatype. + PostgreSQL differs from .NET in how it's interval type doesn't assume 24 hours in a day + (to deal with 23- and 25-hour days caused by daylight savings adjustments) and has a concept + of months that doesn't exist in .NET's class. (Neither datatype + has any concessions for leap-seconds). + For most uses just casting to and from TimeSpan will work correctly — in particular, + the results of subtracting one or the PostgreSQL date, time and + timestamp types from another should be the same whether you do so in .NET or PostgreSQL — + but if the handling of days and months in PostgreSQL is important to your application then you + should use this class instead of . + If you don't know whether these differences are important to your application, they + probably arent! Just use and do not use this class directly ☺ + To avoid forcing unnecessary provider-specific concerns on users who need not be concerned + with them a call to on a field containing an + value will return a rather than an + . If you need the extra functionality of + then use . + + + + + + + + + + Represents the number of ticks (100ns periods) in one microsecond. This field is constant. + + + + + Represents the number of ticks (100ns periods) in one millisecond. This field is constant. + + + + + Represents the number of ticks (100ns periods) in one second. This field is constant. + + + + + Represents the number of ticks (100ns periods) in one minute. This field is constant. + + + + + Represents the number of ticks (100ns periods) in one hour. This field is constant. + + + + + Represents the number of ticks (100ns periods) in one day. This field is constant. + + + + + Represents the number of hours in one day (assuming no daylight savings adjustments). This field is constant. + + + + + Represents the number of days assumed in one month if month justification or unjustifcation is performed. + This is set to 30 for consistency with PostgreSQL. Note that this is means that month adjustments cause + a year to be taken as 30 × 12 = 360 rather than 356/366 days. + + + + + Represents the number of ticks (100ns periods) in one day, assuming 30 days per month. + + + + + Represents the number of months in a year. This field is constant. + + + + + Represents the maximum . This field is read-only. + + + + + Represents the minimum . This field is read-only. + + + + + Represents the zero . This field is read-only. + + + + + Initializes a new to the specified number of ticks. + + A time period expressed in 100ns units. + + + + Initializes a new to hold the same time as a + + A time period expressed in a + + + + Initializes a new to the specified number of months, days + & ticks. + + Number of months. + Number of days. + Number of 100ns units. + + + + Initializes a new to the specified number of + days, hours, minutes & seconds. + + Number of days. + Number of hours. + Number of minutes. + Number of seconds. + + + + Initializes a new to the specified number of + days, hours, minutes, seconds & milliseconds. + + Number of days. + Number of hours. + Number of minutes. + Number of seconds. + Number of milliseconds. + + + + Initializes a new to the specified number of + months, days, hours, minutes, seconds & milliseconds. + + Number of months. + Number of days. + Number of hours. + Number of minutes. + Number of seconds. + Number of milliseconds. + + + + Initializes a new to the specified number of + years, months, days, hours, minutes, seconds & milliseconds. + Years are calculated exactly equivalent to 12 months. + + Number of years. + Number of months. + Number of days. + Number of hours. + Number of minutes. + Number of seconds. + Number of milliseconds. + + + + Creates an from a number of ticks. + + The number of ticks (100ns units) in the interval. + A d with the given number of ticks. + + + + Creates an from a number of microseconds. + + The number of microseconds in the interval. + A d with the given number of microseconds. + + + + Creates an from a number of milliseconds. + + The number of milliseconds in the interval. + A d with the given number of milliseconds. + + + + Creates an from a number of seconds. + + The number of seconds in the interval. + A d with the given number of seconds. + + + + Creates an from a number of minutes. + + The number of minutes in the interval. + A d with the given number of minutes. + + + + Creates an from a number of hours. + + The number of hours in the interval. + A d with the given number of hours. + + + + Creates an from a number of days. + + The number of days in the interval. + A d with the given number of days. + + + + Creates an from a number of months. + + The number of months in the interval. + A d with the given number of months. + + + + Adds another interval to this instance and returns the result. + + An to add to this instance. + An whose values are the sums of the two instances. + + + + Subtracts another interval from this instance and returns the result. + + An to subtract from this instance. + An whose values are the differences of the two instances. + + + + Returns an whose value is the negated value of this instance. + + An whose value is the negated value of this instance. + + + + This absolute value of this instance. In the case of some, but not all, components being negative, + the rules used for justification are used to determine if the instance is positive or negative. + + An whose value is the absolute value of this instance. + + + + Equivalent to PostgreSQL's justify_days function. + + An based on this one, but with any hours outside of the range [-23, 23] + converted into days. + + + + Opposite to PostgreSQL's justify_days function. + + An based on this one, but with any days converted to multiples of ±24hours. + + + + Equivalent to PostgreSQL's justify_months function. + + An based on this one, but with any days outside of the range [-30, 30] + converted into months. + + + + Opposite to PostgreSQL's justify_months function. + + An based on this one, but with any months converted to multiples of ±30days. + + + + Equivalent to PostgreSQL's justify_interval function. + + An based on this one, + but with any months converted to multiples of ±30days + and then with any days converted to multiples of ±24hours + + + + Opposite to PostgreSQL's justify_interval function. + + An based on this one, but with any months converted to multiples of ±30days and then any days converted to multiples of ±24hours; + + + + Produces a canonical NpgslInterval with 0 months and hours in the range of [-23, 23]. + + + While the fact that for many purposes, two different instances could be considered + equivalent (e.g. one with 2days, 3hours and one with 1day 27hours) there are different possible canonical forms. + + E.g. we could move all excess hours into days and all excess days into months and have the most readable form, + or we could move everything into the ticks and have the form that allows for the easiest arithmetic) the form + chosen has two important properties that make it the best choice. + First, it is closest two how + objects are most often represented. Second, it is compatible with results of many + PostgreSQL functions, particularly with age() and the results of subtracting one date, time or timestamp from + another. + + Note that the results of casting a to is + canonicalised. + + + An based on this one, but with months converted to multiples of ±30days and with any hours outside of the range [-23, 23] + converted into days. + + + + Implicit cast of a to an + + A + An eqivalent, canonical, . + + + + Implicit cast of an to a . + + A . + An equivalent . + + + + Returns true if another is exactly the same as this instance. + + An for comparison. + true if the two instances are exactly the same, + false otherwise. + + + + Returns true if another object is an , that is exactly the same as + this instance + + An for comparison. + true if the argument is an and is exactly the same + as this one, false otherwise. + + + + Compares two instances. + + The first . + The second . + 0 if the two are equal or equivalent. A value greater than zero if x is greater than y, + a value less than zero if x is less than y. + + + + A hash code suitable for uses with hashing algorithms. + + An signed integer. + + + + Compares this instance with another/ + + An to compare this with. + 0 if the instances are equal or equivalent. A value less than zero if + this instance is less than the argument. A value greater than zero if this instance + is greater than the instance. + + + + Compares this instance with another/ + + An object to compare this with. + 0 if the argument is an and the instances are equal or equivalent. + A value less than zero if the argument is an and + this instance is less than the argument. + A value greater than zero if the argument is an and this instance + is greater than the instance. + A value greater than zero if the argument is null. + The argument is not an . + + + + Parses a and returns a instance. + Designed to use the formats generally returned by PostgreSQL. + + The to parse. + An represented by the argument. + The string was null. + A value obtained from parsing the string exceeded the values allowed for the relevant component. + The string was not in a format that could be parsed to produce an . + + + + Attempt to parse a to produce an . + + The to parse. + (out) The produced, or if the parsing failed. + true if the parsing succeeded, false otherwise. + + + + Create a representation of the instance. + The format returned is of the form: + [M mon[s]] [d day[s]] [HH:mm:ss[.f[f[f[f[f[f[f[f[f]]]]]]]]]] + A zero is represented as 00:00:00 + + Ticks are 100ns, Postgress resolution is only to 1µs at most. Hence we lose 1 or more decimal + precision in storing values in the database. Despite this, this method will output that extra + digit of precision. It's forward-compatible with any future increases in resolution up to 100ns, + and also makes this ToString() more applicable to any other use-case. + + + The representation. + + + + Adds two together. + + The first to add. + The second to add. + An whose values are the sum of the arguments. + + + + Subtracts one from another. + + The to subtract the other from. + The to subtract from the other. + An whose values are the difference of the arguments + + + + Returns true if two are exactly the same. + + The first to compare. + The second to compare. + true if the two arguments are exactly the same, false otherwise. + + + + Returns false if two are exactly the same. + + The first to compare. + The second to compare. + false if the two arguments are exactly the same, true otherwise. + + + + Compares two instances to see if the first is less than the second + + The first to compare. + The second to compare. + true if the first is less than second, false otherwise. + + + + Compares two instances to see if the first is less than or equivalent to the second + + The first to compare. + The second to compare. + true if the first is less than or equivalent to second, false otherwise. + + + + Compares two instances to see if the first is greater than the second + + The first to compare. + The second to compare. + true if the first is greater than second, false otherwise. + + + + Compares two instances to see if the first is greater than or equivalent the second + + The first to compare. + The second to compare. + true if the first is greater than or equivalent to the second, false otherwise. + + + + Returns the instance. + + An . + The argument. + + + + Negates an instance. + + An . + The negation of the argument. + + + + The total number of ticks(100ns units) contained. This is the resolution of the + type. This ignores the number of days and + months held. If you want them included use first. + The resolution of the PostgreSQL + interval type is by default 1µs = 1,000 ns. It may be smaller as follows: + + + interval(0) + resolution of 1s (1 second) + + + interval(1) + resolution of 100ms = 0.1s (100 milliseconds) + + + interval(2) + resolution of 10ms = 0.01s (10 milliseconds) + + + interval(3) + resolution of 1ms = 0.001s (1 millisecond) + + + interval(4) + resolution of 100µs = 0.0001s (100 microseconds) + + + interval(5) + resolution of 10µs = 0.00001s (10 microseconds) + + + interval(6) or interval + resolution of 1µs = 0.000001s (1 microsecond) + + + As such, if the 100-nanosecond resolution is significant to an application, a PostgreSQL interval will + not suffice for those purposes. + In more frequent cases though, the resolution of the interval suffices. + will always suffice to handle the resolution of any interval value, and upon + writing to the database, will be rounded to the resolution used. + + The number of ticks in the instance. + + + + + Gets the number of whole microseconds held in the instance. + An in the range [-999999, 999999]. + + + + + Gets the number of whole milliseconds held in the instance. + An in the range [-999, 999]. + + + + + Gets the number of whole seconds held in the instance. + An in the range [-59, 59]. + + + + + Gets the number of whole minutes held in the instance. + An in the range [-59, 59]. + + + + + Gets the number of whole hours held in the instance. + Note that this can be less than -23 or greater than 23 unless + has been used to produce this instance. + + + + + Gets the number of days held in the instance. + Note that this does not pay attention to a time component with -24 or less hours or + 24 or more hours, unless has been called to produce this instance. + + + + + Gets the number of months held in the instance. + Note that this does not pay attention to a day component with -30 or less days or + 30 or more days, unless has been called to produce this instance. + + + + + Returns a representing the time component of the instance. + Note that this may have a value beyond the range ±23:59:59.9999999 unless + has been called to produce this instance. + + + + + The total number of ticks (100ns units) in the instance, assuming 24 hours in each day and + 30 days in a month. + + + + + The total number of microseconds in the instance, assuming 24 hours in each day and + 30 days in a month. + + + + + The total number of milliseconds in the instance, assuming 24 hours in each day and + 30 days in a month. + + + + + The total number of seconds in the instance, assuming 24 hours in each day and + 30 days in a month. + + + + + The total number of minutes in the instance, assuming 24 hours in each day and + 30 days in a month. + + + + + The total number of hours in the instance, assuming 24 hours in each day and + 30 days in a month. + + + + + The total number of days in the instance, assuming 24 hours in each day and + 30 days in a month. + + + + + The total number of months in the instance, assuming 24 hours in each day and + 30 days in a month. + + + + + Normalise this time; if it is 24:00:00, convert it to 00:00:00 + + This time, normalised + + + + The total number of ticks(100ns units) contained. This is the resolution of the + type. + The resolution of the PostgreSQL + interval type is by default 1µs = 1,000 ns. It may be smaller as follows: + + + time(0) + resolution of 1s (1 second) + + + time(1) + resolution of 100ms = 0.1s (100 milliseconds) + + + time(2) + resolution of 10ms = 0.01s (10 milliseconds) + + + time(3) + resolution of 1ms = 0.001s (1 millisecond) + + + time(4) + resolution of 100µs = 0.0001s (100 microseconds) + + + time(5) + resolution of 10µs = 0.00001s (10 microseconds) + + + time(6) or interval + resolution of 1µs = 0.000001s (1 microsecond) + + + As such, if the 100-nanosecond resolution is significant to an application, a PostgreSQL time will + not suffice for those purposes. + In more frequent cases though, the resolution of time suffices. + will always suffice to handle the resolution of any time value, and upon + writing to the database, will be rounded to the resolution used. + + The number of ticks in the instance. + + + + + Gets the number of whole microseconds held in the instance. + An integer in the range [0, 999999]. + + + + + Gets the number of whole milliseconds held in the instance. + An integer in the range [0, 999]. + + + + + Gets the number of whole seconds held in the instance. + An interger in the range [0, 59]. + + + + + Gets the number of whole minutes held in the instance. + An integer in the range [0, 59]. + + + + + Gets the number of whole hours held in the instance. + Note that the time 24:00:00 can be stored for roundtrip compatibility. Any calculations on such a + value will normalised it to 00:00:00. + + + + + Normalise this time; if it is 24:00:00, convert it to 00:00:00 + + This time, normalised + + + + Compares this with another . As per postgres' rules, + first the times are compared as if they were both in the same timezone. If they are equal then + then timezones are compared (+01:00 being "smaller" than -01:00). + + the to compare with. + An integer which is 0 if they are equal, < 0 if this is the smaller and > 0 if this is the larger. + + + + Gets the number of whole microseconds held in the instance. + An integer in the range [0, 999999]. + + + + + Gets the number of whole milliseconds held in the instance. + An integer in the range [0, 999]. + + + + + Gets the number of whole seconds held in the instance. + An interger in the range [0, 59]. + + + + + Gets the number of whole minutes held in the instance. + An integer in the range [0, 59]. + + + + + Gets the number of whole hours held in the instance. + Note that the time 24:00:00 can be stored for roundtrip compatibility. Any calculations on such a + value will normalised it to 00:00:00. + + + + + Summary description for LargeObjectManager. + + + + + Options that control certain aspects of native to backend conversions that depend + on backend version and status. + + + + + Clone the current object. + + A new NativeToBackendTypeConverterOptions object. + + + + Clone the current object with a different OID/Name mapping. + + OID/Name mapping object to use in the new instance. + A new NativeToBackendTypeConverterOptions object. + + + + Provide event handlers to convert all native supported basic data types from their backend + text representation to a .NET object. + + + + + Convert UTF8 encoded text a string. + + + + + Byte array from bytea encoded as ASCII text, escaped or hex format. + + + + + Byte array from bytea encoded as binary. + + + + + Convert a postgresql boolean to a System.Boolean. + + + + + Convert a postgresql boolean to a System.Boolean. + + + + + Convert a postgresql bit to a System.Boolean. + + + + + Convert a postgresql datetime to a System.DateTime. + + + + + Convert a postgresql date to a System.DateTime. + + + + + Convert a postgresql time to a System.DateTime. + + + + + Convert a postgresql money to a System.Decimal. + + + + + Convert a postgresql float4 or float8 to a System.Float or System.Double respectively. + + + + + Provide event handlers to convert extended native supported data types from their backend + text representation to a .NET object. + + + + + Convert a postgresql point to a System.NpgsqlPoint. + + + + + Convert a postgresql point to a System.RectangleF. + + + + + LDeg. + + + + + Path. + + + + + Polygon. + + + + + Circle. + + + + + Inet. + + + + + MAC Address. + + + + + interval + + + + + Provide event handlers to convert the basic native supported data types from + native form to backend representation. + + + + + Convert a string to UTF8 encoded text, escaped and quoted as required. + + + + + Convert a string to UTF8 encoded text. + + + + + Binary data, escaped and quoted as required. + + + + + Binary data with possible older style octal escapes, quoted. + + + + + Binary data in the new hex format (>= 9.0), quoted. + + + + + Binary data, raw. + + + + + Convert to a postgresql boolean text format. + + + + + Convert to a postgresql boolean binary format. + + + + + Convert to a postgresql binary int2. + + + + + Convert to a postgresql binary int4. + + + + + Convert to a postgresql binary int8. + + + + + Convert to a postgresql bit. + + + + + Convert to a postgresql timestamp. + + + + + Convert to a postgresql date. + + + + + Convert to a postgresql time. + + + + + Convert to a postgres money. + + + + + Convert to a postgres double with maximum precision. + + + + + Convert a System.Float to a postgres float4. + + + + + Convert a System.Double to a postgres float8. + + + + + Provide event handlers to convert extended native supported data types from + native form to backend representation. + + + + + Point. + + + + + Box. + + + + + LSeg. + + + + + Open path. + + + + + Polygon. + + + + + Convert to a postgres MAC Address. + + + + + Circle. + + + + + Convert to a postgres inet. + + + + + Convert to a postgres interval + + + + + Delegate called to convert the given backend text data to its native representation. + + + + + Delegate called to convert the given backend binary data to its native representation. + + + + + Represents a backend data type. + This class can be called upon to convert a backend field representation to a native object. + + + + + Construct a new NpgsqlTypeInfo with the given attributes and conversion handlers. + + Type OID provided by the backend server. + Type name provided by the backend server. + NpgsqlDbType + DbType + System type to convert fields of this type to. + Data conversion handler for text encoding. + Data conversion handler for binary data. + + + + Perform a data conversion from a backend representation to + a native object. + + Data sent from the backend. + fieldValueSize + Type modifier field sent from the backend. + + + + Perform a data conversion from a backend representation to + a native object. + + Data sent from the backend. + TypeSize + Type modifier field sent from the backend. + + + + Type OID provided by the backend server. + + + + + Type name provided by the backend server. + + + + + NpgsqlDbType. + + + + + NpgsqlDbType. + + + + + Provider type to convert fields of this type to. + + + + + System type to convert fields of this type to. + + + + + Reports whether a backend binary to native decoder is available for this type. + + + + + Delegate called to convert the given native data to its backand representation. + + + + + Represents a backend data type. + This class can be called upon to convert a native object to its backend field representation, + + + + + Returns an NpgsqlNativeTypeInfo for an array where the elements are of the type + described by the NpgsqlNativeTypeInfo supplied. + + + + + Construct a new NpgsqlTypeInfo with the given attributes and conversion handlers. + + Type name provided by the backend server. + DbType + Quote + NpgsqlDbType + Data conversion handler for text backend encoding. + Data conversion handler for binary backend encoding (for extended queries). + + + + Perform a data conversion from a native object to + a backend representation. + DBNull and null values are handled differently depending if a plain query is used + When + + Native .NET object to be converted. + Specifies that the value should be formatted for the extended query syntax. + Options to guide serialization. If null, a default options set is used. + Specifies that the value should be formatted as an extended query array element. + + + + Type name provided by the backend server. + + + + + NpgsqlDbType. + + + + + DbType. + + + + + Apply quoting. + + + + + Use parameter size information. + + + + + Reports whether a native to backend binary encoder is available for this type. + + + + + Provide mapping between type OID, type name, and a NpgsqlBackendTypeInfo object that represents it. + + + + + Construct an empty mapping. + + + + + Copy constuctor. + + + + + Add the given NpgsqlBackendTypeInfo to this mapping. + + + + + Add a new NpgsqlBackendTypeInfo with the given attributes and conversion handlers to this mapping. + + Type OID provided by the backend server. + Type name provided by the backend server. + NpgsqlDbType + DbType + System type to convert fields of this type to. + Data conversion handler for text encoding. + Data conversion handler for binary data. + + + + Make a shallow copy of this type mapping. + + + + + Determine if a NpgsqlBackendTypeInfo with the given backend type OID exists in this mapping. + + + + + Determine if a NpgsqlBackendTypeInfo with the given backend type name exists in this mapping. + + + + + Get the number of type infos held. + + + + + Retrieve the NpgsqlBackendTypeInfo with the given backend type OID, or null if none found. + + + + + Retrieve the NpgsqlBackendTypeInfo with the given backend type name, or null if none found. + + + + + Provide mapping between type Type, NpgsqlDbType and a NpgsqlNativeTypeInfo object that represents it. + + + + + Add the given NpgsqlNativeTypeInfo to this mapping. + + + + + Add a new NpgsqlNativeTypeInfo with the given attributes and conversion handlers to this mapping. + + Type name provided by the backend server. + NpgsqlDbType + DbType + Quote + Data conversion handler for text backend encoding. + Data conversion handler for binary backend encoding (for extended query). + + + + Retrieve the NpgsqlNativeTypeInfo with the given NpgsqlDbType. + + + + + Retrieve the NpgsqlNativeTypeInfo with the given DbType. + + + + + Retrieve the NpgsqlNativeTypeInfo with the given Type. + + + + + Determine if a NpgsqlNativeTypeInfo with the given backend type name exists in this mapping. + + + + + Determine if a NpgsqlNativeTypeInfo with the given NpgsqlDbType exists in this mapping. + + + + + Determine if a NpgsqlNativeTypeInfo with the given Type name exists in this mapping. + + + + + Get the number of type infos held. + + + + + Represents a PostgreSQL Point type + + + + + Represents a PostgreSQL Line Segment type. + + + + + Represents a PostgreSQL Path type. + + + + + Represents a PostgreSQL Polygon type. + + + + + Represents a PostgreSQL Circle type. + + + + + Represents a PostgreSQL inet type. + + + + + Represents a PostgreSQL MacAddress type. + + + + + + + The macAddr parameter must contain a string that can only consist of numbers + and upper-case letters as hexadecimal digits. (See PhysicalAddress.Parse method on MSDN) + + + + This class contains helper methods for type conversion between + the .Net type system and postgresql. + + + + + A cache of basic datatype mappings keyed by server version. This way we don't + have to load the basic type mappings for every connection. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given NpgsqlDbType. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given NpgsqlDbType. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given DbType. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given System.Type. + + + + + This method is responsible to convert the byte[] received from the backend + to the corresponding NpgsqlType. + The given TypeInfo is called upon to do the conversion. + If no TypeInfo object is provided, no conversion is performed. + + + + + This method is responsible to convert the string received from the backend + to the corresponding NpgsqlType. + The given TypeInfo is called upon to do the conversion. + If no TypeInfo object is provided, no conversion is performed. + + + + + Create the one and only native to backend type map. + This map is used when formatting native data + types to backend representations. + + + + + This method creates (or retrieves from cache) a mapping between type and OID + of all natively supported postgresql data types. + This is needed as from one version to another, this mapping can be changed and + so we avoid hardcoding them. + + NpgsqlTypeMapping containing all known data types. The mapping must be + cloned before it is modified because it is cached; changes made by one connection may + effect another connection. + + + + + Attempt to map types by issuing a query against pg_type. + This function takes a list of NpgsqlTypeInfo and attempts to resolve the OID field + of each by querying pg_type. If the mapping is found, the type info object is + updated (OID) and added to the provided NpgsqlTypeMapping object. + + NpgsqlConnector to send query through. + Mapping object to add types too. + List of types that need to have OID's mapped. + + + + Set Cache Size. The default value is 20. + + + + + Lookup cached entity. null will returned if not match. + For both get{} and set{} apply LRU rule. + + key + + + + + The globally available text encoding used for frontend/backend communication. + + + + This class represents the base class for the state pattern design pattern + implementation. + + + This class represents the base class for the state pattern design pattern + implementation. + + + This class represents the base class for the state pattern design pattern + implementation. + + + + + + This method is used by the states to change the state of the context. + + + + + Call ProcessBackendResponsesEnum(), and scan and discard all results. + + + + + This method is responsible to handle all protocol messages sent from the backend. + It holds all the logic to do it. + To exchange data, it uses a Mediator object from which it reads/writes information + to handle backend requests. + + + + + + Checks for context socket availability. + Socket.Poll supports integer as microseconds parameter. + This limits the usable command timeout value + to 2,147 seconds: (2,147 x 1,000,000 less than max_int). + In order to bypass this limit, the availability of + the socket is checked in 2,147 seconds cycles + + true, if for context socket availability was checked, false otherwise. + Context. + Select mode. + + + + Called from constructor of derived class. + + + + + Finalizer for HashAlgorithm + + + + + Computes the entire hash of all the bytes in the byte array. + + + + + When overridden in a derived class, drives the hashing function. + + + + + + + + When overridden in a derived class, this pads and hashes whatever data might be left in the buffers and then returns the hash created. + + + + + When overridden in a derived class, initializes the object to prepare for hashing. + + + + + Used for stream chaining. Computes hash as data passes through it. + + The buffer from which to grab the data to be copied. + The offset into the input buffer to start reading at. + The number of bytes to be copied. + The buffer to write the copied data to. + At what point in the outputBuffer to write the data at. + + + + Used for stream chaining. Computes hash as data passes through it. Finishes off the hash. + + The buffer from which to grab the data to be copied. + The offset into the input buffer to start reading at. + The number of bytes to be copied. + + + + Get whether or not the hash can transform multiple blocks at a time. + Note: MUST be overriden if descendant can transform multiple block + on a single call! + + + + + Gets the previously computed hash. + + + + + Returns the size in bits of the hash. + + + + + Must be overriden if not 1 + + + + + Must be overriden if not 1 + + + + + Common base class for all derived MD5 implementations. + + + + + Called from constructor of derived class. + + + + + Creates the default derived class. + + C# implementation of the MD5 cryptographic hash function. @@ -3577,6 +2155,1570 @@ Position in buffer in bytes to get data from. How much data in bytes in the buffer to use. + + + Implements for version 3 of the protocol. + + + + + Reads a row, field by field, allowing a DataRow to be built appropriately. + + + + + Marker interface which identifies a class which may take possession of a stream for the duration of + it's lifetime (possibly temporarily giving that possession to another class for part of that time. + + It inherits from IDisposable, since any such class must make sure it leaves the stream in a valid state. + + The most important such class is that compiler-generated from ProcessBackendResponsesEnum. Of course + we can't make that inherit from this interface, alas. + + + + + Marker interface which identifies a class which represents part of + a response from the server. + + + + + Reads part of a field, as needed (for + and + + + + + Adds further functionality to stream that is dependant upon the type of data read. + + + + + Completes the implementation of Streamer for char data. + + + + + Completes the implementation of Streamer for byte data. + + + + + Implements for version 2 of the protocol. + + + + + Encapsulates the null mapping bytes sent at the start of a version 2 + datarow message, and the process of identifying the nullity of the data + at a particular index + + + + + This class represents a BackEndKeyData message received + from PostgreSQL + + + + + This class represents the Bind message sent to PostgreSQL + server. + + + + + + For classes representing messages sent from the client to the server. + + + + + This class represents the CancelRequest message sent to PostgreSQL + server. + + + + + + Represents a SQL statement or function (stored procedure) to execute + against a PostgreSQL database. This class cannot be inherited. + + + Represents a SQL statement or function (stored procedure) to execute + against a PostgreSQL database. This class cannot be inherited. + + + Represents a SQL statement or function (stored procedure) to execute + against a PostgreSQL database. This class cannot be inherited. + + + + + Initializes a new instance of the NpgsqlCommand class. + + + + + Initializes a new instance of the NpgsqlCommand class with the text of the query. + + The text of the query. + + + + Initializes a new instance of the NpgsqlCommand class with the text of the query and a NpgsqlConnection. + + The text of the query. + A NpgsqlConnection that represents the connection to a PostgreSQL server. + + + + Initializes a new instance of the NpgsqlCommand class with the text of the query, a NpgsqlConnection, and the NpgsqlTransaction. + + The text of the query. + A NpgsqlConnection that represents the connection to a PostgreSQL server. + The NpgsqlTransaction in which the NpgsqlCommand executes. + + + + Used to execute internal commands. + + + + + Attempts to cancel the execution of a NpgsqlCommand. + + This Method isn't implemented yet. + + + + Create a new command based on this one. + + A new NpgsqlCommand object. + + + + Create a new command based on this one. + + A new NpgsqlCommand object. + + + + Creates a new instance of an DbParameter object. + + An DbParameter object. + + + + Creates a new instance of a NpgsqlParameter object. + + A NpgsqlParameter object. + + + + Slightly optimised version of ExecuteNonQuery() for internal use in cases where the number + of affected rows is of no interest. + This function must not be called with a query that returns result rows, after calling Prepare(), or. + with a query that requires parameter substitution of any kind. + + + + + Executes a SQL statement against the connection and returns the number of rows affected. + + The number of rows affected if known; -1 otherwise. + + + + Sends the CommandText to + the Connection and builds a + NpgsqlDataReader + using one of the CommandBehavior values. + + One of the CommandBehavior values. + A NpgsqlDataReader object. + + + + Sends the CommandText to + the Connection and builds a + NpgsqlDataReader. + + A NpgsqlDataReader object. + + + + Sends the CommandText to + the Connection and builds a + NpgsqlDataReader + using one of the CommandBehavior values. + + One of the CommandBehavior values. + A NpgsqlDataReader object. + Currently the CommandBehavior parameter is ignored. + + + + This method binds the parameters from parameters collection to the bind + message. + + + + + Executes the query, and returns the first column of the first row + in the result set returned by the query. Extra columns or rows are ignored. + + The first column of the first row in the result set, + or a null reference if the result set is empty. + + + + Creates a prepared version of the command on a PostgreSQL server. + + + + + This method checks the connection state to see if the connection + is set or it is open. If one of this conditions is not met, throws + an InvalidOperationException + + + + + This method substitutes the Parameters, if exist, in the command + to their actual values. + The parameter name format is :ParameterName. + + A version of CommandText with the Parameters inserted. + + + + Process this.commandText, trimming each distinct command and substituting paramater + tokens. + + + + UTF8 encoded command ready to be sent to the backend. + + + + Find the beginning and end of each distinct SQL command and produce + a list of descriptors, one for each command. Commands described are trimmed of + leading and trailing white space and their terminating semi-colons. + + Raw command text. + List of chunk descriptors. + + + + Append a region of a source command text to an output command, performing parameter token + substitutions. + + Stream to which to append output. + Command text. + Starting index within src. + Length of region to be processed. + + + + + + Gets or sets the SQL statement or function (stored procedure) to execute at the data source. + + The Transact-SQL statement or stored procedure to execute. The default is an empty string. + + + + Gets or sets the wait time before terminating the attempt + to execute a command and generating an error. + + The time (in seconds) to wait for the command to execute. + The default is 20 seconds. + + + + Gets or sets a value indicating how the + CommandText property is to be interpreted. + + One of the CommandType values. The default is CommandType.Text. + + + + Gets or sets the NpgsqlConnection + used by this instance of the NpgsqlCommand. + + The connection to a data source. The default value is a null reference. + + + + Gets the NpgsqlParameterCollection. + + The parameters of the SQL statement or function (stored procedure). The default is an empty collection. + + + + Gets or sets the NpgsqlTransaction + within which the NpgsqlCommand executes. + + The NpgsqlTransaction. + The default value is a null reference. + + + + Gets or sets how command results are applied to the DataRow + when used by the Update + method of the DbDataAdapter. + + One of the UpdateRowSource values. + + + + Returns oid of inserted row. This is only updated when using executenonQuery and when command inserts just a single row. If table is created without oids, this will always be 0. + + + + + This class is responsible to create database commands for automatic insert, update and delete operations. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The adapter. + + + + + This method is reponsible to derive the command parameter list with values obtained from function definition. + It clears the Parameters collection of command. Also, if there is any parameter type which is not supported by Npgsql, an InvalidOperationException will be thrown. + Parameters name will be parameter1, parameter2, ... + + NpgsqlCommand whose function parameters will be obtained. + + + + Gets the automatically generated object required + to perform insertions at the data source. + + + The automatically generated object required to perform insertions. + + + + + Gets the automatically generated object required to perform insertions + at the data source, optionally using columns for parameter names. + + + If true, generate parameter names matching column names, if possible. + If false, generate @p1, @p2, and so on. + + + The automatically generated object required to perform insertions. + + + + + Gets the automatically generated System.Data.Common.DbCommand object required + to perform updates at the data source. + + + The automatically generated System.Data.Common.DbCommand object required to perform updates. + + + + + Gets the automatically generated object required to perform updates + at the data source, optionally using columns for parameter names. + + + If true, generate parameter names matching column names, if possible. + If false, generate @p1, @p2, and so on. + + + The automatically generated object required to perform updates. + + + + + Gets the automatically generated System.Data.Common.DbCommand object required + to perform deletions at the data source. + + + The automatically generated System.Data.Common.DbCommand object required to perform deletions. + + + + + Gets the automatically generated object required to perform deletions + at the data source, optionally using columns for parameter names. + + + If true, generate parameter names matching column names, if possible. + If false, generate @p1, @p2, and so on. + + + The automatically generated object required to perform deletions. + + + + + Applies the parameter information. + + The parameter. + The row. + Type of the statement. + if set to true [where clause]. + + + + Returns the name of the specified parameter in the format of @p#. + + The number to be included as part of the parameter's name.. + + The name of the parameter with the specified number appended as part of the parameter name. + + + + + Returns the full parameter name, given the partial parameter name. + + The partial name of the parameter. + + The full parameter name corresponding to the partial parameter name requested. + + + + + Returns the placeholder for the parameter in the associated SQL statement. + + The number to be included as part of the parameter's name. + + The name of the parameter with the specified number appended. + + + + + Registers the to handle the event for a . + + The to be used for the update. + + + + Adds an event handler for the event. + + The sender + A instance containing information about the event. + + + + Given an unquoted identifier in the correct catalog case, returns the correct quoted form of that identifier, including properly escaping any embedded quotes in the identifier. + + The original unquoted identifier. + + The quoted version of the identifier. Embedded quotes within the identifier are properly escaped. + + + + + Unquoted identifier parameter cannot be null + + + + Given a quoted identifier, returns the correct unquoted form of that identifier, including properly un-escaping any embedded quotes in the identifier. + + The identifier that will have its embedded quotes removed. + + The unquoted identifier, with embedded quotes properly un-escaped. + + + + + Quoted identifier parameter cannot be null + + + + Gets or sets the beginning character or characters to use when specifying database objects (for example, tables or columns) whose names contain characters such as spaces or reserved tokens. + + + The beginning character or characters to use. The default is an empty string. + + + + + + + + Gets or sets the ending character or characters to use when specifying database objects (for example, tables or columns) whose names contain characters such as spaces or reserved tokens. + + + The ending character or characters to use. The default is an empty string. + + + + + + + + Represents the method that handles the Notice events. + + The source of the event. + A NpgsqlNoticeEventArgs that contains the event data. + + + + Represents the method that handles the Notification events. + + The source of the event. + A NpgsqlNotificationEventArgs that contains the event data. + + + + This class represents a connection to a + PostgreSQL server. + + + + + Initializes a new instance of the + NpgsqlConnection class. + + + + + Initializes a new instance of the + NpgsqlConnection class + and sets the ConnectionString. + + The connection used to open the PostgreSQL database. + + + + Initializes a new instance of the + NpgsqlConnection class + and sets the ConnectionString. + + The connection used to open the PostgreSQL database. + + + + Begins a database transaction with the specified isolation level. + + The isolation level under which the transaction should run. + An DbTransaction + object representing the new transaction. + + Currently the IsolationLevel ReadCommitted and Serializable are supported by the PostgreSQL backend. + There's no support for nested transactions. + + + + + Begins a database transaction. + + A NpgsqlTransaction + object representing the new transaction. + + Currently there's no support for nested transactions. + + + + + Begins a database transaction with the specified isolation level. + + The isolation level under which the transaction should run. + A NpgsqlTransaction + object representing the new transaction. + + Currently the IsolationLevel ReadCommitted and Serializable are supported by the PostgreSQL backend. + There's no support for nested transactions. + + + + + Opens a database connection with the property settings specified by the + ConnectionString. + + + + + This method changes the current database by disconnecting from the actual + database and connecting to the specified. + + The name of the database to use in place of the current database. + + + + Releases the connection to the database. If the connection is pooled, it will be + made available for re-use. If it is non-pooled, the actual connection will be shutdown. + + + + + When a connection is closed within an enclosing TransactionScope and the transaction + hasn't been promoted, we defer the actual closing until the scope ends. + + + + + Creates and returns a DbCommand + object associated with the IDbConnection. + + A DbCommand object. + + + + Creates and returns a NpgsqlCommand + object associated with the NpgsqlConnection. + + A NpgsqlCommand object. + + + + Releases all resources used by the + NpgsqlConnection. + + true when called from Dispose(); + false when being called from the finalizer. + + + + Create a new connection based on this one. + + A new NpgsqlConnection object. + + + + Create a new connection based on this one. + + A new NpgsqlConnection object. + + + + Returns a copy of the NpgsqlConnectionStringBuilder that contains the parsed connection string values. + + + + + Default SSL CertificateSelectionCallback implementation. + + + + + Default SSL CertificateValidationCallback implementation. + + + + + Default SSL PrivateKeySelectionCallback implementation. + + + + + Default SSL ProvideClientCertificatesCallback implementation. + + + + + Default SSL ValidateRemoteCertificateCallback implementation. + + + + + Write each key/value pair in the connection string to the log. + + + + + Sets the `settings` ConnectionStringBuilder based on the given `connectionString` + + The connection string to load the builder from + + + + Sets the `settings` ConnectionStringBuilder based on the given `connectionString` + + The connection string to load the builder from + + + + Refresh the cached _connectionString whenever the builder settings change + + + + + Returns the supported collections + + + + + Returns the schema collection specified by the collection name. + + The collection name. + The collection specified. + + + + Returns the schema collection specified by the collection name filtered by the restrictions. + + The collection name. + + The restriction values to filter the results. A description of the restrictions is contained + in the Restrictions collection. + + The collection specified. + + + + Occurs on NoticeResponses from the PostgreSQL backend. + + + + + Occurs on NotificationResponses from the PostgreSQL backend. + + + + + Called to provide client certificates for SSL handshake. + + + + + Mono.Security.Protocol.Tls.CertificateSelectionCallback delegate. + + + + + Mono.Security.Protocol.Tls.CertificateValidationCallback delegate. + + + + + Mono.Security.Protocol.Tls.PrivateKeySelectionCallback delegate. + + + + + Called to validate server's certificate during SSL handshake + + + + + Gets or sets the string used to connect to a PostgreSQL database. + Valid values are: +
    +
  • + Server: Address/Name of Postgresql Server; +
  • +
  • + Port: Port to connect to; +
  • +
  • + Protocol: Protocol version to use, instead of automatic; Integer 2 or 3; +
  • +
  • + Database: Database name. Defaults to user name if not specified; +
  • +
  • + User Id: User name; +
  • +
  • + Password: Password for clear text authentication; +
  • +
  • + SSL: True or False. Controls whether to attempt a secure connection. Default = False; +
  • +
  • + Pooling: True or False. Controls whether connection pooling is used. Default = True; +
  • +
  • + MinPoolSize: Min size of connection pool; +
  • +
  • + MaxPoolSize: Max size of connection pool; +
  • +
  • + Timeout: Time to wait for connection open in seconds. Default is 15. +
  • +
  • + CommandTimeout: Time to wait for command to finish execution before throw an exception. In seconds. Default is 20. +
  • +
  • + Sslmode: Mode for ssl connection control. Can be Prefer, Require, Allow or Disable. Default is Disable. Check user manual for explanation of values. +
  • +
  • + ConnectionLifeTime: Time to wait before closing unused connections in the pool in seconds. Default is 15. +
  • +
  • + SyncNotification: Specifies if Npgsql should use synchronous notifications. +
  • +
  • + SearchPath: Changes search path to specified and public schemas. +
  • +
+
+ The connection string that includes the server name, + the database name, and other parameters needed to establish + the initial connection. The default value is an empty string. + +
+ + + Backend server host name. + + + + + Backend server port. + + + + + If true, the connection will attempt to use SSL. + + + + + Gets the time to wait while trying to establish a connection + before terminating the attempt and generating an error. + + The time (in seconds) to wait for a connection to open. The default value is 15 seconds. + + + + Gets the time to wait while trying to execute a command + before terminating the attempt and generating an error. + + The time (in seconds) to wait for a command to complete. The default value is 20 seconds. + + + + Gets the time to wait before closing unused connections in the pool if the count + of all connections exeeds MinPoolSize. + + + If connection pool contains unused connections for ConnectionLifeTime seconds, + the half of them will be closed. If there will be unused connections in a second + later then again the half of them will be closed and so on. + This strategy provide smooth change of connection count in the pool. + + The time (in seconds) to wait. The default value is 15 seconds. + + + + Gets the name of the current database or the database to be used after a connection is opened. + + The name of the current database or the name of the database to be + used after a connection is opened. The default value is the empty string. + + + + Whether datareaders are loaded in their entirety (for compatibility with earlier code). + + + + + Gets the database server name. + + + + + Gets flag indicating if we are using Synchronous notification or not. + The default value is false. + + + + + Gets the current state of the connection. + + A bitwise combination of the ConnectionState values. The default is Closed. + + + + Gets whether the current state of the connection is Open or Closed + + ConnectionState.Open or ConnectionState.Closed + + + + Version of the PostgreSQL backend. + This can only be called when there is an active connection. + + + + + Protocol version in use. + This can only be called when there is an active connection. + + + + + Process id of backend server. + This can only be called when there is an active connection. + + + + + Report whether the backend is expecting standard conformant strings. + In version 8.1, Postgres began reporting this value (false), but did not actually support standard conformant strings. + In version 8.2, Postgres began supporting standard conformant strings, but defaulted this flag to false. + As of version 9.1, this flag defaults to true. + + + + + Report whether the backend understands the string literal E prefix (>= 8.1). + + + + + Report whether the backend understands the hex byte format (>= 9.0). + + + + + The connector object connected to the backend. + + + + + Gets the NpgsqlConnectionStringBuilder containing the parsed connection string values. + + + + + User name. + + + + + Password. + + + + + Determine if connection pooling will be used for this connection. + + + + + Return an exact copy of this NpgsqlConnectionString. + + + + + No integrated security if we're on mono and .NET 4.5 because of ClaimsIdentity, + see https://github.com/npgsql/Npgsql/issues/133 + + + + + This function will set value for known key, both private member and base[key]. + + + + + value, coerced as needed to the stored type. + + + + The function will modify private member only, not base[key]. + + + + value, coerced as needed to the stored type. + + + + The function will access private member only, not base[key]. + + + value. + + + + Clear the member and assign them to the default value. + + + + + Gets or sets the backend server host name. + + + + + Gets or sets the backend server port. + + + + + Gets or sets the specified backend communication protocol version. + + + + + Gets or sets the name of the database to be used after a connection is opened. + + The name of the database to be + used after a connection is opened. + + + + Gets or sets the login user name. + + + + + This is a pretty horrible hack to fix https://github.com/npgsql/Npgsql/issues/133 + In a nutshell, starting with .NET 4.5 WindowsIdentity inherits from ClaimsIdentity + which doesn't exist in mono, and calling UserName getter above bombs. + The workaround is that the function that actually deals with WindowsIdentity never + gets called on mono, so never gets JITted and the problem goes away. + + + + + Gets or sets the login password as a UTF8 encoded byte array. + + + + + Sets the login password as a string. + + + + + Gets or sets a value indicating whether to attempt to use SSL. + + + + + Gets or sets a value indicating whether to attempt to use SSL. + + + + + Gets the backend encoding. Always returns "UTF8". + + + + + Gets or sets the time to wait while trying to establish a connection + before terminating the attempt and generating an error. + + The time (in seconds) to wait for a connection to open. The default value is 15 seconds. + + + + Gets or sets the schema search path. + + + + + Gets or sets a value indicating whether connection pooling should be used. + + + + + Gets or sets the time to wait before closing unused connections in the pool if the count + of all connections exeeds MinPoolSize. + + + If connection pool contains unused connections for ConnectionLifeTime seconds, + the half of them will be closed. If there will be unused connections in a second + later then again the half of them will be closed and so on. + This strategy provide smooth change of connection count in the pool. + + The time (in seconds) to wait. The default value is 15 seconds. + + + + Gets or sets the minimum connection pool size. + + + + + Gets or sets the maximum connection pool size. + + + + + Gets or sets a value indicating whether to listen for notifications and report them between command activity. + + + + + Gets the time to wait while trying to execute a command + before terminating the attempt and generating an error. + + The time (in seconds) to wait for a command to complete. The default value is 20 seconds. + + + + Gets or sets a value indicating whether datareaders are loaded in their entirety (for compatibility with earlier code). + + + + + Compatibilty version. When possible, behaviour caused by breaking changes will be preserved + if this version is less than that where the breaking change was introduced. + + + + + Gets or sets the ootional application name parameter to be sent to the backend during connection initiation. + + + + + Gets or sets a value indicating whether to silently Prepare() all commands before execution. + + + + + Case insensative accessor for indivual connection string values. + + + + + Set both ImplicitDefault and ExplicitDefault to the 's default value. + + + + + + + + Set ImplicitDefault to the default value of 's type, + and ExplicitDefault to . + + + + + + + + Represents the method that allows the application to provide a certificate collection to be used for SSL clien authentication + + A X509CertificateCollection to be filled with one or more client certificates. + + + + Represents the method that is called to validate the certificate provided by the server during an SSL handshake + + The server's certificate + The certificate chain containing the certificate's CA and any intermediate authorities + Any errors that were detected + + + + !!! Helper class, for compilation only. + Connector implements the logic for the Connection Objects to + access the physical connection to the database, and isolate + the application developer from connection pooling internals. + + + + + Constructor. + + Connection string. + Pooled + Controls whether the connector can be shared. + + + + This method checks if the connector is still ok. + We try to send a simple query text, select 1 as ConnectionTest; + + + + + This method is responsible for releasing all resources associated with this Connector. + + + + + This method is responsible to release all portals used by this Connector. + + + + + Default SSL CertificateSelectionCallback implementation. + + + + + Default SSL CertificateValidationCallback implementation. + + + + + Default SSL PrivateKeySelectionCallback implementation. + + + + + Default SSL ProvideClientCertificatesCallback implementation. + + + + + Default SSL ValidateRemoteCertificateCallback implementation. + + + + + This method is required to set all the version dependent features flags. + SupportsPrepare means the server can use prepared query plans (7.3+) + + + + + Opens the physical connection to the server. + + Usually called by the RequestConnector + Method of the connection pool manager. + + + + Closes the physical connection to the server. + + + + + Returns next portal index. + + + + + Returns next plan index. + + + + + Occurs on NoticeResponses from the PostgreSQL backend. + + + + + Occurs on NotificationResponses from the PostgreSQL backend. + + + + + Called to provide client certificates for SSL handshake. + + + + + Mono.Security.Protocol.Tls.CertificateSelectionCallback delegate. + + + + + Mono.Security.Protocol.Tls.CertificateValidationCallback delegate. + + + + + Mono.Security.Protocol.Tls.PrivateKeySelectionCallback delegate. + + + + + Called to validate server's certificate during SSL handshake + + + + + Gets the current state of the connection. + + + + + Return Connection String. + + + + + Version of backend server this connector is connected to. + + + + + Backend protocol version in use by this connector. + + + + + The physical connection socket to the backend. + + + + + The physical connection stream to the backend. + + + + + The top level stream to the backend. + + + + + Reports if this connector is fully connected. + + + + + The connection mediator. + + + + + Report if the connection is in a transaction. + + + + + Report whether the current connection can support prepare functionality. + + + + + Options that control certain aspects of native to backend conversions that depend + on backend version and status. + + + + + This class manages all connector objects, pooled AND non-pooled. + + + + Unique static instance of the connector pool + mamager. + + + Map of index to unused pooled connectors, avaliable to the + next RequestConnector() call. + This hashmap will be indexed by connection string. + This key will hold a list of queues of pooled connectors available to be used. + + + Timer for tracking unused connections in pools. + + + + Searches the shared and pooled connector lists for a + matching connector object or creates a new one. + + The NpgsqlConnection that is requesting + the connector. Its ConnectionString will be used to search the + pool for available connectors. + A connector object. + + + + Find a pooled connector. Handle shared/non-shared here. + + + + + Releases a connector, possibly back to the pool for future use. + + + Pooled connectors will be put back into the pool if there is room. + Shared connectors should just have their use count decremented + since they always stay in the shared pool. + + Connection to which the connector is leased. + The connector to release. + + + + Release a pooled connector. Handle shared/non-shared here. + + + + + Find an available pooled connector in the non-shared pool, or create + a new one if none found. + + + + + Put a pooled connector into the pool queue. + + Connection is leased to. + Connector to pool + + + + A queue with an extra Int32 for keeping track of busy connections. + + + + + Connections available to the end user + + + + + Connections currently in use + + + + + Represents information about COPY operation data transfer format as returned by server. + + + + + Only created when a CopyInResponse or CopyOutResponse is received by NpgsqlState.ProcessBackendResponses() + + + + + Returns true if this operation is currently active and field at given location is in binary format. + + + + + Returns true if this operation is currently active and in binary format. + + + + + Returns number of fields if this operation is currently active, otherwise -1 + + + + + Represents a PostgreSQL COPY FROM STDIN operation with a corresponding SQL statement + to execute against a PostgreSQL database + and an associated stream used to read data from (if provided by user) + or for writing it (when generated by driver). + Eg. new NpgsqlCopyIn("COPY mytable FROM STDIN", connection, streamToRead).Start(); + + + + + Creates NpgsqlCommand to run given query upon Start(). Data for the requested COPY IN operation can then be written to CopyData stream followed by a call to End() or Cancel(). + + + + + Given command is run upon Start(). Data for the requested COPY IN operation can then be written to CopyData stream followed by a call to End() or Cancel(). + + + + + Given command is executed upon Start() and all data from fromStream is passed to it as copy data. + + + + + Returns true if this operation is currently active and field at given location is in binary format. + + + + + Command specified upon creation is executed as a non-query. + If CopyStream is set upon creation, it will be flushed to server as copy data, and operation will be finished immediately. + Otherwise the CopyStream member can be used for writing copy data to server and operation finished with a call to End() or Cancel(). + + + + + Called after writing all data to CopyStream to successfully complete this copy operation. + + + + + Withdraws an already started copy operation. The operation will fail with given error message. + Will do nothing if current operation is not active. + + + + + Returns true if the connection is currently reserved for this operation. + + + + + The stream provided by user or generated upon Start(). + User may provide a stream to constructor; it is used to pass to server all data read from it. + Otherwise, call to Start() sets this to a writable NpgsqlCopyInStream that passes all data written to it to server. + In latter case this is only available while the copy operation is active and null otherwise. + + + + + Returns true if this operation is currently active and in binary format. + + + + + Returns number of fields expected on each input row if this operation is currently active, otherwise -1 + + + + + The Command used to execute this copy operation. + + + + + Set before a COPY IN query to define size of internal buffer for reading from given CopyStream. + + + + + Represents an ongoing COPY FROM STDIN operation. + Provides methods to push data to server and end or cancel the operation. + + + + + Called from NpgsqlState.ProcessBackendResponses upon CopyInResponse. + If CopyStream is already set, it is used to read data to push to server, after which the copy is completed. + Otherwise CopyStream is set to a writable NpgsqlCopyInStream that calls SendCopyData each time it is written to. + + + + + Sends given packet to server as a CopyData message. + Does not check for notifications! Use another thread for that. + + + + + Sends CopyDone message to server. Handles responses, ie. may throw an exception. + + + + + Sends CopyFail message to server. Handles responses, ie. should always throw an exception: + in CopyIn state the server responds to CopyFail with an error response; + outside of a CopyIn state the server responds to CopyFail with an error response; + without network connection or whatever, there's going to eventually be a failure, timeout or user intervention. + + + + + Copy format information returned from server. + + Stream for writing data to a table on a PostgreSQL version 7.4 or newer database during an active COPY FROM STDIN operation. @@ -3657,203 +3799,1233 @@ Number of bytes written so far; not settable - + - Represents a SQL statement or function (stored procedure) to execute - against a PostgreSQL database. This class cannot be inherited. + Represents a PostgreSQL COPY TO STDOUT operation with a corresponding SQL statement + to execute against a PostgreSQL database + and an associated stream used to write results to (if provided by user) + or for reading the results (when generated by driver). + Eg. new NpgsqlCopyOut("COPY (SELECT * FROM mytable) TO STDOUT", connection, streamToWrite).Start(); - + - Initializes a new instance of the NpgsqlCommand class. + Creates NpgsqlCommand to run given query upon Start(), after which CopyStream provides data from database as requested in the query. - + - Initializes a new instance of the NpgsqlCommand class with the text of the query. - - The text of the query. - - - - Initializes a new instance of the NpgsqlCommand class with the text of the query and a NpgsqlConnection. - - The text of the query. - A NpgsqlConnection that represents the connection to a PostgreSQL server. - - - - Initializes a new instance of the NpgsqlCommand class with the text of the query, a NpgsqlConnection, and the NpgsqlTransaction. - - The text of the query. - A NpgsqlConnection that represents the connection to a PostgreSQL server. - The NpgsqlTransaction in which the NpgsqlCommand executes. - - - - Used to execute internal commands. + Given command is run upon Start(), after which CopyStream provides data from database as requested in the query. - + - Attempts to cancel the execution of a NpgsqlCommand. - - This Method isn't implemented yet. - - - - Create a new command based on this one. - - A new NpgsqlCommand object. - - - - Create a new command based on this one. - - A new NpgsqlCommand object. - - - - Creates a new instance of an DbParameter object. - - An DbParameter object. - - - - Creates a new instance of a NpgsqlParameter object. - - A NpgsqlParameter object. - - - - Slightly optimised version of ExecuteNonQuery() for internal ues in cases where the number - of affected rows is of no interest. + Given command is executed upon Start() and all requested copy data is written to toStream immediately. - + - Executes a SQL statement against the connection and returns the number of rows affected. + Returns true if this operation is currently active and field at given location is in binary format. - The number of rows affected if known; -1 otherwise. - + - Sends the CommandText to - the Connection and builds a - NpgsqlDataReader - using one of the CommandBehavior values. + Command specified upon creation is executed as a non-query. + If CopyStream is set upon creation, all copy data from server will be written to it, and operation will be finished immediately. + Otherwise the CopyStream member can be used for reading copy data from server until no more data is available. - One of the CommandBehavior values. - A NpgsqlDataReader object. - + - Sends the CommandText to - the Connection and builds a - NpgsqlDataReader. + Flush generated CopyStream at once. Effectively reads and discard all the rest of copy data from server. - A NpgsqlDataReader object. - + - Sends the CommandText to - the Connection and builds a - NpgsqlDataReader - using one of the CommandBehavior values. + Returns true if the connection is currently reserved for this operation. - One of the CommandBehavior values. - A NpgsqlDataReader object. - Currently the CommandBehavior parameter is ignored. - + - This method binds the parameters from parameters collection to the bind - message. + The stream provided by user or generated upon Start() + + + + + The Command used to execute this copy operation. + + + + + Returns true if this operation is currently active and in binary format. + + + + + Returns number of fields if this operation is currently active, otherwise -1 + + + + + Faster alternative to using the generated CopyStream. + + + + + Represents an ongoing COPY TO STDOUT operation. + Provides methods to read data from server or end the operation. + + + + + Called from NpgsqlState.ProcessBackendResponses upon CopyOutResponse. + If CopyStream is already set, it is used to write data received from server, after which the copy ends. + Otherwise CopyStream is set to a readable NpgsqlCopyOutStream that receives data from server. + + + + + Called from NpgsqlOutStream.Read to read copy data from server. + + + + + Copy format information returned from server. + + + + + Stream for reading data from a table or select on a PostgreSQL version 7.4 or newer database during an active COPY TO STDOUT operation. + Passes data exactly as provided by the server. + + + + + Created only by NpgsqlCopyOutState.StartCopy() + + + + + Discards copy data as long as server pushes it. Returns after operation is finished. + Does nothing if this stream is not the active copy operation reader. + + + + + Not writable. + + + + + Not flushable. + + + + + Copies data read from server to given byte buffer. + Since server returns data row by row, length will differ each time, but it is only zero once the operation ends. + Can be mixed with calls to the more efficient NpgsqlCopyOutStream.Read() : byte[] though that would not make much sense. + + + + + Not seekable + + + + + Not supported + + + + + Returns a whole row of data from server without extra work. + If standard Stream.Read(...) has been called before, it's internal buffers remains are returned. + + + + + True while this stream can be used to read copy data from server + + + + + True + + + + + False + + + + + False + + + + + Number of bytes read so far + + + + + Number of bytes read so far; can not be set. + + + + + Writes given objects into a stream for PostgreSQL COPY in default copy format (not CSV or BINARY). + + + + + Represents the method that handles the RowUpdated events. + + The source of the event. + A NpgsqlRowUpdatedEventArgs that contains the event data. + + + + Represents the method that handles the RowUpdating events. + + The source of the event. + A NpgsqlRowUpdatingEventArgs that contains the event data. + + + + This class represents an adapter from many commands: select, update, insert and delete to fill Datasets. + + + + + Provides a means of reading a forward-only stream of rows from a PostgreSQL backend. This class cannot be inherited. + + + + + Return the data type name of the column at index . + + + + + Return the data type of the column at index . + + + + + Return the Npgsql specific data type of the column at requested ordinal. + + column position + Appropriate Npgsql type for column. + + + + Return the column name of the column at index . + + + + + Return the data type OID of the column at index . + + FIXME: Why this method returns String? + + + + Return the column name of the column named . + + + + + Return the data DbType of the column at index . + + + + + Return the data NpgsqlDbType of the column at index . + + + + + Get the value of a column as a . + If the differences between and + in handling of days and months is not important to your application, use + instead. + + Index of the field to find. + value of the field. + + + + Gets the value of a column converted to a Guid. + + + + + Gets the value of a column as Int16. + + + + + Gets the value of a column as Int32. + + + + + Gets the value of a column as Int64. + + + + + Gets the value of a column as Single. + + + + + Gets the value of a column as Double. + + + + + Gets the value of a column as String. + + + + + Gets the value of a column as Decimal. + + + + + Gets the value of a column as TimeSpan. + + + + + Copy values from each column in the current row into . + + Destination for column values. + The number of column values copied. + + + + Copy values from each column in the current row into . + + An array appropriately sized to store values from all columns. + The number of column values copied. + + + + Gets the value of a column as Boolean. + + + + + Gets the value of a column as Byte. Not implemented. + + + + + Gets the value of a column as Char. + + + + + Gets the value of a column as DateTime. + + + + + Returns a System.Data.DataTable that describes the column metadata of the DataReader. + + + + + This methods parses the command text and tries to get the tablename + from it. + + + + + Is raised whenever Close() is called. + + + + + Gets the number of columns in the current row. + + + + + Gets the value of a column in its native format. + + + + + Gets the value of a column in its native format. + + + + + Gets a value indicating the depth of nesting for the current row. Always returns zero. + + + + + Gets a value indicating whether the data reader is closed. + + + + + Contains the column names as the keys + + + + + Contains all unique columns + + + + + This is the primary implementation of NpgsqlDataReader. It is the one used in normal cases (where the + preload-reader option is not set in the connection string to resolve some potential backwards-compatibility + issues), the only implementation used internally, and in cases where CachingDataReader is used, it is still + used to do the actual "leg-work" of turning a response stream from the server into a datareader-style + object - with CachingDataReader then filling it's cache from here. + + + + + Iterate through the objects returned through from the server. + If it's a CompletedResponse the rowsaffected count is updated appropriately, + and we iterate again, otherwise we return it (perhaps updating our cache of pending + rows if appropriate). + + The next we will deal with. + + + + Advances the data reader to the next result, when multiple result sets were returned by the PostgreSQL backend. + + True if the reader was advanced, otherwise false. + + + + Releases the resources used by the NpgsqlCommand. + + + + + Closes the data reader object. + + + + + Advances the data reader to the next result, when multiple result sets were returned by the PostgreSQL backend. + + True if the reader was advanced, otherwise false. + + + + Advances the data reader to the next row. + + True if the reader was advanced, otherwise false. + + + + Return the value of the column at index . + + + + + Gets raw data from a column. + + + + + Gets raw data from a column. + + + + + Report whether the value in a column is DBNull. + + + + + Gets the number of rows changed, inserted, or deleted by execution of the SQL statement. + + + + + Indicates if NpgsqlDatareader has rows to be read. + + + + + Provides an implementation of NpgsqlDataReader in which all data is pre-loaded into memory. + This operates by first creating a ForwardsOnlyDataReader as usual, and then loading all of it's + Rows into memory. There is a general principle that when there is a trade-off between a class design that + is more efficient and/or scalable on the one hand and one that is less efficient but has more functionality + (in this case the internal-only functionality of caching results) that one can build the less efficent class + from the most efficient without significant extra loss in efficiency, but not the other way around. The relationship + between ForwardsOnlyDataReader and CachingDataReader is an example of this). + Since the interface presented to the user is still forwards-only, queues are used to + store this information, so that dequeueing as we go we give the garbage collector the best opportunity + possible to reclaim any memory that is no longer in use. + ForwardsOnlyDataReader being used to actually + obtain the information from the server means that the "leg-work" is still only done (and need only be + maintained) in one place. + This class exists to allow for certain potential backwards-compatibility issues to be resolved + with little effort on the part of affected users. It is considerably less efficient than ForwardsOnlyDataReader + and hence never used internally. + + + + + This is the base class for NpgsqlDescribeStatement and NpgsqlDescribePortal. + - - - Executes the query, and returns the first column of the first row - in the result set returned by the query. Extra columns or rows are ignored. - - The first column of the first row in the result set, - or a null reference if the result set is empty. + + + This class represents the Statement Describe message sent to PostgreSQL + server. + + - + + + This class represents the Portal Describe message sent to PostgreSQL + server. + + + + - Creates a prepared version of the command on a PostgreSQL server. + EventArgs class to send Notice parameters, which are just NpgsqlError's in a lighter context. - + - This method checks the connection state to see if the connection - is set or it is open. If one of this conditions is not met, throws - an InvalidOperationException + Notice information. - + - This method substitutes the Parameters, if exist, in the command - to their actual values. - The parameter name format is :ParameterName. + This class represents the ErrorResponse and NoticeResponse + message sent from PostgreSQL server. - A version of CommandText with the Parameters inserted. - + - Gets or sets the SQL statement or function (stored procedure) to execute at the data source. + Return a string representation of this error object. - The Transact-SQL statement or stored procedure to execute. The default is an empty string. - + - Gets or sets the wait time before terminating the attempt - to execute a command and generating an error. + Severity code. All versions. - The time (in seconds) to wait for the command to execute. - The default is 20 seconds. - + - Gets or sets a value indicating how the - CommandText property is to be interpreted. + Error code. PostgreSQL 7.4 and up. - One of the CommandType values. The default is CommandType.Text. - + - Gets or sets the NpgsqlConnection - used by this instance of the NpgsqlCommand. + Terse error message. All versions. - The connection to a data source. The default value is a null reference. - + - Gets the NpgsqlParameterCollection. + Detailed error message. PostgreSQL 7.4 and up. - The parameters of the SQL statement or function (stored procedure). The default is an empty collection. - + - Gets or sets the NpgsqlTransaction - within which the NpgsqlCommand executes. + Suggestion to help resolve the error. PostgreSQL 7.4 and up. - The NpgsqlTransaction. - The default value is a null reference. - + - Gets or sets how command results are applied to the DataRow - when used by the Update - method of the DbDataAdapter. + Position (one based) within the query string where the error was encounterd. PostgreSQL 7.4 and up. - One of the UpdateRowSource values. - + - Returns oid of inserted row. This is only updated when using executenonQuery and when command inserts just a single row. If table is created without oids, this will always be 0. + Position (one based) within the query string where the error was encounterd. This position refers to an internal command executed for example inside a PL/pgSQL function. PostgreSQL 7.4 and up. + + + Internal query string where the error was encounterd. This position refers to an internal command executed for example inside a PL/pgSQL function. PostgreSQL 7.4 and up. + + + + + Trace back information. PostgreSQL 7.4 and up. + + + + + Source file (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source file line number (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source routine (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Schema name which relates to the error. PostgreSQL 9.3 and up. + + + + + Table name which relates to the error. PostgreSQL 9.3 and up. + + + + + Column name which relates to the error. PostgreSQL 9.3 and up. + + + + + Data type of column which relates to the error. PostgreSQL 9.3 and up. + + + + + Constraint name which relates to the error. PostgreSQL 9.3 and up. + + + + + String containing the sql sent which produced this error. + + + + + Backend protocol version in use. + + + + + Error and notice message field codes + + + + + Severity: the field contents are ERROR, FATAL, or PANIC (in an error message), + or WARNING, NOTICE, DEBUG, INFO, or LOG (in a notice message), or a localized + translation of one of these. Always present. + + + + + Code: the SQLSTATE code for the error (see Appendix A). Not localizable. Always present. + + + + + Message: the primary human-readable error message. This should be accurate + but terse (typically one line). Always present. + + + + + Detail: an optional secondary error message carrying more detail about the problem. + Might run to multiple lines. + + + + + Hint: an optional suggestion what to do about the problem. This is intended to differ + from Detail in that it offers advice (potentially inappropriate) rather than hard facts. + Might run to multiple lines. + + + + + Position: the field value is a decimal ASCII integer, indicating an error cursor + position as an index into the original query string. The first character has index 1, + and positions are measured in characters not bytes. + + + + + Internal position: this is defined the same as the P field, but it is used when the + cursor position refers to an internally generated command rather than the one submitted + by the client. + The q field will always appear when this field appears. + + + + + Internal query: the text of a failed internally-generated command. + This could be, for example, a SQL query issued by a PL/pgSQL function. + + + + + Where: an indication of the context in which the error occurred. + Presently this includes a call stack traceback of active procedural language functions + and internally-generated queries. The trace is one entry per line, most recent first. + + + + + Schema name: if the error was associated with a specific database object, + the name of the schema containing that object, if any. + + + + + Table name: if the error was associated with a specific table, the name of the table. + (Refer to the schema name field for the name of the table's schema.) + + + + + Column name: if the error was associated with a specific table column, the name of the column. + (Refer to the schema and table name fields to identify the table.) + + + + + Data type name: if the error was associated with a specific data type, the name of the data type. + (Refer to the schema name field for the name of the data type's schema.) + + + + + Constraint name: if the error was associated with a specific constraint, the name of the constraint. + Refer to fields listed above for the associated table or domain. + (For this purpose, indexes are treated as constraints, even if they weren't created with constraint syntax.) + + + + + File: the file name of the source-code location where the error was reported. + + + + + Line: the line number of the source-code location where the error was reported. + + + + + Routine: the name of the source-code routine reporting the error. + + + + + The level of verbosity of the NpgsqlEventLog + + + + + Don't log at all + + + + + Only log the most common issues + + + + + Log everything + + + + + This class handles all the Npgsql event and debug logging + + + + + Writes a string to the Npgsql event log if msglevel is bigger then NpgsqlEventLog.Level + + + This method is obsolete and should no longer be used. + It is likely to be removed in future versions of Npgsql + + The message to write to the event log + The minimum LogLevel for which this message should be logged. + + + + Writes a string to the Npgsql event log if msglevel is bigger then NpgsqlEventLog.Level + + The ResourceManager to get the localized resources + The name of the resource that should be fetched by the ResourceManager + The minimum LogLevel for which this message should be logged. + The additional parameters that shall be included into the log-message (must be compatible with the string in the resource): + + + + Writes the default log-message for the action of calling the Get-part of an Indexer to the log file. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Indexer + The parameter given to the Indexer + + + + Writes the default log-message for the action of calling the Set-part of an Indexer to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Indexer + The parameter given to the Indexer + The value the Indexer is set to + + + + Writes the default log-message for the action of calling the Get-part of a Property to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Property + The name of the Property + + + + Writes the default log-message for the action of calling the Set-part of a Property to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Property + The name of the Property + The value the Property is set to + + + + Writes the default log-message for the action of calling a Method without Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + + + + Writes the default log-message for the action of calling a Method with one Argument to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + The value of the Argument of the Method + + + + Writes the default log-message for the action of calling a Method with two Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + The value of the first Argument of the Method + The value of the second Argument of the Method + + + + Writes the default log-message for the action of calling a Method with three Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + The value of the first Argument of the Method + The value of the second Argument of the Method + The value of the third Argument of the Method + + + + Writes the default log-message for the action of calling a Method with more than three Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + A Object-Array with zero or more Ojects that are Arguments of the Method. + + + + Sets/Returns the level of information to log to the logfile. + + The current LogLevel + + + + Sets/Returns the filename to use for logging. + + The filename of the current Log file. + + + + Sets/Returns whether Log messages should be echoed to the console + + true if Log messages are echoed to the console, otherwise false + + + + The exception that is thrown when the PostgreSQL backend reports errors. + + + + + Construct a backend error exception based on a list of one or more + backend errors. The basic Exception.Message will be built from the + first (usually the only) error in the list. + + + + + Format a .NET style exception string. + Include all errors in the list, including any hints. + + + + + Append a line to the given Stream, first checking for zero-length. + + + + + Provide access to the entire list of errors provided by the PostgreSQL backend. + + + + + Severity code. All versions. + + + + + Error code. PostgreSQL 7.4 and up. + + + + + Basic error message. All versions. + + + + + Detailed error message. PostgreSQL 7.4 and up. + + + + + Suggestion to help resolve the error. PostgreSQL 7.4 and up. + + + + + Position (one based) within the query string where the error was encounterd. PostgreSQL 7.4 and up. + + + + + Trace back information. PostgreSQL 7.4 and up. + + + + + Source file (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source file line number (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source routine (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Schema name which relates to the error. PostgreSQL 9.3 and up. + + + + + Table name which relates to the error. PostgreSQL 9.3 and up. + + + + + Column name which relates to the error. PostgreSQL 9.3 and up. + + + + + Data type of column which relates to the error. PostgreSQL 9.3 and up. + + + + + Constraint name which relates to the error. PostgreSQL 9.3 and up. + + + + + String containing the sql sent which produced this error. + + + + + Returns the entire list of errors provided by the PostgreSQL backend. + + + + + This class represents the Execute message sent to PostgreSQL + server. + + + + + + A factory to create instances of various Npgsql objects. + + + + + Creates an NpgsqlCommand object. + + + + + This class represents the Flush message sent to PostgreSQL + server. + + + + + + For classes representing simple messages, + consisting only of a message code and length identifier, + sent from the client to the server. + + + + + This class is responsible for serving as bridge between the backend + protocol handling and the core classes. It is used as the mediator for + exchanging data generated/sent from/to backend. + + + + + + EventArgs class to send Notification parameters. + + + + + Process ID of the PostgreSQL backend that sent this notification. + + + + + Condition that triggered that notification. + + + + + Additional Information From Notifiying Process (for future use, currently postgres always sets this to an empty string) + + + + + This class represents a parameter to a command that will be sent to server + + + + + Initializes a new instance of the NpgsqlParameter class. + + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name and a value of the new NpgsqlParameter. + + The m_Name of the parameter to map. + An Object that is the value of the NpgsqlParameter. + +

When you specify an Object + in the value parameter, the DbType is + inferred from the .NET Framework type of the Object.

+

When using this constructor, you must be aware of a possible misuse of the constructor which takes a DbType parameter. + This happens when calling this constructor passing an int 0 and the compiler thinks you are passing a value of DbType. + Use Convert.ToInt32(value) for example to have compiler calling the correct constructor.

+
+
+ + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name and the data type. + + The m_Name of the parameter to map. + One of the DbType values. + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name, the DbType, and the size. + + The m_Name of the parameter to map. + One of the DbType values. + The length of the parameter. + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name, the DbType, the size, + and the source column m_Name. + + The m_Name of the parameter to map. + One of the DbType values. + The length of the parameter. + The m_Name of the source column. + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name, the DbType, the size, + the source column m_Name, a ParameterDirection, + the precision of the parameter, the scale of the parameter, a + DataRowVersion to use, and the + value of the parameter. + + The m_Name of the parameter to map. + One of the DbType values. + The length of the parameter. + The m_Name of the source column. + One of the ParameterDirection values. + true if the value of the field can be null, otherwise false. + The total number of digits to the left and right of the decimal point to which + Value is resolved. + The total number of decimal places to which + Value is resolved. + One of the DataRowVersion values. + An Object that is the value + of the NpgsqlParameter. + + + + Creates a new NpgsqlParameter that + is a copy of the current instance. + + A new NpgsqlParameter that is a copy of this instance. + + + + The collection to which this parameter belongs, if any. + + + + + Gets or sets the maximum number of digits used to represent the + Value property. + + The maximum number of digits used to represent the + Value property. + The default value is 0, which indicates that the data provider + sets the precision for Value. + + + + Gets or sets the number of decimal places to which + Value is resolved. + + The number of decimal places to which + Value is resolved. The default is 0. + + + + Gets or sets the maximum size, in bytes, of the data within the column. + + The maximum size, in bytes, of the data within the column. + The default value is inferred from the parameter value. + + + + Gets or sets the DbType of the parameter. + + One of the DbType values. The default is String. + + + + Gets or sets the DbType of the parameter. + + One of the DbType values. The default is String. + + + + Gets or sets a value indicating whether the parameter is input-only, + output-only, bidirectional, or a stored procedure return value parameter. + + One of the ParameterDirection + values. The default is Input. + + + + Gets or sets a value indicating whether the parameter accepts null values. + + true if null values are accepted; otherwise, false. The default is false. + + + + Gets or sets the m_Name of the NpgsqlParameter. + + The m_Name of the NpgsqlParameter. + The default is an empty string. + + + + The m_Name scrubbed of any optional marker + + + + + Gets or sets the m_Name of the source column that is mapped to the + DataSet and used for loading or + returning the Value. + + The m_Name of the source column that is mapped to the + DataSet. The default is an empty string. + + + + Gets or sets the DataRowVersion + to use when loading Value. + + One of the DataRowVersion values. + The default is Current. + + + + Gets or sets the value of the parameter. + + An Object that is the value of the parameter. + The default value is null. + + + + Gets or sets the value of the parameter. + + An Object that is the value of the parameter. + The default value is null. + Represents a collection of parameters relevant to a NpgsqlCommand @@ -3866,6 +5038,12 @@ Initializes a new instance of the NpgsqlParameterCollection class. + + + Invalidate the hash lookup tables. This should be done any time a change + may throw the lookups out of sync with the list. + + Adds the specified NpgsqlParameter object to the NpgsqlParameterCollection. @@ -3875,11 +5053,8 @@ - Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value. + Obsolete. Use AddWithValue instead. - The name of the NpgsqlParameter. - The Value of the NpgsqlParameter to add to the collection. - The index of the new NpgsqlParameter object. Use caution when using this overload of the Add method to specify integer parameter values. @@ -3891,6 +5066,44 @@ are attempting to call the NpgsqlParameterCollection.Add(string, DbType) overload. + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value. + + The name of the NpgsqlParameter. + The Value of the NpgsqlParameter to add to the collection. + The paramater that was added. + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value. + + The name of the NpgsqlParameter. + The Value of the NpgsqlParameter to add to the collection. + One of the NpgsqlDbType values. + The paramater that was added. + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value. + + The name of the NpgsqlParameter. + The Value of the NpgsqlParameter to add to the collection. + One of the NpgsqlDbType values. + The length of the column. + The paramater that was added. + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value. + + The name of the NpgsqlParameter. + The Value of the NpgsqlParameter to add to the collection. + One of the NpgsqlDbType values. + The length of the column. + The name of the source column. + The paramater that was added. + Adds a NpgsqlParameter to the NpgsqlParameterCollection given the parameter name and the data type. @@ -3949,13 +5162,19 @@ Inserts a NpgsqlParameter into the collection at the specified index. The zero-based index where the parameter is to be inserted within the collection. - The NpgsqlParameter to add to the collection. + The NpgsqlParameter to add to the collection. + + + + Removes the specified NpgsqlParameter from the collection. + + The name of the NpgsqlParameter to remove from the collection. Removes the specified NpgsqlParameter from the collection. - The NpgsqlParameter to remove from the collection. + The NpgsqlParameter to remove from the collection. @@ -4031,84 +5250,19 @@ The number of NpgsqlParameter objects in the collection. - - - Represents an ongoing COPY FROM STDIN operation. - Provides methods to push data to server and end or cancel the operation. - - - - - Called from NpgsqlState.ProcessBackendResponses upon CopyInResponse. - If CopyStream is already set, it is used to read data to push to server, after which the copy is completed. - Otherwise CopyStream is set to a writable NpgsqlCopyInStream that calls SendCopyData each time it is written to. - - - - - Sends given packet to server as a CopyData message. - Does not check for notifications! Use another thread for that. - - - - - Sends CopyDone message to server. Handles responses, ie. may throw an exception. - - - - - Sends CopyFail message to server. Handles responses, ie. should always throw an exception: - in CopyIn state the server responds to CopyFail with an error response; - outside of a CopyIn state the server responds to CopyFail with an error response; - without network connection or whatever, there's going to eventually be a failure, timeout or user intervention. - - - - - Copy format information returned from server. - - - - - Represents a PostgreSQL Point type - - - - - Represents a PostgreSQL Line Segment type. - - - - - Represents a PostgreSQL Path type. - - - - - Represents a PostgreSQL Polygon type. - - - - - Represents a PostgreSQL Circle type. - - - - - Represents a PostgreSQL inet type. - - - - - Represents a PostgreSQL MacAddress type. - - - - + + + This class represents the ParameterStatus message sent from PostgreSQL + server. + + + + + + This class represents the Parse message sent to PostgreSQL + server. + - - The macAddr parameter must contain a string that can only consist of numbers - and upper-case letters as hexadecimal digits. (See PhysicalAddress.Parse method on MSDN) @@ -4116,5 +5270,351 @@ PostgreSQL. + + + Used when a connection is closed + + + + + Summary description for NpgsqlQuery + + + + + This is the abstract base class for NpgsqlAsciiRow and NpgsqlBinaryRow. + + + + + This class represents a RowDescription message sent from + the PostgreSQL. + + + + + + This struct represents the internal data of the RowDescription message. + + + + + Provides the underlying mechanism for reading schema information. + + + + + Returns the MetaDataCollections that lists all possible collections. + + The MetaDataCollections + + + + Returns the Restrictions that contains the meaning and position of the values in the restrictions array. + + The Restrictions + + + + Returns the Databases that contains a list of all accessable databases. + + The database connection on which to run the metadataquery. + The restrictions to filter the collection. + The Databases + + + + Returns the Tables that contains table and view names and the database and schema they come from. + + The database connection on which to run the metadataquery. + The restrictions to filter the collection. + The Tables + + + + Returns the Columns that contains information about columns in tables. + + The database connection on which to run the metadataquery. + The restrictions to filter the collection. + The Columns. + + + + Returns the Views that contains view names and the database and schema they come from. + + The database connection on which to run the metadataquery. + The restrictions to filter the collection. + The Views + + + + Returns the Users containing user names and the sysid of those users. + + The database connection on which to run the metadataquery. + The restrictions to filter the collection. + The Users. + + + + This class represents a StartupPacket message of PostgreSQL + protocol. + + + + + + Represents a completed response message. + + + + + This class represents the Sync message sent to PostgreSQL + server. + + + + + + Represents a transaction to be made in a PostgreSQL database. This class cannot be inherited. + + + + + Commits the database transaction. + + + + + Rolls back a transaction from a pending state. + + + + + Rolls back a transaction from a pending savepoint state. + + + + + Creates a transaction save point. + + + + + Cancel the transaction without telling the backend about it. This is + used to make the transaction go away when closing a connection. + + + + + Gets the NpgsqlConnection + object associated with the transaction, or a null reference if the + transaction is no longer valid. + + The NpgsqlConnection + object associated with the transaction. + + + + Specifies the IsolationLevel for this transaction. + + The IsolationLevel for this transaction. + The default is ReadCommitted. + + + + This class provides many util methods to handle + reading and writing of PostgreSQL protocol messages. + + + + + This method takes a ProtocolVersion and returns an integer + version number that the Postgres backend will recognize in a + startup packet. + + + + + This method takes a version string as returned by SELECT VERSION() and returns + a valid version string ("7.2.2" for example). + This is only needed when running protocol version 2. + This does not do any validity checks. + + + + + This method gets a C NULL terminated string from the network stream. + It keeps reading a byte in each time until a NULL byte is returned. + It returns the resultant string of bytes read. + This string is sent from backend. + + + + + Reads requested number of bytes from stream with retries until Stream.Read returns 0 or count is reached. + + Stream to read + byte buffer to fill + starting position to fill the buffer + number of bytes to read + The number of bytes read. May be less than count if no more bytes are available. + + + + Reads requested number of bytes from . If output matches exactly, and == false, is returned directly. + + Source array. + Starting position to read from + Number of bytes to read + Force a copy, even if the output is an exact copy of . + byte[] containing data requested. + + + + This method writes a string to the network stream. + + + + + This method writes a string to the network stream. + + + + + This method writes a C NULL terminated string to the network stream. + It appends a NULL terminator to the end of the String. + + + + + This method writes a C NULL terminated string to the network stream. + It appends a NULL terminator to the end of the String. + + + + + This method writes a byte to the stream. It also enables logging of them. + + + + + This method writes a byte to the stream. It also enables logging of them. + + + + + This method writes a set of bytes to the stream. It also enables logging of them. + + + + + This method writes a set of bytes to the stream. It also enables logging of them. + + + + + This method writes a C NULL terminated string limited in length to the + backend server. + It pads the string with null bytes to the size specified. + + + + + This method writes a C NULL terminated byte[] limited in length to the + backend server. + It pads the string with null bytes to the size specified. + + + + + Write a 32-bit integer to the given stream in the correct byte order. + + + + + Read a 32-bit integer from the given stream in the correct byte order. + + + + + Read a 32-bit integer from the given array in the correct byte order. + + + + + Write a 16-bit integer to the given stream in the correct byte order. + + + + + Read a 16-bit integer from the given stream in the correct byte order. + + + + + Read a 16-bit integer from the given array in the correct byte order. + + + + + Copy and possibly reverse a byte array, depending on host architecture endienness. + + Source byte array. + Force a copy even if no swap is performed. + , reversed if on a little-endian architecture, copied if required. + + + + Copy and possibly reverse a byte array, depending on host architecture endienness. + + Source byte array. + Starting offset in source array. + Number of bytes to copy. + Force a copy even if no swap is performed. + , reversed if on a little-endian architecture, copied if required. + + + + Represent the frontend/backend protocol version. + + + + + Represent the backend server version. + As this class offers no functionality beyond that offered by it has been + deprecated in favour of that class. + + + + + + Returns the string representation of this version in three place dot notation (Major.Minor.Patch). + + + + + Server version major number. + + + + + Server version minor number. + + + + + Server version patch level number. + + + + + A class to handle everything associated with SSPI authentication + + + + + Simplified SecBufferDesc struct with only one SecBuffer + + diff --git a/bin/OpenMetaverse.Rendering.Meshmerizer.dll b/bin/OpenMetaverse.Rendering.Meshmerizer.dll index 70875842f5..d3760151a4 100755 Binary files a/bin/OpenMetaverse.Rendering.Meshmerizer.dll and b/bin/OpenMetaverse.Rendering.Meshmerizer.dll differ diff --git a/bin/OpenMetaverse.StructuredData.dll b/bin/OpenMetaverse.StructuredData.dll index dd3113dc59..d2691546d2 100755 Binary files a/bin/OpenMetaverse.StructuredData.dll and b/bin/OpenMetaverse.StructuredData.dll differ diff --git a/bin/OpenMetaverse.dll b/bin/OpenMetaverse.dll index 1a63a9f8e8..a0782f8d28 100755 Binary files a/bin/OpenMetaverse.dll and b/bin/OpenMetaverse.dll differ diff --git a/bin/OpenMetaverseTypes.dll b/bin/OpenMetaverseTypes.dll index cf5080da2a..aa1d2e6c4b 100755 Binary files a/bin/OpenMetaverseTypes.dll and b/bin/OpenMetaverseTypes.dll differ diff --git a/bin/lib/NET/Mono.Security.dll b/bin/lib/NET/Mono.Security.dll index 6accde7911..1371f5cb63 100644 Binary files a/bin/lib/NET/Mono.Security.dll and b/bin/lib/NET/Mono.Security.dll differ