29 using System.Collections;
30 using System.Collections.Generic;
33 using OpenSim.Framework;
35 using Community.CsharpSqlite.Sqlite;
37 using Mono.Data.Sqlite;
40 namespace OpenSim.Data.SQLite
45 : base(connectionString, realm,
"FriendsStore")
51 return GetFriends(principalID.ToString());
56 using (SqliteCommand cmd =
new SqliteCommand())
58 cmd.CommandText = String.Format(
"select a.*,case when b.Flags is null then -1 else b.Flags end as TheirFlags from {0} as a left join {0} as b on a.PrincipalID = b.Friend and a.Friend = b.PrincipalID where a.PrincipalID = :PrincipalID", m_Realm);
59 cmd.Parameters.AddWithValue(
":PrincipalID", userID.ToString());
65 public bool Delete(UUID principalID,
string friend)
67 return Delete(principalID.ToString(),
friend);
70 public override bool Delete(
string principalID,
string friend)
72 using (SqliteCommand cmd =
new SqliteCommand())
74 cmd.CommandText = String.Format(
"delete from {0} where PrincipalID = :PrincipalID and Friend = :Friend", m_Realm);
75 cmd.Parameters.AddWithValue(
":PrincipalID", principalID.ToString());
76 cmd.Parameters.AddWithValue(
":Friend",
friend);
78 ExecuteNonQuery(cmd, m_Connection);
SQLiteFriendsData(string connectionString, string realm)
An interface for connecting to the friends datastore
bool Delete(UUID principalID, string friend)
override bool Delete(string principalID, string friend)
FriendsData[] GetFriends(string userID)
FriendsData[] GetFriends(UUID principalID)