stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.57k stars 1.54k forks source link

about glob function, may need an field on right #1193

Open coder-free opened 1 year ago

coder-free commented 1 year ago

current:


    /// Builds a copy of the expression appended with a `GLOB` query against the
    /// given pattern.
    ///
    ///     let path = Expression<String?>("path")
    ///     path.glob("*.png")
    ///     // "path" GLOB '*.png'
    ///
    /// - Parameter pattern: A pattern to match.
    ///
    /// - Returns: A copy of the expression appended with a `GLOB` query against
    ///   the given pattern.
    public func glob(_ pattern: String) -> Expression<Bool?> {
        Function.glob.infix(self, pattern)
    }

field on right, may rglob:


    /// Builds a copy of the expression appended with a `GLOB` query against the
    /// given pattern.
    ///
    ///     let path = Expression<String?>("path")
    ///     path.rglob("*.png")
    ///     // '*.png' GLOB "path"
    ///
    /// - Parameter pattern: A pattern to match.
    ///
    /// - Returns: A copy of the expression appended with a `GLOB` query against
    ///   the given pattern.
    public func rglob(_ pattern: String) -> Expression<Bool?> {
        Function.glob.infix(pattern, self)
    }