mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-03 09:24:00 +00:00
sqlite supports readonly
This commit is contained in:
@@ -52,8 +52,8 @@ function runStreamItem(client, sql, options, rowCounter) {
|
|||||||
const driver = {
|
const driver = {
|
||||||
...driverBase,
|
...driverBase,
|
||||||
analyserClass: Analyser,
|
analyserClass: Analyser,
|
||||||
async connect({ databaseFile }) {
|
async connect({ databaseFile, isReadOnly }) {
|
||||||
const pool = new Database(databaseFile);
|
const pool = new Database(databaseFile, { readonly: !!isReadOnly });
|
||||||
return pool;
|
return pool;
|
||||||
},
|
},
|
||||||
async close(pool) {
|
async close(pool) {
|
||||||
|
|||||||
@@ -42,7 +42,8 @@ const driver = {
|
|||||||
dialect,
|
dialect,
|
||||||
engine: 'sqlite@dbgate-plugin-sqlite',
|
engine: 'sqlite@dbgate-plugin-sqlite',
|
||||||
title: 'SQLite',
|
title: 'SQLite',
|
||||||
showConnectionField: (field, values) => field == 'databaseFile',
|
readOnlySessions: true,
|
||||||
|
showConnectionField: (field, values) => field == 'databaseFile' || field == 'isReadOnly',
|
||||||
showConnectionTab: (field) => false,
|
showConnectionTab: (field) => false,
|
||||||
beforeConnectionSave: (connection) => ({
|
beforeConnectionSave: (connection) => ({
|
||||||
...connection,
|
...connection,
|
||||||
|
|||||||
Reference in New Issue
Block a user