⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@iwecon
Copy link

@iwecon iwecon commented Dec 8, 2025

Details: #135

Because zadd defaults to (RESPValue, Double), scoreIsFirst is set to false by default.

zadd function:

@inlinable
public func zadd<Value: RESPValueConvertible>(
    _ elements: [(element: Value, score: Double)],
    to key: RedisKey,
    inserting insertBehavior: RedisZaddInsertBehavior = .allElements,
    returning returnBehavior: RedisZaddReturnBehavior = .insertedElementsCount
) -> EventLoopFuture<Int> {
    var args: [RESPValue] = [.init(from: key)]

    args.append(convertingContentsOf: [insertBehavior.string, returnBehavior.string].compactMap({ $0 }))
    args.add(contentsOf: elements, overestimatedCountBeingAdded: elements.count * 2) { (array, next) in
        array.append(.init(bulk: next.score.description))
        array.append(next.element.convertedToRESPValue())
    }

    return self.send(command: "ZADD", with: args)
        .tryConverting()
}

@iwecon
Copy link
Author

iwecon commented Dec 8, 2025

@fabianfett @0xTim pls review! :)

@iwecon
Copy link
Author

iwecon commented Jan 16, 2026

Has this project been forgotten?
@Joannis @fabianfett @Mordil

@Joannis
Copy link
Member

Joannis commented Jan 16, 2026

@iwecon it's been superceded by the official Valkey client: https://github.com/valkey-io/valkey-swift
Valkey is the OpenSource fork of Redis powered by the Linux Foundation, highly recommend you use thhat library going forward.

@iwecon
Copy link
Author

iwecon commented Jan 16, 2026

@iwecon it's been superceded by the official Valkey client: https://github.com/valkey-io/valkey-swift Valkey is the OpenSource fork of Redis powered by the Linux Foundation, highly recommend you use thhat library going forward.

Ah, okay. Is this repository no longer being maintained?

@0xTim
Copy link
Member

0xTim commented Jan 16, 2026

Ah, okay. Is this repository no longer being maintained?

@iwecon practically yes, however I can merge the changes and do a release for this given it's a small patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants