fix viewer compilation
fix multiple attach to the same sqlite database