@@ -158,21 +158,21 @@ extension Connection {
158
158
/// Configuration options shared between the [FTS4](https://www.sqlite.org/fts3.html) and
159
159
/// [FTS5](https://www.sqlite.org/fts5.html) extensions.
160
160
public 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 ] )
162
167
var columnDefinitions = [ ColumnDefinition] ( )
163
168
var tokenizer : Tokenizer ?
164
169
var prefixes = [ Int] ( )
165
170
var externalContentSchema : SchemaType ?
166
171
var isContentless : Bool = false
167
172
168
- /// Adds an indexed column definition
169
- public func column( column: Expressible ) -> Self {
170
- return self . column ( column, indexed: true )
171
- }
172
-
173
173
/// 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 ) )
176
176
return self
177
177
}
178
178
@@ -329,8 +329,8 @@ public class FTS4Config : FTSConfig {
329
329
330
330
override func options( ) -> Options {
331
331
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 )
334
334
}
335
335
options. append ( " languageid " , value: languageId)
336
336
options. append ( " compress " , value: compressFunction)
0 commit comments