Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
293bbef
feat(channel): a nightly build that knows its channel, with its own n…
ShayanAbbas1 Nov 16, 2026
d37585f
build(release): build, sign and publish DBDelve Nightly from main eve…
ShayanAbbas1 Nov 16, 2026
1d17ff4
fix(update): keep the macOS-only version check out of Linux and Windo…
ShayanAbbas1 Nov 16, 2026
757151b
feat(nightly): import connections, saved passwords, queries and setti…
ShayanAbbas1 Nov 16, 2026
0bb7cab
fix(nightly): put an import in place at the next launch, before anyth…
ShayanAbbas1 Nov 16, 2026
defc878
fix(nightly): settle an import only when no other window runs, and ne…
ShayanAbbas1 Nov 16, 2026
221f82a
fix(nightly): copy saved passwords only once an import is in place
ShayanAbbas1 Nov 16, 2026
316dfa1
fix(nightly): one process claims the password copy, and keychain erro…
ShayanAbbas1 Nov 16, 2026
81e0772
fix(nightly): build the path-rewrite test's paths per platform, so it…
ShayanAbbas1 Nov 16, 2026
f100d78
fix(channel): keep stable off variants that name DBDelve Nightly's da…
ShayanAbbas1 Nov 16, 2026
dfe7b68
fix(nightly): connect at launch only once an import's saved passwords…
ShayanAbbas1 Nov 16, 2026
7639926
fix(nightly): Escape answers the import dialog before the client impo…
ShayanAbbas1 Nov 16, 2026
0e66654
fix(channel): tests expect this build's channel, so a nightly build p…
ShayanAbbas1 Nov 16, 2026
76e50c0
fix(deps): pin walkdir to the locked version
ShayanAbbas1 Nov 16, 2026
d5d43f6
fix(update): build the macOS-only version check only on macOS
ShayanAbbas1 Nov 16, 2026
fad1696
fix(nightly): a disconnect while passwords copy keeps the connection …
ShayanAbbas1 Nov 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
234 changes: 209 additions & 25 deletions .github/workflows/release.yml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,10 @@ serde_json = { version = "1", features = ["raw_value"] }
jsonc-parser = { version = "=0.34.0", features = ["serde"] }
toml = "0.9" # profiles.toml
url = "2"
# Import from DBDelve copies a data directory whole. Already in the graph
# (gpui-component and font-kit); pinned to the locked version so naming it
# links no second copy.
walkdir = "=2.5.0"

# ISO-8601 dates in mongosh statements (`ISODate(…)`, `{"$date": …}`), for
# `mql.rs`, and in the cells of a MongoDB result. Already in the graph through
Expand Down
43 changes: 43 additions & 0 deletions assets/icon/dbdelve-nightly.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/linux/icons/dbdelve-nightly-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/linux/icons/dbdelve-nightly-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/linux/icons/dbdelve-nightly-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/linux/icons/dbdelve-nightly-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/linux/icons/dbdelve-nightly-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/linux/icons/dbdelve-nightly-64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 22 additions & 15 deletions assets/linux/install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env bash
#
# Installs DBDelve for the current user, out of the unpacked release tarball.
# The same script ships in DBDelve Nightly's tarball, whose binary is
# dbdelve-nightly: every name below follows the binary beside it, so the two
# install side by side.
#
# Everything lands under ~/.local, so this never needs root and never fights
# the distribution's package manager over a path it owns.
Expand All @@ -9,12 +12,16 @@
set -euo pipefail

HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SLUG=dbdelve
if [[ -f "$HERE/dbdelve-nightly" ]]; then
SLUG=dbdelve-nightly
fi
BIN="$HOME/.local/bin"
ICONS="$HOME/.local/share/icons/hicolor"
APPS="$HOME/.local/share/applications"
# The binary lands alone in ~/.local/bin, so its bridge goes to the per-user
# plugin directory db::plugin::discover() also reads, not beside the binary.
DATA="${XDG_DATA_HOME:-$HOME/.local/share}/dbdelve"
DATA="${XDG_DATA_HOME:-$HOME/.local/share}/$SLUG"
PLUGINS="$DATA/plugins"
# The bridge's staged and backup copies: beside plugins/ rather than in it,
# where another DBDelve would load them, and on its filesystem, so moving one
Expand All @@ -30,7 +37,7 @@ mkdir -p "$DATA"
if command -v flock >/dev/null; then
exec 9>"$DATA/.install.lock"
flock -n 9 || {
echo "another dbdelve install is running" >&2
echo "another $SLUG install is running" >&2
exit 1
}
fi
Expand All @@ -47,15 +54,15 @@ refresh() {
}

if [[ "${1:-}" == --uninstall ]]; then
rm -f "$BIN/dbdelve" "$BIN/.dbdelve.new" "$APPS/dbdelve.desktop"
rm -f "$BIN/$SLUG" "$BIN/.$SLUG.new" "$APPS/$SLUG.desktop"
rm -rf "$PLUGINS/odbc" "$STAGED" "$BACKUP"
for size in "${SIZES[@]}"; do
rm -f "$ICONS/${size}x${size}/apps/dbdelve.png"
rm -f "$ICONS/${size}x${size}/apps/$SLUG.png"
done
refresh
# Connections, query history and saved passwords are deliberately left: an
# uninstall here is usually a reinstall, and they live outside all of this.
echo "removed dbdelve -- data in ~/.local/share/dbdelve was left alone"
echo "removed $SLUG -- data in ~/.local/share/$SLUG was left alone"
exit 0
fi

Expand All @@ -65,7 +72,7 @@ mkdir -p "$BIN" "$APPS" "$PLUGINS"
# still staged, or no bridge in place, the commit had not finished and the
# backup is the installed bridge; otherwise it had, and the backup is spare.
if [[ -d "$BACKUP" ]]; then
if [[ -e "$BIN/.dbdelve.new" || ! -e "$PLUGINS/odbc" ]]; then
if [[ -e "$BIN/.$SLUG.new" || ! -e "$PLUGINS/odbc" ]]; then
rm -rf "$PLUGINS/odbc"
mv "$BACKUP" "$PLUGINS/odbc"
else
Expand All @@ -89,12 +96,12 @@ roll_back() {
mv "$BACKUP" "$PLUGINS/odbc"
fi
fi
rm -rf "$BIN/.dbdelve.new" "$STAGED"
rm -rf "$BIN/.$SLUG.new" "$STAGED"
}
trap roll_back EXIT
trap 'exit 1' HUP INT TERM
rm -rf "$BIN/.dbdelve.new" "$STAGED"
install -m 755 "$HERE/dbdelve" "$BIN/.dbdelve.new"
rm -rf "$BIN/.$SLUG.new" "$STAGED"
install -m 755 "$HERE/$SLUG" "$BIN/.$SLUG.new"
cp -R "$HERE/plugins/odbc" "$STAGED"
# Ignored while only renames run, so a signal cannot land between a rename and
# the flag that records it and leave roll_back undoing the wrong step.
Expand All @@ -105,24 +112,24 @@ if [[ -e "$PLUGINS/odbc" || -L "$PLUGINS/odbc" ]]; then
fi
mv "$STAGED" "$PLUGINS/odbc"
swapped=1
mv -f "$BIN/.dbdelve.new" "$BIN/dbdelve"
mv -f "$BIN/.$SLUG.new" "$BIN/$SLUG"
committed=1
rm -rf "$BACKUP"
trap 'exit 1' HUP INT TERM
# Exec gets the absolute path rather than the bare name the entry ships with:
# a desktop launches its entries with the session's PATH, and ~/.local/bin only
# joins that at login -- and only when it already existed. Bare `dbdelve` would
# leave the icon there and do nothing when clicked, until the next login.
sed "s|^Exec=dbdelve |Exec=$BIN/dbdelve |" "$HERE/dbdelve.desktop" > "$APPS/dbdelve.desktop"
chmod 644 "$APPS/dbdelve.desktop"
sed "s|^Exec=$SLUG |Exec=$BIN/$SLUG |" "$HERE/$SLUG.desktop" > "$APPS/$SLUG.desktop"
chmod 644 "$APPS/$SLUG.desktop"
for size in "${SIZES[@]}"; do
mkdir -p "$ICONS/${size}x${size}/apps"
install -m 644 "$HERE/icons/dbdelve-$size.png" "$ICONS/${size}x${size}/apps/dbdelve.png"
install -m 644 "$HERE/icons/$SLUG-$size.png" "$ICONS/${size}x${size}/apps/$SLUG.png"
done
refresh

echo "installed $BIN/dbdelve"
echo "installed $BIN/$SLUG"
case ":$PATH:" in
*":$BIN:"*) ;;
*) echo "note: $BIN is not on your PATH, so running dbdelve from a terminal needs a new login -- the menu entry works now regardless" >&2 ;;
*) echo "note: $BIN is not on your PATH, so running $SLUG from a terminal needs a new login -- the menu entry works now regardless" >&2 ;;
esac
Binary file added assets/macos/DBDelve-Nightly.icns
Binary file not shown.
Binary file added assets/windows/dbdelve-nightly.ico
Binary file not shown.
22 changes: 19 additions & 3 deletions assets/windows/dbdelve.iss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
; StageDir the staged zip directory (absolute)
; OutputDir where the setup exe is written
; OutputBase filename without .exe
;
; Optional:
; Nightly builds DBDelve Nightly's installer: its own AppId, name,
; folder, Start Menu entry and icon, so it installs beside
; stable and neither upgrades over the other. Its data is in
; %APPDATA%\dbdelve-nightly. The exe is dbdelve.exe in both.

#ifndef MyAppVersion
#error MyAppVersion must be defined (/DMyAppVersion=...)
Expand All @@ -49,13 +55,23 @@
#error OutputBase must be defined (/DOutputBase=...)
#endif

#define MyAppName "DBDelve"
#ifdef Nightly
#define MyAppName "DBDelve Nightly"
#define MyAppIcon "dbdelve-nightly.ico"
#else
#define MyAppName "DBDelve"
#define MyAppIcon "dbdelve.ico"
#endif
#define MyAppPublisher "Shayan Abbas"
#define MyAppURL "https://github.com/ShayanAbbas1/dbdelve"
#define MyAppExeName "dbdelve.exe"

[Setup]
#ifdef Nightly
AppId={{221ADDEE-C041-4E6A-A2E9-72E92DF71DCF}
#else
AppId={{300CEAF2-D7A2-4D97-B94B-20ED16631AF4}
#endif
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
Expand All @@ -69,7 +85,7 @@ AllowNoIcons=yes
LicenseFile={#StageDir}\LICENSE
OutputDir={#OutputDir}
OutputBaseFilename={#OutputBase}
SetupIconFile={#SourcePath}dbdelve.ico
SetupIconFile={#SourcePath}{#MyAppIcon}
Compression=lzma2
SolidCompression=yes
WizardStyle=modern
Expand All @@ -93,7 +109,7 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
; Files when elevated and %LOCALAPPDATA%\Programs when not; the labels have
; to say that, or the dialog only talks about "users".
PrivilegesRequiredOverrideTitle=Choose install location
PrivilegesRequiredOverrideInstruction=Where should DBDelve be installed?
PrivilegesRequiredOverrideInstruction=Where should {#MyAppName} be installed?
PrivilegesRequiredOverrideCurrentUser=&Just for me (AppData, no administrator)
PrivilegesRequiredOverrideCurrentUserRecommended=&Just for me (AppData, no administrator) [recommended]
PrivilegesRequiredOverrideAllUsers=&All users (Program Files, requires administrator)
Expand Down
10 changes: 8 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@

fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-env-changed=DBDELVE_CHANNEL");
println!("cargo:rerun-if-env-changed=DBDELVE_VERSION");

#[cfg(target_os = "windows")]
{
println!("cargo:rerun-if-changed=assets/windows/dbdelve.ico");
let icon = match std::env::var("DBDELVE_CHANNEL").as_deref() {
Ok("nightly") => "assets/windows/dbdelve-nightly.ico",
_ => "assets/windows/dbdelve.ico",
};
println!("cargo:rerun-if-changed={icon}");
let mut resource = winresource::WindowsResource::new();
resource.set_icon("assets/windows/dbdelve.ico");
resource.set_icon(icon);
resource
.compile()
.unwrap_or_else(|error| panic!("could not embed the Windows icon: {error}"));
Expand Down
34 changes: 27 additions & 7 deletions dev/bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
# Dev by default: its own bundle id, its own name, its own profiles and its own
# Keychain items, run from the build tree and never installed, so a build can
# neither replace the released app nor touch what it has saved.
# DBDELVE_CHANNEL=release builds the app the release workflow ships.
# DBDELVE_CHANNEL=release builds the app the release workflow ships, and
# DBDELVE_CHANNEL=nightly builds DBDelve Nightly, a separate app with its own
# name, id and icon. DBDELVE_VERSION overrides Cargo.toml's version; only the
# nightly build sets it.
#
# DBDELVE_FEATURES passes cargo features to the app's build (update-test-hooks
# for an end-to-end test of the updater), and DBDELVE_NO_LAUNCH=1 builds the
Expand All @@ -17,8 +20,17 @@ set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"

VERSION="$(grep -m1 '^version' Cargo.toml | cut -d'"' -f2)"
VERSION="${DBDELVE_VERSION:-$(grep -m1 '^version' Cargo.toml | cut -d'"' -f2)}"
# CFBundleVersion takes period-separated integers only, so a nightly's
# 0.7.4-nightly.20261116.12 is 20261116.12 there: the date and the run, which
# only ever grow from one nightly to the next. CFBundleShortVersionString keeps
# the whole version, which is what the updater checks a download against.
BUILD="$VERSION"
if [[ "$VERSION" == *-nightly.* ]]; then
BUILD="${VERSION#*-nightly.}"
fi
CHANNEL="${DBDELVE_CHANNEL:-dev}"
ICON="DBDelve"

if [[ "$CHANNEL" == release ]]; then
APP="target/DBDelve.app"
Expand All @@ -29,6 +41,14 @@ if [[ "$CHANNEL" == release ]]; then
# after its executable, not after CFBundleName.
NAME="DBDelve"
ENVIRONMENT=""
elif [[ "$CHANNEL" == nightly ]]; then
# The binary knows its channel from DBDELVE_CHANNEL at compile time, so no
# LSEnvironment: the build below inherits it from this shell.
APP="target/macos-nightly/DBDelve Nightly.app"
IDENTIFIER="com.shayanabbas.dbdelve.nightly"
NAME="DBDelve Nightly"
ICON="DBDelve-Nightly"
ENVIRONMENT=""
else
APP="target/macos-dev/DBDelve Dev.app"
IDENTIFIER="com.shayanabbas.dbdelve.dev"
Expand Down Expand Up @@ -61,7 +81,7 @@ dev/plugins.sh --release
rm -rf "$APP"
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources/plugins/odbc" "$APP/Contents/Helpers"

cp assets/macos/DBDelve.icns "$APP/Contents/Resources/DBDelve.icns"
cp "assets/macos/$ICON.icns" "$APP/Contents/Resources/$ICON.icns"
cp target/release/dbdelve "$APP/Contents/MacOS/$NAME"

# The OFL asks that the licence travel with the fonts, and the fonts are
Expand Down Expand Up @@ -107,10 +127,10 @@ cat > "$APP/Contents/Info.plist" <<PLIST
<key>CFBundleDisplayName</key><string>${NAME}</string>
<key>CFBundleIdentifier</key><string>${IDENTIFIER}</string>
<key>CFBundleExecutable</key><string>${NAME}</string>
<key>CFBundleIconFile</key><string>DBDelve</string>
<key>CFBundleIconFile</key><string>${ICON}</string>
<key>CFBundlePackageType</key><string>APPL</string>
<key>CFBundleShortVersionString</key><string>${VERSION}</string>
<key>CFBundleVersion</key><string>${VERSION}</string>
<key>CFBundleVersion</key><string>${BUILD}</string>
<key>CFBundleInfoDictionaryVersion</key><string>6.0</string>
<key>LSMinimumSystemVersion</key><string>12.0</string>
<key>LSApplicationCategoryType</key><string>public.app-category.developer-tools</string>
Expand Down Expand Up @@ -146,10 +166,10 @@ codesign --force --sign "${DBDELVE_SIGN_ID:--}" --identifier "$IDENTIFIER.odbc"
codesign --force --sign "${DBDELVE_SIGN_ID:--}" --identifier "$IDENTIFIER" "$APP"
codesign --verify --deep --strict "$APP"

# Neither variant installs. The release reaches /Applications by the DMG's
# No variant installs. Release and nightly reach /Applications by the DMG's
# drag-to-install, and the dev app runs where it was built so it can never be
# mistaken for -- or dropped over -- the real one.
if [[ "$CHANNEL" == release || "${DBDELVE_NO_LAUNCH:-}" == 1 ]]; then
if [[ "$CHANNEL" == release || "$CHANNEL" == nightly || "${DBDELVE_NO_LAUNCH:-}" == 1 ]]; then
echo "built $APP (v$VERSION)"
exit 0
fi
Expand Down
40 changes: 25 additions & 15 deletions dev/icon.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/env bash
#
# Renders assets/icon/dbdelve.svg into every platform's icon: the macOS .icns,
# the Windows .ico and the Linux PNGs. The outputs are committed so building
# and packaging never need an SVG renderer -- run this after changing the SVG.
# Renders each channel's SVG into every platform's icon: the macOS .icns, the
# Windows .ico and the Linux PNGs. assets/icon/dbdelve.svg is stable's and
# assets/icon/dbdelve-nightly.svg is Nightly's. The outputs are committed so
# building and packaging never need an SVG renderer -- run this after changing
# either SVG.
#
# Needs resvg and ImageMagick: brew install resvg imagemagick
#
Expand All @@ -12,21 +14,29 @@ set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"

SVG=assets/icon/dbdelve.svg
TMP="$(mktemp -d)"
trap 'rm -rf "$TMP"' EXIT

render() { resvg -w "$1" -h "$1" "$SVG" "$2"; }
# $1 is the slug the Linux and Windows files are named after, $2 the name of
# the macOS .icns.
icons() {
local slug="$1" icns="$2"
local svg="assets/icon/$slug.svg"
render() { resvg -w "$1" -h "$1" "$svg" "$2"; }

for SIZE in 16 32 64 128 256 512; do
render "$SIZE" "assets/linux/icons/dbdelve-$SIZE.png"
done
for SIZE in 16 32 64 128 256 512; do
render "$SIZE" "assets/linux/icons/$slug-$SIZE.png"
done

mkdir "$TMP/DBDelve.iconset"
for SIZE in 16 32 128 256 512; do
render "$SIZE" "$TMP/DBDelve.iconset/icon_${SIZE}x${SIZE}.png"
render "$((SIZE * 2))" "$TMP/DBDelve.iconset/icon_${SIZE}x${SIZE}@2x.png"
done
iconutil -c icns "$TMP/DBDelve.iconset" -o assets/macos/DBDelve.icns
mkdir "$TMP/$icns.iconset"
for SIZE in 16 32 128 256 512; do
render "$SIZE" "$TMP/$icns.iconset/icon_${SIZE}x${SIZE}.png"
render "$((SIZE * 2))" "$TMP/$icns.iconset/icon_${SIZE}x${SIZE}@2x.png"
done
iconutil -c icns "$TMP/$icns.iconset" -o "assets/macos/$icns.icns"

magick assets/linux/icons/dbdelve-{16,32,64,128,256}.png assets/windows/dbdelve.ico
magick "assets/linux/icons/$slug"-{16,32,64,128,256}.png "assets/windows/$slug.ico"
}

icons dbdelve DBDelve
icons dbdelve-nightly DBDelve-Nightly
44 changes: 44 additions & 0 deletions dev/linux-channel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Sourced by dev/package-linux.sh and dev/package-appimage.sh: the version and
# the names the Linux packages carry for the channel being built.
#
# DBDELVE_CHANNEL=nightly packages DBDelve Nightly under the slug
# dbdelve-nightly, which names its binary, desktop entry, icons and assets, so
# it installs beside stable rather than over it. Anything else is stable, under
# dbdelve.

# The variables are read by the scripts that source this.
# shellcheck shell=bash disable=SC2034

VERSION="${DBDELVE_VERSION:-$(grep -m1 '^version' Cargo.toml | cut -d'"' -f2)}"
if [[ "${DBDELVE_CHANNEL:-}" == nightly ]]; then
SLUG=dbdelve-nightly
else
SLUG=dbdelve
fi
ICON_SIZES=(16 32 64 128 256 512)

# The channel's desktop entry, on stdout. Nightly's is stable's with every name
# swapped, and each swap is checked, so an edit to stable's entry cannot quietly
# leave Nightly launching or grouping under stable's names.
desktop_entry() {
local entry=assets/linux/dbdelve.desktop
if [[ "$SLUG" == dbdelve ]]; then
cat "$entry"
return
fi
local swapped
swapped="$(sed \
-e 's/^Name=DBDelve$/Name=DBDelve Nightly/' \
-e "s/^Exec=dbdelve /Exec=$SLUG /" \
-e "s/^Icon=dbdelve$/Icon=$SLUG/" \
-e "s/^StartupWMClass=dbdelve$/StartupWMClass=$SLUG/" \
"$entry")"
local line
for line in "Name=DBDelve Nightly" "Exec=$SLUG %f" "Icon=$SLUG" "StartupWMClass=$SLUG"; do
if ! grep -qxF "$line" <<<"$swapped"; then
echo "$entry changed shape: the nightly entry has no $line" >&2
return 1
fi
done
printf '%s\n' "$swapped"
}
Loading
Loading