You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
message:"Direct access to database is deprecated, please use one of the available methods such as, SupabaseClient.from(_:), SupabaseClient.rpc(_:params:), or SupabaseClient.schema(_:)."
@@ -30,53 +30,74 @@ public final class SupabaseClient: @unchecked Sendable {
30
30
/// by access policies.
31
31
publicletauth:AuthClient
32
32
33
-
/// Database client for Supabase.
34
-
@available(
35
-
*,
36
-
deprecated,
37
-
message:"Direct access to database is deprecated, please use one of the available methods such as, SupabaseClient.from(_:), SupabaseClient.rpc(_:params:), or SupabaseClient.schema(_:)."
38
-
)
39
-
publicvardatabase:PostgrestClient{
40
-
rest
41
-
}
33
+
varrest:PostgrestClient{
34
+
mutableState.withValue{
35
+
if $0.rest ==nil{
36
+
$0.rest =PostgrestClient(
37
+
url: databaseURL,
38
+
schema: options.db.schema,
39
+
headers: defaultHeaders.dictionary,
40
+
logger: options.global.logger,
41
+
fetch: fetchWithAuth,
42
+
encoder: options.db.encoder,
43
+
decoder: options.db.decoder
44
+
)
45
+
}
42
46
43
-
private lazy varrest=PostgrestClient(
44
-
url: databaseURL,
45
-
schema: options.db.schema,
46
-
headers: defaultHeaders.dictionary,
47
-
logger: options.global.logger,
48
-
fetch: fetchWithAuth,
49
-
encoder: options.db.encoder,
50
-
decoder: options.db.decoder
51
-
)
47
+
return $0.rest!
48
+
}
49
+
}
52
50
53
51
/// Supabase Storage allows you to manage user-generated content, such as photos or videos.
0 commit comments