sqlite supports readonly

This commit is contained in:
Jan Prochazka 2022-03-17 13:33:38 +01:00
parent 29591a613a
commit 4acce560ad
2 changed files with 4 additions and 3 deletions

View File

@ -52,8 +52,8 @@ function runStreamItem(client, sql, options, rowCounter) {
const driver = {
...driverBase,
analyserClass: Analyser,
async connect({ databaseFile }) {
const pool = new Database(databaseFile);
async connect({ databaseFile, isReadOnly }) {
const pool = new Database(databaseFile, { readonly: !!isReadOnly });
return pool;
},
async close(pool) {

View File

@ -42,7 +42,8 @@ const driver = {
dialect,
engine: 'sqlite@dbgate-plugin-sqlite',
title: 'SQLite',
showConnectionField: (field, values) => field == 'databaseFile',
readOnlySessions: true,
showConnectionField: (field, values) => field == 'databaseFile' || field == 'isReadOnly',
showConnectionTab: (field) => false,
beforeConnectionSave: (connection) => ({
...connection,