diff --git a/plugins/dbgate-plugin-sqlite/src/backend/driver.js b/plugins/dbgate-plugin-sqlite/src/backend/driver.js index caef4471..7258d18b 100644 --- a/plugins/dbgate-plugin-sqlite/src/backend/driver.js +++ b/plugins/dbgate-plugin-sqlite/src/backend/driver.js @@ -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) { diff --git a/plugins/dbgate-plugin-sqlite/src/frontend/driver.js b/plugins/dbgate-plugin-sqlite/src/frontend/driver.js index 4bd8de2e..6041d65c 100644 --- a/plugins/dbgate-plugin-sqlite/src/frontend/driver.js +++ b/plugins/dbgate-plugin-sqlite/src/frontend/driver.js @@ -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,