HelloZeroNet / HelloZeroNet/ZeroNet

Support virtual sqlite3 tables in dbschema.json

Abierto
#1,456 6 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
18.8k
Forks
2.3k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Sqlite has two very useful extensions: [Full Text Search](https://www.sqlite.org/fts5.html) and [Spellfix search](https://www.sqlite.org/spellfix1.html) that could make searching on Zites more meaningful and very fast.

Looking briefly at files in `src/Db`, I think that it would be a very short change to enable virtual tables: One could just modify a couple of lines in the function [`createTable@DbCursor.py`](https://github.com/HelloZeroNet/ZeroNet/blob/master/src/Db/DbCursor.py#L106-L114).

So a new virtual table using fts5 could be defined as
```
"fts_posts": {
"virtual": true,
"payload": fts5(title, body, uuid UNINDEXED)",
"schema_changed": 1
}
```
that would be translated into `CREATE VIRTUAL TABLE fts_posts USING fts5(title, body, uuid UNINDEXED)`. Update and delete queries works as in a standard table.

It is indeed true that such extensions are optional, but since ZeroNet ships with its built version of sqlite3 I think we can make sure such extensions are enabled.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Start in src/Db/DbCursor.py at createTable, then trace how dbschema.json entries reach that function. Confirm how the bundled SQLite build handles virtual-table extensions and verify that the proposed schema produces the intended CREATE VIRTUAL TABLE behavior, including update and delete operations.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python, sqlite
Área
databases
Tipo de issue
Nueva funcionalidad
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
38/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.