Skip to content

Commit

Permalink
Add a comment
Browse files Browse the repository at this point in the history
...
  • Loading branch information
helje5 committed Nov 4, 2024
1 parent d83a267 commit 933e1c9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Sources/ZeeQL/Access/ModelPattern.swift
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,20 @@ fileprivate extension ModelEntity {

public extension Adaptor {

/**
* Resolves a pattern model against data fetched from the information schema.
*
* This does not touch the `model` property of the adaptor. It opens a channel
* to the database, fetches the information schema and then resolves the
* pattern against that.
*
* - Parameters:
* - pattern: A pattern Model, if the model is not a pattern, it is
* returned as is.
* - Returns: The resolved pattern model.
*/
func resolveModelPattern(_ pattern: Model) throws -> Model? {
guard pattern.isPattern else { return pattern}
guard pattern.isPattern else { return pattern }

var entities = pattern.entities
if entities.isEmpty { /* not sure whether this is a good idea */
Expand Down

0 comments on commit 933e1c9

Please sign in to comment.