@@ -78,6 +78,7 @@ public struct TableInfo: Hashable, Sendable, Identifiable {
7878 case table
7979 case view
8080 case materializedView
81+ case foreignTable
8182 case systemTable
8283 case externalTable
8384 case sequence
@@ -92,7 +93,7 @@ public struct TableInfo: Hashable, Sendable, Identifiable {
9293 /// which is what happened to a MariaDB sequence.
9394 public var listSection : ListSection {
9495 switch self {
95- case . table, . systemTable, . externalTable, . sequence: return . tables
96+ case . table, . foreignTable , . systemTable, . externalTable, . sequence: return . tables
9697 case . view, . materializedView: return . views
9798 }
9899 }
@@ -102,7 +103,7 @@ public struct TableInfo: Hashable, Sendable, Identifiable {
102103 public var allowsTruncate : Bool {
103104 switch self {
104105 case . table: return true
105- case . view, . materializedView, . systemTable, . externalTable, . sequence: return false
106+ case . view, . materializedView, . foreignTable , . systemTable, . externalTable, . sequence: return false
106107 }
107108 }
108109
@@ -115,7 +116,7 @@ public struct TableInfo: Hashable, Sendable, Identifiable {
115116 public var allowsDrop : Bool {
116117 switch self {
117118 case . table, . sequence: return true
118- case . view, . materializedView, . systemTable, . externalTable: return false
119+ case . view, . materializedView, . foreignTable , . systemTable, . externalTable: return false
119120 }
120121 }
121122
@@ -127,7 +128,7 @@ public struct TableInfo: Hashable, Sendable, Identifiable {
127128 /// why the Mac app withholds row editing for one and this must too.
128129 public var allowsRowEditing : Bool {
129130 switch self {
130- case . table, . systemTable: return true
131+ case . table, . foreignTable , . systemTable: return true
131132 case . view, . materializedView, . externalTable, . sequence: return false
132133 }
133134 }
@@ -154,19 +155,25 @@ public struct IndexInfo: Sendable {
154155 public let isUnique : Bool
155156 public let isPrimary : Bool
156157 public let type : String
158+ public let includedColumns : [ String ]
159+ public let whereClause : String ?
157160
158161 public init (
159162 name: String ,
160163 columns: [ String ] ,
161164 isUnique: Bool = false ,
162165 isPrimary: Bool = false ,
163- type: String = " BTREE "
166+ type: String = " BTREE " ,
167+ includedColumns: [ String ] = [ ] ,
168+ whereClause: String ? = nil
164169 ) {
165170 self . name = name
166171 self . columns = columns
167172 self . isUnique = isUnique
168173 self . isPrimary = isPrimary
169174 self . type = type
175+ self . includedColumns = includedColumns
176+ self . whereClause = whereClause
170177 }
171178}
172179
@@ -260,6 +267,8 @@ public extension TableInfo {
260267 kind = . view
261268 case " MATERIALIZED VIEW " :
262269 kind = . materializedView
270+ case " FOREIGN TABLE " , " FOREIGN " :
271+ kind = . foreignTable
263272 case " SYSTEM TABLE " :
264273 kind = . systemTable
265274 case " EXTERNAL TABLE " :
@@ -300,7 +309,9 @@ public extension IndexInfo {
300309 columns: plugin. columns,
301310 isUnique: plugin. isUnique,
302311 isPrimary: plugin. isPrimary,
303- type: plugin. type
312+ type: plugin. type,
313+ includedColumns: plugin. includedColumns ?? [ ] ,
314+ whereClause: plugin. whereClause
304315 )
305316 }
306317}
0 commit comments