Skip to content

Commit

Permalink
feat(postgrest)!: remove deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
grdsdev committed Aug 3, 2024
1 parent 1da76dd commit d18627e
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 135 deletions.
80 changes: 0 additions & 80 deletions Sources/PostgREST/Deprecated.swift

This file was deleted.

53 changes: 1 addition & 52 deletions Sources/PostgREST/PostgrestFilterBuilder.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import Helpers

public class PostgrestFilterBuilder: PostgrestTransformBuilder {
public class PostgrestFilterBuilder: PostgrestTransformBuilder, @unchecked Sendable {
public enum Operator: String, CaseIterable, Sendable {
case eq, neq, gt, gte, lt, lte, like, ilike, `is`, `in`, cs, cd, sl, sr, nxl, nxr, adj, ov, fts,
plfts, phfts, wfts
Expand Down Expand Up @@ -472,33 +472,6 @@ public class PostgrestFilterBuilder: PostgrestTransformBuilder {
textSearch(column, query: query, config: config, type: nil)
}

@available(*, deprecated, message: "Use textSearch(_:query:config:type) with .plain type.")
public func plfts(
_ column: String,
query: any URLQueryRepresentable,
config: String? = nil
) -> PostgrestFilterBuilder {
textSearch(column, query: query, config: config, type: .plain)
}

@available(*, deprecated, message: "Use textSearch(_:query:config:type) with .phrase type.")
public func phfts(
_ column: String,
query: any URLQueryRepresentable,
config: String? = nil
) -> PostgrestFilterBuilder {
textSearch(column, query: query, config: config, type: .phrase)
}

@available(*, deprecated, message: "Use textSearch(_:query:config:type) with .websearch type.")
public func wfts(
_ column: String,
query: any URLQueryRepresentable,
config: String? = nil
) -> PostgrestFilterBuilder {
textSearch(column, query: query, config: config, type: .websearch)
}

/// Match only rows which satisfy the filter. This is an escape hatch - you should use the specific filter methods wherever possible.
///
/// Unlike most filters, `opearator` and `value` are used as-is and need to follow [PostgREST syntax](https://postgrest.org/en/stable/api.html#operators). You also need to make sure they are properly sanitized.
Expand Down Expand Up @@ -618,28 +591,4 @@ public class PostgrestFilterBuilder: PostgrestTransformBuilder {
) -> PostgrestFilterBuilder {
fts(column, query: query, config: config)
}

public func plainToFullTextSearch(
_ column: String,
query: String,
config: String? = nil
) -> PostgrestFilterBuilder {
plfts(column, query: query, config: config)
}

public func phraseToFullTextSearch(
_ column: String,
query: String,
config: String? = nil
) -> PostgrestFilterBuilder {
phfts(column, query: query, config: config)
}

public func webFullTextSearch(
_ column: String,
query: String,
config: String? = nil
) -> PostgrestFilterBuilder {
wfts(column, query: query, config: config)
}
}
2 changes: 1 addition & 1 deletion Sources/PostgREST/PostgrestQueryBuilder.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import Helpers

public final class PostgrestQueryBuilder: PostgrestBuilder {
public final class PostgrestQueryBuilder: PostgrestBuilder, @unchecked Sendable {
/// Perform a SELECT query on the table or view.
/// - Parameters:
/// - columns: The columns to retrieve, separated by commas. Columns can be renamed when returned with `customName:columnName`
Expand Down
2 changes: 1 addition & 1 deletion Sources/PostgREST/PostgrestRpcBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Helpers

struct NoParams: Encodable {}

public final class PostgrestRpcBuilder: PostgrestBuilder {
public final class PostgrestRpcBuilder: PostgrestBuilder, @unchecked Sendable {
/// Performs a function call with parameters.
/// - Parameters:
/// - params: The parameters to pass to the function.
Expand Down
2 changes: 1 addition & 1 deletion Sources/PostgREST/PostgrestTransformBuilder.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import Helpers

public class PostgrestTransformBuilder: PostgrestBuilder {
public class PostgrestTransformBuilder: PostgrestBuilder, @unchecked Sendable {
/// Perform a SELECT on the query result.
///
/// By default, `.insert()`, `.update()`, `.upsert()`, and `.delete()` do not return modified rows. By calling this method, modified rows are returned in `value`.
Expand Down

0 comments on commit d18627e

Please sign in to comment.