diff options
author | lbsa71 | 2008-03-28 14:54:20 +0000 |
---|---|---|
committer | lbsa71 | 2008-03-28 14:54:20 +0000 |
commit | 8c901e93474af5fcd17a7f37acd711622c5286e0 (patch) | |
tree | 732b8db3dd2480d7cdeed49f4d086194e529ba6f /OpenSim/Framework/Data.SQLite/SQLiteUtils.cs | |
parent | Applied patch from mantis# 825, thanks A_Biondi (diff) | |
download | opensim-SC-8c901e93474af5fcd17a7f37acd711622c5286e0.zip opensim-SC-8c901e93474af5fcd17a7f37acd711622c5286e0.tar.gz opensim-SC-8c901e93474af5fcd17a7f37acd711622c5286e0.tar.bz2 opensim-SC-8c901e93474af5fcd17a7f37acd711622c5286e0.tar.xz |
* Introduced common abstract AssetDataBase implementing IAssetProvider
* changed the semantics of SQLiteBase to SQLiteUtils
* Added abstract placeholder files for the other db providers
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Data.SQLite/SQLiteUtils.cs (renamed from OpenSim/Framework/Data.SQLite/SQLiteBase.cs) | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteBase.cs b/OpenSim/Framework/Data.SQLite/SQLiteUtils.cs index 8997faa..1334e53 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteBase.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteUtils.cs | |||
@@ -34,17 +34,17 @@ namespace OpenSim.Framework.Data.SQLite | |||
34 | /// <summary> | 34 | /// <summary> |
35 | /// A base class for methods needed by all SQLite database classes | 35 | /// A base class for methods needed by all SQLite database classes |
36 | /// </summary> | 36 | /// </summary> |
37 | public class SQLiteBase | 37 | public class SQLiteUtil |
38 | { | 38 | { |
39 | /*********************************************************************** | 39 | /*********************************************************************** |
40 | * | 40 | * |
41 | * Database Definition Functions | 41 | * Database Definition Helper Functions |
42 | * | 42 | * |
43 | * This should be db agnostic as we define them in ADO.NET terms | 43 | * This should be db agnostic as we define them in ADO.NET terms |
44 | * | 44 | * |
45 | **********************************************************************/ | 45 | **********************************************************************/ |
46 | 46 | ||
47 | protected static void createCol(DataTable dt, string name, Type type) | 47 | public static void createCol(DataTable dt, string name, Type type) |
48 | { | 48 | { |
49 | DataColumn col = new DataColumn(name, type); | 49 | DataColumn col = new DataColumn(name, type); |
50 | dt.Columns.Add(col); | 50 | dt.Columns.Add(col); |
@@ -60,7 +60,7 @@ namespace OpenSim.Framework.Data.SQLite | |||
60 | * | 60 | * |
61 | **********************************************************************/ | 61 | **********************************************************************/ |
62 | 62 | ||
63 | protected static SqliteCommand createInsertCommand(string table, DataTable dt) | 63 | public static SqliteCommand createInsertCommand(string table, DataTable dt) |
64 | { | 64 | { |
65 | /** | 65 | /** |
66 | * This is subtle enough to deserve some commentary. | 66 | * This is subtle enough to deserve some commentary. |
@@ -95,7 +95,7 @@ namespace OpenSim.Framework.Data.SQLite | |||
95 | return cmd; | 95 | return cmd; |
96 | } | 96 | } |
97 | 97 | ||
98 | protected static SqliteCommand createUpdateCommand(string table, string pk, DataTable dt) | 98 | public static SqliteCommand createUpdateCommand(string table, string pk, DataTable dt) |
99 | { | 99 | { |
100 | string sql = "update " + table + " set "; | 100 | string sql = "update " + table + " set "; |
101 | string subsql = String.Empty; | 101 | string subsql = String.Empty; |
@@ -123,7 +123,7 @@ namespace OpenSim.Framework.Data.SQLite | |||
123 | } | 123 | } |
124 | 124 | ||
125 | 125 | ||
126 | protected static string defineTable(DataTable dt) | 126 | public static string defineTable(DataTable dt) |
127 | { | 127 | { |
128 | string sql = "create table " + dt.TableName + "("; | 128 | string sql = "create table " + dt.TableName + "("; |
129 | string subsql = String.Empty; | 129 | string subsql = String.Empty; |
@@ -168,7 +168,7 @@ namespace OpenSim.Framework.Data.SQLite | |||
168 | /// for us. | 168 | /// for us. |
169 | ///</summary> | 169 | ///</summary> |
170 | ///<returns>a built sqlite parameter</returns> | 170 | ///<returns>a built sqlite parameter</returns> |
171 | protected static SqliteParameter createSqliteParameter(string name, Type type) | 171 | public static SqliteParameter createSqliteParameter(string name, Type type) |
172 | { | 172 | { |
173 | SqliteParameter param = new SqliteParameter(); | 173 | SqliteParameter param = new SqliteParameter(); |
174 | param.ParameterName = ":" + name; | 174 | param.ParameterName = ":" + name; |
@@ -184,7 +184,7 @@ namespace OpenSim.Framework.Data.SQLite | |||
184 | * | 184 | * |
185 | **********************************************************************/ | 185 | **********************************************************************/ |
186 | 186 | ||
187 | protected static DbType dbtypeFromType(Type type) | 187 | public static DbType dbtypeFromType(Type type) |
188 | { | 188 | { |
189 | if (type == typeof (String)) | 189 | if (type == typeof (String)) |
190 | { | 190 | { |
@@ -226,7 +226,7 @@ namespace OpenSim.Framework.Data.SQLite | |||
226 | 226 | ||
227 | // this is something we'll need to implement for each db | 227 | // this is something we'll need to implement for each db |
228 | // slightly differently. | 228 | // slightly differently. |
229 | protected static string sqliteType(Type type) | 229 | public static string sqliteType(Type type) |
230 | { | 230 | { |
231 | if (type == typeof (String)) | 231 | if (type == typeof (String)) |
232 | { | 232 | { |