mirror of https://github.com/AMT-Cheif/drift.git
expose rowid when ft5 with content table
This commit is contained in:
parent
7e807dcff8
commit
986f7d24a5
|
@ -28,6 +28,8 @@ class _Fts5Module extends Module {
|
|||
return _Fts5Table(
|
||||
name: stmt.tableName,
|
||||
columns: [
|
||||
if (stmt.argumentContent.any((arg) => arg.startsWith('content_rowid')))
|
||||
TableColumn('rowid', const ResolvedType(type: BasicType.int)),
|
||||
for (var arg in columnNames)
|
||||
TableColumn(arg, const ResolvedType(type: BasicType.text)),
|
||||
],
|
||||
|
|
|
@ -20,6 +20,19 @@ void main() {
|
|||
expect(columns.single.name, 'bar');
|
||||
});
|
||||
|
||||
test('can create fts5 tables with content table', () {
|
||||
final result = engine.analyze('CREATE VIRTUAL TABLE foo USING '
|
||||
"fts5(bar , tokenize = 'porter ascii',content=tbl, content_rowid=d)");
|
||||
|
||||
final table = const SchemaFromCreateTable()
|
||||
.read(result.root as TableInducingStatement);
|
||||
|
||||
expect(table.name, 'foo');
|
||||
final columns = table.resultColumns;
|
||||
expect(columns, hasLength(2));
|
||||
expect(columns.first.name, 'rowid');
|
||||
});
|
||||
|
||||
group('creating fts5vocab tables', () {
|
||||
final engine = SqlEngine(_fts5Options);
|
||||
|
||||
|
|
Loading…
Reference in New Issue