From 5c44dc5f546e6820ee1af005568c0cc476cdff08 Mon Sep 17 00:00:00 2001 From: mappu Date: Sun, 30 Jun 2024 12:48:22 +1200 Subject: [PATCH] sqliteclidriver: indicate driver in status bar --- db_sqlite_cgo.go | 6 ++++++ db_sqlite_nocgo.go | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/db_sqlite_cgo.go b/db_sqlite_cgo.go index 93bb654..5752389 100644 --- a/db_sqlite_cgo.go +++ b/db_sqlite_cgo.go @@ -3,10 +3,16 @@ package main import ( + "yvbolt/sqliteclidriver" + sqlite3 "github.com/mattn/go-sqlite3" ) func (ld *sqliteLoadedDatabase) DriverName() string { + if _, ok := ld.db.Driver().(*sqliteclidriver.SCDriver); ok { + return "SQLite (sqliteclidriver)" + } + ver1, _, _ := sqlite3.Version() return "SQLite " + ver1 } diff --git a/db_sqlite_nocgo.go b/db_sqlite_nocgo.go index 19d15e3..fa5baa8 100644 --- a/db_sqlite_nocgo.go +++ b/db_sqlite_nocgo.go @@ -3,9 +3,15 @@ package main import ( + "yvbolt/sqliteclidriver" + _ "modernc.org/sqlite" ) func (ld *sqliteLoadedDatabase) DriverName() string { + if _, ok := ld.db.Driver().(*sqliteclidriver.SCDriver); ok { + return "SQLite (sqliteclidriver)" + } + return "SQLite (modernc.org)" }