mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
sqlite supports readonly
This commit is contained in:
parent
29591a613a
commit
4acce560ad
@ -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) {
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user