feat: pyrunner mejorado para fn run Python

Refactoriza la ejecucion de funciones Python en fn run. Extrae la logica
a pyrunner.go con soporte para importar dependencias del registry y
ejecutar con el venv del proyecto. Agrega WalCheckpoint en db.go para
que lectores externos vean datos actualizados tras fn index.
This commit is contained in:
2026-03-29 00:13:46 +01:00
parent cd09ddcc76
commit a4b5651e8c
3 changed files with 468 additions and 43 deletions
+6
View File
@@ -46,6 +46,12 @@ func (db *DB) Close() error {
return db.conn.Close()
}
// WalCheckpoint flushes the WAL to the main database file so external
// readers (e.g. Metabase via bind mount) see the latest data.
func (db *DB) WalCheckpoint() {
db.conn.Exec("PRAGMA wal_checkpoint(TRUNCATE)")
}
// Drop removes the database file. Used by `fn index` to regenerate.
func (db *DB) Drop() error {
db.Close()