public static Task <PKGroup?> QueryGroupByName(this IPKConnection conn, SystemId system, string name) => conn.QueryFirstOrDefaultAsync <PKGroup?>("select * from groups where system = @System and lower(Name) = lower(@Name)", new { System = system, Name = name });
public static Task <PKGroup?> QueryGroupByHid(this IPKConnection conn, string hid) => conn.QueryFirstOrDefaultAsync <PKGroup?>("select * from groups where hid = @hid", new { hid = hid.ToLowerInvariant() });
public static Task <PKMember?> QueryMember(this IPKConnection conn, MemberId id) => conn.QueryFirstOrDefaultAsync <PKMember?>("select * from members where id = @id", new { id });
public static Task <PKSystem?> QuerySystem(this IPKConnection conn, SystemId id) => conn.QueryFirstOrDefaultAsync <PKSystem?>("select * from systems where id = @id", new { id });
public static Task <MessageContext> QueryMessageContext(this IPKConnection conn, ulong account, ulong guild, ulong channel) { return(conn.QueryFirstOrDefaultAsync <MessageContext>("message_context", new { account_id = account, guild_id = guild, channel_id = channel }, commandType: CommandType.StoredProcedure)); }
public Task <PKMember?> GetMemberByDisplayName(IPKConnection conn, SystemId system, string name) => conn.QueryFirstOrDefaultAsync <PKMember?>("select * from members where lower(display_name) = lower(@Name) and system = @SystemID", new { Name = name, SystemID = system });
public Task <PKGroup?> GetGroupByDisplayName(IPKConnection conn, SystemId system, string display_name) => conn.QueryFirstOrDefaultAsync <PKGroup?>("select * from groups where system = @System and lower(display_name) = lower(@Name)", new { System = system, Name = display_name });