mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-30 17:14:40 +08:00
refactor: rename db
This commit is contained in:
@@ -805,7 +805,7 @@ fn opencode_db_path() -> Result<PathBuf, &'static str> {
|
||||
}
|
||||
};
|
||||
|
||||
Ok(data_home.join("opencode").join("opencode.db"))
|
||||
Ok(data_home.join("kilo").join("kilo.db"))
|
||||
}
|
||||
|
||||
// Creates a `once` listener for the specified event and returns a future that resolves
|
||||
|
||||
@@ -5,6 +5,6 @@ export default defineConfig({
|
||||
schema: "./src/**/*.sql.ts",
|
||||
out: "./migration",
|
||||
dbCredentials: {
|
||||
url: "/home/thdxr/.local/share/opencode/opencode.db",
|
||||
url: "/home/thdxr/.local/share/kilo/kilo.db",
|
||||
},
|
||||
})
|
||||
|
||||
@@ -118,7 +118,7 @@ const cli = yargs(hideBin(process.argv))
|
||||
|
||||
Telemetry.trackCliStart()
|
||||
// kilocode_change end
|
||||
const marker = path.join(Global.Path.data, "opencode.db")
|
||||
const marker = path.join(Global.Path.data, "kilo.db")
|
||||
if (!(await Bun.file(marker).exists())) {
|
||||
console.log("Performing one time database migration, may take a few minutes...")
|
||||
const tty = process.stdout.isTTY
|
||||
|
||||
@@ -65,9 +65,9 @@ export namespace Database {
|
||||
}
|
||||
|
||||
export const Client = lazy(() => {
|
||||
log.info("opening database", { path: path.join(Global.Path.data, "opencode.db") })
|
||||
log.info("opening database", { path: path.join(Global.Path.data, "kilo.db") })
|
||||
|
||||
const sqlite = new BunDatabase(path.join(Global.Path.data, "opencode.db"), { create: true })
|
||||
const sqlite = new BunDatabase(path.join(Global.Path.data, "kilo.db"), { create: true })
|
||||
|
||||
sqlite.run("PRAGMA journal_mode = WAL")
|
||||
sqlite.run("PRAGMA synchronous = NORMAL")
|
||||
|
||||
@@ -34,6 +34,9 @@ const STRING_REPLACEMENTS: StringReplacement[] = [
|
||||
{ pattern: /\bnpm install opencode\b/g, replacement: "npm install @kilocode/cli" },
|
||||
{ pattern: /\bnpm i opencode\b/g, replacement: "npm i @kilocode/cli" },
|
||||
|
||||
// Database filename
|
||||
{ pattern: /\bopencode\.db\b/g, replacement: "kilo.db" },
|
||||
|
||||
// Binary name references (be careful with these)
|
||||
{ pattern: /\bopencode upgrade\b/g, replacement: "kilo upgrade" },
|
||||
|
||||
|
||||
@@ -89,6 +89,13 @@ const BRANDING_REPLACEMENTS: BrandingReplacement[] = [
|
||||
description: "upgrade command",
|
||||
},
|
||||
|
||||
// Database filename
|
||||
{
|
||||
pattern: /opencode\.db/g,
|
||||
replacement: "kilo.db",
|
||||
description: "Database filename",
|
||||
},
|
||||
|
||||
// Generic product name replacement (must come after specific patterns)
|
||||
// Only replace "OpenCode" when it's a standalone word
|
||||
{
|
||||
|
||||
@@ -109,6 +109,12 @@ const TAURI_REPLACEMENTS: TauriReplacement[] = [
|
||||
},
|
||||
|
||||
// Rust source specific
|
||||
{
|
||||
pattern: /opencode\.db/g,
|
||||
replacement: "kilo.db",
|
||||
description: "Database filename",
|
||||
fileTypes: [".rs"],
|
||||
},
|
||||
{
|
||||
pattern: /opencode\.settings\.dat/g,
|
||||
replacement: "kilo.settings.dat",
|
||||
|
||||
Reference in New Issue
Block a user