@@ -158,21 +158,21 @@ extension Connection {
158158/// Configuration options shared between the [FTS4](https://www.sqlite.org/fts3.html) and
159159/// [FTS5](https://www.sqlite.org/fts5.html) extensions.
160160public class FTSConfig {
161- typealias ColumnDefinition = ( Expressible , Bool )
161+ public enum ColumnOption {
162+ /// [The notindexed= option](https://www.sqlite.org/fts3.html#section_6_5)
163+ case unindexed
164+ }
165+
166+ typealias ColumnDefinition = ( Expressible , options: [ ColumnOption ] )
162167 var columnDefinitions = [ ColumnDefinition] ( )
163168 var tokenizer : Tokenizer ?
164169 var prefixes = [ Int] ( )
165170 var externalContentSchema : SchemaType ?
166171 var isContentless : Bool = false
167172
168- /// Adds an indexed column definition
169- public func column( column: Expressible ) -> Self {
170- return self . column ( column, indexed: true )
171- }
172-
173173 /// Adds a column definition
174- public func column( column: Expressible , indexed : Bool ) -> Self {
175- self . columnDefinitions. append ( ( column, indexed ) )
174+ public func column( column: Expressible , _ options : [ ColumnOption ] = [ ] ) -> Self {
175+ self . columnDefinitions. append ( ( column, options ) )
176176 return self
177177 }
178178
@@ -329,8 +329,8 @@ public class FTS4Config : FTSConfig {
329329
330330 override func options( ) -> Options {
331331 var options = super. options ( )
332- for notIndexedColumn in ( columnDefinitions. filter { ! $0. 1 } . map { $0 . 0 } ) {
333- options. append ( " notindexed " , value: notIndexedColumn )
332+ for (column , _ ) in ( columnDefinitions. filter { $0. options . contains ( . unindexed ) } ) {
333+ options. append ( " notindexed " , value: column )
334334 }
335335 options. append ( " languageid " , value: languageId)
336336 options. append ( " compress " , value: compressFunction)
0 commit comments