mirror of
https://github.com/opensim/opensim.git
synced 2026-05-15 03:15:41 +08:00
SQLite connector for UserAccounts and Auth works. Yey!
This commit is contained in:
@@ -48,6 +48,7 @@ namespace OpenSim.Data.SQLite
|
||||
protected string m_Realm;
|
||||
protected FieldInfo m_DataField = null;
|
||||
|
||||
protected static SqliteConnection m_Connection;
|
||||
private static bool m_initialized;
|
||||
|
||||
public SQLiteGenericTableHandler(string connectionString,
|
||||
@@ -63,9 +64,14 @@ namespace OpenSim.Data.SQLite
|
||||
if (storeName != String.Empty)
|
||||
{
|
||||
Assembly assem = GetType().Assembly;
|
||||
SqliteConnection newConnection =
|
||||
(SqliteConnection)((ICloneable)m_Connection).Clone();
|
||||
newConnection.Open();
|
||||
|
||||
Migration m = new Migration(m_Connection, assem, storeName);
|
||||
Migration m = new Migration(newConnection, assem, storeName);
|
||||
m.Update();
|
||||
newConnection.Close();
|
||||
newConnection.Dispose();
|
||||
}
|
||||
|
||||
m_initialized = true;
|
||||
@@ -136,7 +142,7 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
protected T[] DoQuery(SqliteCommand cmd)
|
||||
{
|
||||
IDataReader reader = ExecuteReader(cmd);
|
||||
IDataReader reader = ExecuteReader(cmd, m_Connection);
|
||||
if (reader == null)
|
||||
return new T[0];
|
||||
|
||||
@@ -191,7 +197,7 @@ namespace OpenSim.Data.SQLite
|
||||
result.Add(row);
|
||||
}
|
||||
|
||||
CloseReaderCommand(cmd);
|
||||
CloseCommand(cmd);
|
||||
|
||||
return result.ToArray();
|
||||
}
|
||||
@@ -240,7 +246,7 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
cmd.CommandText = query;
|
||||
|
||||
if (ExecuteNonQuery(cmd) > 0)
|
||||
if (ExecuteNonQuery(cmd, m_Connection) > 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -253,7 +259,7 @@ namespace OpenSim.Data.SQLite
|
||||
cmd.CommandText = String.Format("delete from {0} where `{1}` = :{1}", m_Realm, field);
|
||||
cmd.Parameters.Add(new SqliteParameter(field, val));
|
||||
|
||||
if (ExecuteNonQuery(cmd) > 0)
|
||||
if (ExecuteNonQuery(cmd, m_Connection) > 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user