sqliteclidriver: indicate driver in status bar

This commit is contained in:
mappu 2024-06-30 12:48:22 +12:00
parent a7dd1ca340
commit 5c44dc5f54
2 changed files with 12 additions and 0 deletions

View File

@ -3,10 +3,16 @@
package main package main
import ( import (
"yvbolt/sqliteclidriver"
sqlite3 "github.com/mattn/go-sqlite3" sqlite3 "github.com/mattn/go-sqlite3"
) )
func (ld *sqliteLoadedDatabase) DriverName() string { func (ld *sqliteLoadedDatabase) DriverName() string {
if _, ok := ld.db.Driver().(*sqliteclidriver.SCDriver); ok {
return "SQLite (sqliteclidriver)"
}
ver1, _, _ := sqlite3.Version() ver1, _, _ := sqlite3.Version()
return "SQLite " + ver1 return "SQLite " + ver1
} }

View File

@ -3,9 +3,15 @@
package main package main
import ( import (
"yvbolt/sqliteclidriver"
_ "modernc.org/sqlite" _ "modernc.org/sqlite"
) )
func (ld *sqliteLoadedDatabase) DriverName() string { func (ld *sqliteLoadedDatabase) DriverName() string {
if _, ok := ld.db.Driver().(*sqliteclidriver.SCDriver); ok {
return "SQLite (sqliteclidriver)"
}
return "SQLite (modernc.org)" return "SQLite (modernc.org)"
} }