• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / supabase-swift / 29498521121

16 Jul 2026 12:32PM UTC coverage: 83.725% (+0.4%) from 83.375%
29498521121

push

github

web-flow
feat(postgrest): add notIn filter, dryRun and maybeSingle modifiers (#1114)

* feat(postgrest): add notIn filter, dryRun and maybeSingle modifiers

Closes remaining SDK-1298 query builder gaps: `notIn(_:values:)` filter,
`dryRun()` (Prefer: tx=rollback), and `maybeSingle()` which returns nil
instead of throwing when a query matches zero rows.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* test(postgrest): add integration tests for notIn, dryRun, maybeSingle

Verified end-to-end against a local Supabase instance. dryRun can only
smoke-test the request succeeds — actual rollback requires PostgREST's
db-tx-end setting, which the Supabase CLI dev config doesn't expose;
the Prefer header itself is covered by the PostgREST unit tests.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* test(postgrest): verify dryRun actually rolls back via db_tx_end role setting

PostgREST's db-tx-end can be set per-role via `ALTER ROLE authenticator
SET pgrst.db_tx_end`, same as postgrest-js's own test setup — my earlier
assumption that it required a process-level env var (unreachable via the
Supabase CLI) was wrong. With this enabled, testDryRunOnUpdate now
asserts the update was genuinely rolled back, not just that it didn't
error.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* chore: register notIn/dryRun/maybeSingle in sdk-compliance.yaml

CI's public API check flagged these 3 new symbols as unregistered.

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>

34 of 34 new or added lines in 3 files covered. (100.0%)

140 existing lines in 5 files now uncovered.

8061 of 9628 relevant lines covered (83.72%)

38.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

41.67
/Sources/Auth/Storage/KeychainLocalStorage.swift
1
#if !os(Windows) && !os(Linux) && !os(Android)
2
  public import Foundation
3

4
  /// ``AuthLocalStorage`` implementation using Keychain. This is the default local storage used by the library.
5
  public struct KeychainLocalStorage: AuthLocalStorage {
6
    private let keychain: Keychain
7

8
    /// Creates a Keychain-backed storage instance.
9
    ///
10
    /// - Parameters:
11
    ///   - service: The Keychain service name used to namespace stored items.
12
    ///     Defaults to `"supabase.gotrue.swift"`.
13
    ///   - accessGroup: An optional Keychain access group for sharing items between apps.
14
    public init(service: String? = "supabase.gotrue.swift", accessGroup: String? = nil) {
1✔
15
      keychain = Keychain(service: service, accessGroup: accessGroup)
1✔
16
    }
1✔
17

18
    /// Stores `value` in the Keychain under `key`.
19
    ///
20
    /// - Parameters:
21
    ///   - key: The Keychain item key.
22
    ///   - value: The raw bytes to store.
23
    /// - Throws: A Keychain error if the write fails.
24
    public func store(key: String, value: Data) throws {
×
25
      try keychain.set(value, forKey: key)
×
26
    }
×
27

28
    /// Returns the data stored in the Keychain for `key`, or `nil` if not present.
29
    ///
30
    /// - Parameter key: The Keychain item key.
31
    /// - Returns: The stored bytes, or `nil` if the item does not exist.
32
    /// - Throws: A Keychain error if the read fails.
33
    public func retrieve(key: String) throws -> Data? {
4✔
34
      try keychain.data(forKey: key)
4✔
UNCOV
35
    }
×
36

37
    /// Removes the Keychain item for `key`.
38
    ///
39
    /// - Parameter key: The Keychain item key to delete.
40
    /// - Throws: A Keychain error if the delete fails.
41
    public func remove(key: String) throws {
×
42
      try keychain.deleteItem(forKey: key)
×
43
    }
×
44
  }
45
#endif
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc