-
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add logger type * Add SupabaseLogger * Fix tests * Add SupabaseLoggingConfiguration * Simplify logger * Inline log methods * Revert some breaking changes and deprecate some initializers
- Loading branch information
Showing
23 changed files
with
550 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// | ||
// Deprecated.swift | ||
// | ||
// | ||
// Created by Guilherme Souza on 16/01/24. | ||
// | ||
|
||
import Foundation | ||
|
||
#if canImport(FoundationNetworking) | ||
import FoundationNetworking | ||
#endif | ||
|
||
extension PostgrestClient.Configuration { | ||
/// Initializes a new configuration for the PostgREST client. | ||
/// - Parameters: | ||
/// - url: The URL of the PostgREST server. | ||
/// - schema: The schema to use. | ||
/// - headers: The headers to include in requests. | ||
/// - fetch: The fetch handler to use for requests. | ||
/// - encoder: The JSONEncoder to use for encoding. | ||
/// - decoder: The JSONDecoder to use for decoding. | ||
@available( | ||
*, | ||
deprecated, | ||
message: "Replace usages of this initializer with new init(url:schema:headers:logger:fetch:encoder:decoder:)" | ||
) | ||
public init( | ||
url: URL, | ||
schema: String? = nil, | ||
headers: [String: String] = [:], | ||
fetch: @escaping PostgrestClient.FetchHandler = { try await URLSession.shared.data(for: $0) }, | ||
encoder: JSONEncoder = PostgrestClient.Configuration.jsonEncoder, | ||
decoder: JSONDecoder = PostgrestClient.Configuration.jsonDecoder | ||
) { | ||
self.init( | ||
url: url, | ||
schema: schema, | ||
headers: headers, | ||
logger: nil, | ||
fetch: fetch, | ||
encoder: encoder, | ||
decoder: decoder | ||
) | ||
} | ||
} | ||
|
||
extension PostgrestClient { | ||
/// Creates a PostgREST client with the specified parameters. | ||
/// - Parameters: | ||
/// - url: The URL of the PostgREST server. | ||
/// - schema: The schema to use. | ||
/// - headers: The headers to include in requests. | ||
/// - session: The URLSession to use for requests. | ||
/// - encoder: The JSONEncoder to use for encoding. | ||
/// - decoder: The JSONDecoder to use for decoding. | ||
@available( | ||
*, | ||
deprecated, | ||
message: "Replace usages of this initializer with new init(url:schema:headers:logger:fetch:encoder:decoder:)" | ||
) | ||
public init( | ||
url: URL, | ||
schema: String? = nil, | ||
headers: [String: String] = [:], | ||
fetch: @escaping FetchHandler = { try await URLSession.shared.data(for: $0) }, | ||
encoder: JSONEncoder = PostgrestClient.Configuration.jsonEncoder, | ||
decoder: JSONDecoder = PostgrestClient.Configuration.jsonDecoder | ||
) { | ||
self.init( | ||
url: url, | ||
schema: schema, | ||
headers: headers, | ||
logger: nil, | ||
fetch: fetch, | ||
encoder: encoder, | ||
decoder: decoder | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.