Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 89bd3ed27a | |||
| 2a22e92be4 | |||
| 5d829befca | |||
| 2eb7385516 | |||
| 543f573c7f | |||
| 463daba2cf | |||
| 9588e5189e |
27
Makefile
27
Makefile
@@ -1,13 +1,18 @@
|
||||
SHELL:=/bin/bash
|
||||
SOURCES=$(find . -name '*.go' -type f)
|
||||
SOURCES := $(shell find . -name '*.go' -type f)
|
||||
GIT_REV := $(shell git describe --exact-match --tags 2>/dev/null || printf "%s-%s" $$(git describe --tags --abbrev=0) $$(git rev-parse HEAD | head -c8))
|
||||
.DEFAULT_GOAL := dist
|
||||
MIQT_UIC ?= ~/go/bin/miqt-uic
|
||||
MIQT_RCC ?= ~/go/bin/miqt-rcc
|
||||
MIQT_DOCKER ?= ~/go/bin/miqt-docker
|
||||
GO_WINRES ?= ~/go/bin/go-winres
|
||||
|
||||
.PHONY: generate
|
||||
generate:
|
||||
~/go/bin/miqt-uic -InFile mainwindow.ui -OutFile mainwindow.go -Qt6
|
||||
~/go/bin/miqt-uic -InFile connectionDialog.ui -OutFile connectionDialog.go -Qt6
|
||||
~/go/bin/miqt-uic -InFile connectionManagerDialog.ui -OutFile connectionManagerDialog.go -Qt6
|
||||
~/go/bin/miqt-rcc -Input embed.qrc -Qt6
|
||||
$(MIQT_UIC) -InFile mainwindow.ui -OutFile mainwindow.go -Qt6
|
||||
$(MIQT_UIC) -InFile connectionDialog.ui -OutFile connectionDialog.go -Qt6
|
||||
$(MIQT_UIC) -InFile connectionManagerDialog.ui -OutFile connectionManagerDialog.go -Qt6
|
||||
$(MIQT_RCC) -Input embed.qrc -Qt6
|
||||
|
||||
.PHONY: designer
|
||||
designer:
|
||||
@@ -22,16 +27,21 @@ optimize-images:
|
||||
|
||||
yvbolt: $(SOURCES)
|
||||
# Target a debian-12 baseline build
|
||||
~/go/bin/miqt-docker linux64-go1.25-qt6.4-dynamic -minify-build
|
||||
sed -i -re 's/".+"/"$(GIT_REV)"/g' version.go
|
||||
$(MIQT_DOCKER) linux64-go1.25-qt6.4-dynamic -minify-build
|
||||
git checkout -- version.go
|
||||
chmod 755 yvbolt
|
||||
upx --lzma yvbolt
|
||||
|
||||
yvbolt.exe: $(SOURCES)
|
||||
~/go/bin/miqt-docker win64-cross-go1.24-qt6.5-static -windows-build --tags=windowsqtstatic
|
||||
sed -i -re 's/".+"/"$(GIT_REV)"/g' version.go
|
||||
$(MIQT_DOCKER) win64-cross-go1.24-qt6.5-static -windows-build --tags=windowsqtstatic
|
||||
git checkout -- version.go
|
||||
$(GO_WINRES) patch --in winres.json --no-backup --product-version git-tag --file-version git-tag yvbolt.exe
|
||||
upx --lzma yvbolt.exe
|
||||
|
||||
yvbolt.apk: $(SOURCES)
|
||||
~/go/bin/miqt-docker android-armv8a-go1.23-qt6.6-dynamic -android-build
|
||||
$(MIQT_DOCKER) android-armv8a-go1.23-qt6.6-dynamic -android-build
|
||||
|
||||
yvbolt.linux64.tar.xz: yvbolt
|
||||
rm -f yvbolt.linux64.tar.xz
|
||||
@@ -46,4 +56,5 @@ dist: yvbolt.linux64.tar.xz yvbolt.win64.zip
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
git checkout -- version.go
|
||||
rm -f yvbolt.exe yvbolt yvbolt.linux64.tar.xz yvbolt.win64.zip
|
||||
|
||||
11
config.go
11
config.go
@@ -23,22 +23,17 @@ type ConnectionConfig struct {
|
||||
Bolt *boltConfig `yicon:":/assets/vendor_github.png" json:",omitempty"`
|
||||
Debconf *debconfConnection `yicon:":/assets/vendor_debian.png" json:",omitempty"`
|
||||
SecretService *secretServiceConnection `ylabel:"Freedesktop.org Secret Service" yicon:":/assets/vendor_freedesktop.png" json:",omitempty"`
|
||||
LevelDB *leveldbConnection `yicon:":/assets/vendor_leveldb.png" json:",omitempty"`
|
||||
LevelDB *leveldbConnection `ylabel:"LevelDB" yicon:":/assets/vendor_leveldb.png" json:",omitempty"`
|
||||
LMDB *lmdbConnection `yicon:":/assets/vendor_lmdb.png" json:",omitempty"`
|
||||
Pebble *pebbleConnection `yicon:":/assets/vendor_cockroach.png" json:",omitempty"`
|
||||
Redis *redisConnectionOptions `yicon:":/assets/vendor_redis.png" json:",omitempty"`
|
||||
SQLite *sqliteConnection `yicon:":/assets/vendor_sqlite.png" json:",omitempty"`
|
||||
SQLite *sqliteConnection `ylabel:"SQLite" yicon:":/assets/vendor_sqlite.png" json:",omitempty"`
|
||||
Starskey *starskeyConnection `yicon:":/assets/vendor_starskey.png" json:",omitempty"`
|
||||
}
|
||||
|
||||
func NewConnectionConfig() *ConnectionConfig {
|
||||
return &ConnectionConfig{
|
||||
Debconf: &debconfConnection{
|
||||
Database: "/var/cache/debconf/config.dat", // Prefill default path
|
||||
},
|
||||
Redis: &redisConnectionOptions{
|
||||
Address: autoconfig.AddressPort{Port: 6379}, // default value
|
||||
},
|
||||
Type: "Bolt", // favouritism
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
|
||||
"yvbolt/debconf"
|
||||
|
||||
@@ -104,6 +105,12 @@ type debconfConnection struct {
|
||||
Database autoconfig.ExistingFile `yfilter:"Debconf database (*.dat);;All files (*)"`
|
||||
}
|
||||
|
||||
func (dc *debconfConnection) Reset() {
|
||||
if runtime.GOOS == "linux" {
|
||||
dc.Database = "/var/cache/debconf/config.dat" // Prefill default path
|
||||
}
|
||||
}
|
||||
|
||||
func (dc *debconfConnection) Connect(ctx context.Context) (loadedDatabase, string, error) {
|
||||
fh, err := os.OpenFile(string(dc.Database), os.O_RDONLY, 0400)
|
||||
if err != nil {
|
||||
|
||||
@@ -20,6 +20,10 @@ type redisConnectionOptions struct {
|
||||
SSH_Tunnel *SSHTunnel
|
||||
}
|
||||
|
||||
func (config *redisConnectionOptions) Reset() {
|
||||
config.Address.Port = 6379
|
||||
}
|
||||
|
||||
func (config *redisConnectionOptions) Connect(ctx context.Context) (loadedDatabase, string, error) {
|
||||
|
||||
ld := &redisLoadedDatabase{
|
||||
|
||||
2
go.mod
2
go.mod
@@ -8,7 +8,7 @@ require (
|
||||
github.com/cockroachdb/pebble v1.1.5
|
||||
github.com/dgraph-io/badger/v4 v4.8.0
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/mappu/autoconfig v0.3.1-0.20251126064959-64718706eb2a
|
||||
github.com/mappu/autoconfig v0.4.1
|
||||
github.com/mappu/miqt v0.12.1-0.20251106063543-466b60e47edf
|
||||
github.com/mattn/go-sqlite3 v1.14.32
|
||||
github.com/redis/go-redis/v9 v9.16.0
|
||||
|
||||
6
go.sum
6
go.sum
@@ -83,6 +83,12 @@ github.com/mappu/autoconfig v0.2.0 h1:5auhryqiubVBFq9CdY+VHU36bysG70tRGPpyT+M4yc
|
||||
github.com/mappu/autoconfig v0.2.0/go.mod h1:kca6kaYjqOwkZnY9z5YKo0oI/7Bxe2fMIHhYzXwGHEE=
|
||||
github.com/mappu/autoconfig v0.3.1-0.20251126064959-64718706eb2a h1:3vhzzO7RLT9qx3kWaPrHTS52pt7ENCRNbeJlkyWfEzw=
|
||||
github.com/mappu/autoconfig v0.3.1-0.20251126064959-64718706eb2a/go.mod h1:kca6kaYjqOwkZnY9z5YKo0oI/7Bxe2fMIHhYzXwGHEE=
|
||||
github.com/mappu/autoconfig v0.4.0 h1:MlclKKe1aAInei2V06uLE4wm4UlFxDAW+tMt/G/wlgY=
|
||||
github.com/mappu/autoconfig v0.4.0/go.mod h1:kca6kaYjqOwkZnY9z5YKo0oI/7Bxe2fMIHhYzXwGHEE=
|
||||
github.com/mappu/autoconfig v0.4.1-0.20251203061113-3f3e7118918b h1:8GyYnPw4E7YRaKeM0NzA9IsM/OqjkjaIec10W7i/UWs=
|
||||
github.com/mappu/autoconfig v0.4.1-0.20251203061113-3f3e7118918b/go.mod h1:kca6kaYjqOwkZnY9z5YKo0oI/7Bxe2fMIHhYzXwGHEE=
|
||||
github.com/mappu/autoconfig v0.4.1 h1:ekO7mzN+beFu7VhNfJxNlL/5wkYcP9PAl9VTG4EDxYs=
|
||||
github.com/mappu/autoconfig v0.4.1/go.mod h1:kca6kaYjqOwkZnY9z5YKo0oI/7Bxe2fMIHhYzXwGHEE=
|
||||
github.com/mappu/miqt v0.12.0 h1:bBMBDeACmV8TbdLfoN51la7kF6QT3sNAcG+ZdRDgmxU=
|
||||
github.com/mappu/miqt v0.12.0/go.mod h1:xFg7ADaO1QSkmXPsPODoKe/bydJpRG9fgCYyIDl/h1U=
|
||||
github.com/mappu/miqt v0.12.1-0.20251106063543-466b60e47edf h1:SmBzNUevLUzu1msJ5xzWH/Kot+GtOtoz0u9la42dRU4=
|
||||
|
||||
2
main.go
2
main.go
@@ -168,7 +168,7 @@ func (f *App) OnMenuHelpVersion() {
|
||||
}
|
||||
}
|
||||
|
||||
qt.QMessageBox_About(f.ui.MainWindow.QWidget, APPNAME, info)
|
||||
qt.QMessageBox_About(f.ui.MainWindow.QWidget, APPNAME+" "+appVersion, info)
|
||||
}
|
||||
|
||||
func (f *App) OnNavContextPopup(pos *qt.QPoint) {
|
||||
|
||||
3
version.go
Normal file
3
version.go
Normal file
@@ -0,0 +1,3 @@
|
||||
package main
|
||||
|
||||
const appVersion = "v0.0.0-devel"
|
||||
54
winres.json
Normal file
54
winres.json
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"RT_GROUP_ICON": {
|
||||
"APP": {
|
||||
"0000": "assets/database_lightning.png"
|
||||
}
|
||||
},
|
||||
"RT_VERSION": {
|
||||
"#1": {
|
||||
"0000": {
|
||||
"fixed": {
|
||||
"file_version": "0.0.0.0",
|
||||
"product_version": "0.0.0.0"
|
||||
},
|
||||
"info": {
|
||||
"0409": {
|
||||
"Comments": "",
|
||||
"CompanyName": "code.ivysaur.me",
|
||||
"FileDescription": "yvbolt Database Editor",
|
||||
"FileVersion": "0.0.0.0",
|
||||
"LegalCopyright": "code.ivysaur.me",
|
||||
"LegalTrademarks": "",
|
||||
"ProductName": "yvbolt",
|
||||
"ProductVersion": "0.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"RT_MANIFEST": {
|
||||
"#1": {
|
||||
"0409": {
|
||||
"identity": {
|
||||
"name": "",
|
||||
"version": ""
|
||||
},
|
||||
"description": "",
|
||||
"minimum-os": "win7",
|
||||
"execution-level": "as invoker",
|
||||
"ui-access": false,
|
||||
"auto-elevate": false,
|
||||
"dpi-awareness": "per monitor v2",
|
||||
"disable-theming": false,
|
||||
"disable-window-filtering": false,
|
||||
"high-resolution-scrolling-aware": false,
|
||||
"ultra-high-resolution-scrolling-aware": false,
|
||||
"long-path-aware": false,
|
||||
"printer-driver-isolation": false,
|
||||
"gdi-scaling": false,
|
||||
"segment-heap": false,
|
||||
"use-common-controls-v6": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user