Change SQLiteNG to work with mono 2.6 and above using the Mono.Data.Sqlite.dll

Include the library so that Windows builds correctly
It appears that Windows is okay with either SQLite or SQLiteNG
Incorporate the latest fixes made by Diva to OpenSim.Data.SQLite
This commit is contained in:
Justin Clark-Casey (justincc)
2010-04-23 18:56:50 +01:00
parent a23bebdc0f
commit e84cc2f9db
17 changed files with 246 additions and 440 deletions

View File

@@ -30,7 +30,7 @@ using System.Collections.Generic;
using System.Data;
using System.Reflection;
using log4net;
using Mono.Data.SqliteClient;
using Mono.Data.Sqlite;
using OpenMetaverse;
using OpenSim.Framework;
@@ -98,11 +98,13 @@ namespace OpenSim.Data.SQLite
ds.Tables.Add(createInventoryFoldersTable());
invFoldersDa.Fill(ds.Tables["inventoryfolders"]);
setupFoldersCommands(invFoldersDa, conn);
CreateDataSetMapping(invFoldersDa, "inventoryfolders");
m_log.Info("[INVENTORY DB]: Populated Inventory Folders Definitions");
ds.Tables.Add(createInventoryItemsTable());
invItemsDa.Fill(ds.Tables["inventoryitems"]);
setupItemsCommands(invItemsDa, conn);
CreateDataSetMapping(invItemsDa, "inventoryitems");
m_log.Info("[INVENTORY DB]: Populated Inventory Items Definitions");
ds.AcceptChanges();
@@ -728,6 +730,15 @@ namespace OpenSim.Data.SQLite
*
**********************************************************************/
protected void CreateDataSetMapping(IDataAdapter da, string tableName)
{
ITableMapping dbMapping = da.TableMappings.Add(tableName, tableName);
foreach (DataColumn col in ds.Tables[tableName].Columns)
{
dbMapping.ColumnMappings.Add(col.ColumnName, col.ColumnName);
}
}
/// <summary>
/// Create the "inventoryitems" table
/// </summary>