Skip to content

Commit c8b01a3

Browse files
authored
Merge pull request vapor#89 from vapor/refresh-table-names
allow table name refresh
2 parents 6b7ccf1 + b48c325 commit c8b01a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: Sources/PostgreSQL/Connection/PostgreSQLConnection+TableNameCache.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ extension PostgreSQLConnection {
3232
self.tableNames = tableNames
3333
}
3434
}
35-
35+
3636
/// Fetches a struct that can convert table OIDs to table names.
3737
///
3838
/// SELECT oid, relname FROM pg_class
3939
///
4040
/// The table names will be cached on the connection after fetching.
41-
public func tableNames() -> Future<TableNameCache> {
42-
if let existing = tableNameCache {
41+
public func tableNames(refresh: Bool = false) -> Future<TableNameCache> {
42+
if let existing = tableNameCache, !refresh {
4343
return future(existing)
4444
} else {
4545
struct PGClass: PostgreSQLTable {

0 commit comments

Comments
 (0)