Skip to content

Commit fc5689d

Browse files
authored
chore: use sqlite to store shared queries (#698)
* chore: use sqlite to store shared queries * chore: better error msg * chore: better error msg
1 parent 63d4e5c commit fc5689d

File tree

11 files changed

+96
-62
lines changed

11 files changed

+96
-62
lines changed

cli/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ serde = { version = "1.0", features = ["derive"] }
4040
serde_json = "1.0"
4141
sled = "0.34"
4242
sqlformat = "0.3.3"
43+
rusqlite = { version = "0.31", features = ["bundled"] }
44+
dirs = "5.0"
4345
tempfile = "3.19.1"
4446
terminal_size = "0.4"
4547
tokio = { version = "1.44.2", features = [

cli/frontend/build/404.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><meta charSet="utf-8"/><link rel="icon" href="/logo.svg"/><meta name="theme-color" content="#000000"/><link rel="preload" href="/_next/static/css/1eb6dde642ff683d.css" as="style"/><link rel="stylesheet" href="/_next/static/css/1eb6dde642ff683d.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/js/webpack.js" defer=""></script><script src="/_next/static/js/framework.js" defer=""></script><script src="/_next/static/js/vendor.js" defer=""></script><script src="/_next/static/js/main.js" defer=""></script><script src="/_next/static/js/pages/_app.js" defer=""></script><script src="/_next/static/js/pages/_error.js" defer=""></script><script src="/_next/static/stable-build-id/_buildManifest.js" defer=""></script><script src="/_next/static/stable-build-id/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div class="flex h-screen bg-gray-200"><div class="bg-white border-r border-gray-200 transition-all duration-300 w-32"><div class="p-4 border-b"><div class="flex items-center justify-between"><h1 class="text-lg font-bold text-gray-800">BendSQL</h1><button class="p-1 rounded hover:bg-gray-100 transition-colors" title="Collapse sidebar"></button></div></div><nav class="p-2"><a class="flex items-center p-3 rounded-lg mb-1 transition-colors text-gray-600 hover:bg-gray-50" href="/"><span class="text-lg">📊</span><span class="ml-3 font-medium">Query</span></a><a class="flex items-center p-3 rounded-lg mb-1 transition-colors text-gray-600 hover:bg-gray-50" href="/perf/0"><span class="text-lg"></span><span class="ml-3 font-medium">Perf</span></a></nav></div><div class="flex-1 flex flex-col overflow-hidden"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">This page could not be found<!-- -->.</h2></div></div></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"stable-build-id","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1+
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><meta charSet="utf-8"/><link rel="icon" href="/logo.svg"/><meta name="theme-color" content="#000000"/><link rel="preload" href="/_next/static/css/9d505a4476207006.css" as="style"/><link rel="stylesheet" href="/_next/static/css/9d505a4476207006.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/js/webpack.js" defer=""></script><script src="/_next/static/js/framework.js" defer=""></script><script src="/_next/static/js/vendor.js" defer=""></script><script src="/_next/static/js/main.js" defer=""></script><script src="/_next/static/js/pages/_app.js" defer=""></script><script src="/_next/static/js/pages/_error.js" defer=""></script><script src="/_next/static/stable-build-id/_buildManifest.js" defer=""></script><script src="/_next/static/stable-build-id/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div class="flex h-screen bg-gray-200"><div class="bg-white border-r border-gray-200 transition-all duration-300 w-32"><div class="p-4 border-b"><div class="flex items-center justify-between"><h1 class="text-lg font-bold text-gray-800">BendSQL</h1><button class="p-1 rounded hover:bg-gray-100 transition-colors" title="Collapse sidebar"></button></div></div><nav class="p-2"><a class="flex items-center p-3 rounded-lg mb-1 transition-colors text-gray-600 hover:bg-gray-50" href="/"><span class="text-lg">📊</span><span class="ml-3 font-medium">Query</span></a><a class="flex items-center p-3 rounded-lg mb-1 transition-colors text-gray-600 hover:bg-gray-50" href="/perf/0"><span class="text-lg"></span><span class="ml-3 font-medium">Perf</span></a></nav></div><div class="flex-1 flex flex-col overflow-hidden"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">This page could not be found<!-- -->.</h2></div></div></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"stable-build-id","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>

cli/frontend/build/[...slug].html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>Databend</title><meta name="next-head-count" content="3"/><meta charSet="utf-8"/><link rel="icon" href="/logo.svg"/><meta name="theme-color" content="#000000"/><link rel="preload" href="/_next/static/css/1eb6dde642ff683d.css" as="style"/><link rel="stylesheet" href="/_next/static/css/1eb6dde642ff683d.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/js/webpack.js" defer=""></script><script src="/_next/static/js/framework.js" defer=""></script><script src="/_next/static/js/vendor.js" defer=""></script><script src="/_next/static/js/main.js" defer=""></script><script src="/_next/static/js/pages/_app.js" defer=""></script><script src="/_next/static/js/0ba37d83.js" defer=""></script><script src="/_next/static/js/pages/%5B...slug%5D.js" defer=""></script><script src="/_next/static/stable-build-id/_buildManifest.js" defer=""></script><script src="/_next/static/stable-build-id/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div class="flex h-screen bg-gray-200"><div class="bg-white border-r border-gray-200 transition-all duration-300 w-32"><div class="p-4 border-b"><div class="flex items-center justify-between"><h1 class="text-lg font-bold text-gray-800">BendSQL</h1><button class="p-1 rounded hover:bg-gray-100 transition-colors" title="Collapse sidebar"></button></div></div><nav class="p-2"><a class="flex items-center p-3 rounded-lg mb-1 transition-colors text-gray-600 hover:bg-gray-50" href="/"><span class="text-lg">📊</span><span class="ml-3 font-medium">Query</span></a><a class="flex items-center p-3 rounded-lg mb-1 transition-colors text-gray-600 hover:bg-gray-50" href="/perf/0"><span class="text-lg"></span><span class="ml-3 font-medium">Perf</span></a></nav></div><div class="flex-1 flex flex-col overflow-hidden"><div class="h-full bg-gray-100"><div class="bg-yellow-400 px-4 py-2 flex items-center justify-between"><div class="flex items-center gap-4"><span class="font-bold">SQL Query</span><button class="bg-indigo-600 hover:bg-indigo-700 disabled:opacity-60 disabled:cursor-not-allowed text-white px-4 py-1.5 rounded-md flex items-center gap-2 text-sm">▶ RUN QUERY</button></div></div><div class="h-[calc(100vh-48px)] border border-gray-300"><div class="h-full" style="display:flex;flex-direction:row;height:100%;overflow:hidden;width:100%" data-panel-group="" data-panel-group-direction="horizontal" data-panel-group-id=":Rl6:"><div class="h-full" id=":R3l6:" style="flex-basis:0;flex-grow:50.000;flex-shrink:1;overflow:hidden" data-panel-group-id=":Rl6:" data-panel="" data-panel-id=":R3l6:" data-panel-size="50.0"><div class="h-full border-r border-gray-300 relative"><div class="cm-theme" style="height:100%;font-size:14px"></div></div></div><div class="w-1 bg-gray-300 hover:bg-gray-400 cursor-col-resize" role="separator" style="touch-action:none;user-select:none" tabindex="0" data-panel-group-direction="horizontal" data-panel-group-id=":Rl6:" data-resize-handle="" data-panel-resize-handle-enabled="true" data-panel-resize-handle-id=":R5l6:" data-resize-handle-state="inactive"></div><div class="h-full" id=":R7l6:" style="flex-basis:0;flex-grow:50.000;flex-shrink:1;overflow:hidden" data-panel-group-id=":Rl6:" data-panel="" data-panel-id=":R7l6:" data-panel-size="50.0"><div class="h-full overflow-auto bg-white relative"><div class="p-2 h-full"><div class="flex items-center justify-center h-full text-gray-500">Execute a query to see results</div></div></div></div></div></div></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/[...slug]","query":{},"buildId":"stable-build-id","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
1+
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>Databend</title><meta name="next-head-count" content="3"/><meta charSet="utf-8"/><link rel="icon" href="/logo.svg"/><meta name="theme-color" content="#000000"/><link rel="preload" href="/_next/static/css/9d505a4476207006.css" as="style"/><link rel="stylesheet" href="/_next/static/css/9d505a4476207006.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/js/webpack.js" defer=""></script><script src="/_next/static/js/framework.js" defer=""></script><script src="/_next/static/js/vendor.js" defer=""></script><script src="/_next/static/js/main.js" defer=""></script><script src="/_next/static/js/pages/_app.js" defer=""></script><script src="/_next/static/js/0ba37d83.js" defer=""></script><script src="/_next/static/js/pages/%5B...slug%5D.js" defer=""></script><script src="/_next/static/stable-build-id/_buildManifest.js" defer=""></script><script src="/_next/static/stable-build-id/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div class="flex h-screen bg-gray-200"><div class="bg-white border-r border-gray-200 transition-all duration-300 w-32"><div class="p-4 border-b"><div class="flex items-center justify-between"><h1 class="text-lg font-bold text-gray-800">BendSQL</h1><button class="p-1 rounded hover:bg-gray-100 transition-colors" title="Collapse sidebar"></button></div></div><nav class="p-2"><a class="flex items-center p-3 rounded-lg mb-1 transition-colors text-gray-600 hover:bg-gray-50" href="/"><span class="text-lg">📊</span><span class="ml-3 font-medium">Query</span></a><a class="flex items-center p-3 rounded-lg mb-1 transition-colors text-gray-600 hover:bg-gray-50" href="/perf/0"><span class="text-lg"></span><span class="ml-3 font-medium">Perf</span></a></nav></div><div class="flex-1 flex flex-col overflow-hidden"><div class="h-full bg-gray-100"><div class="bg-yellow-400 px-4 py-2 flex items-center justify-between"><div class="flex items-center gap-4"><span class="font-bold">SQL Query</span><button class="bg-indigo-600 hover:bg-indigo-700 disabled:opacity-60 disabled:cursor-not-allowed text-white px-4 py-1.5 rounded-md flex items-center gap-2 text-sm">▶ RUN QUERY</button></div></div><div class="h-[calc(100vh-48px)] border border-gray-300"><div class="h-full" style="display:flex;flex-direction:row;height:100%;overflow:hidden;width:100%" data-panel-group="" data-panel-group-direction="horizontal" data-panel-group-id=":Rl6:"><div class="h-full" id=":R3l6:" style="flex-basis:0;flex-grow:50.000;flex-shrink:1;overflow:hidden" data-panel-group-id=":Rl6:" data-panel="" data-panel-id=":R3l6:" data-panel-size="50.0"><div class="h-full border-r border-gray-300 relative"><div class="cm-theme" style="height:100%;font-size:14px"></div></div></div><div class="w-1 bg-gray-300 hover:bg-gray-400 cursor-col-resize" role="separator" style="touch-action:none;user-select:none" tabindex="0" data-panel-group-direction="horizontal" data-panel-group-id=":Rl6:" data-resize-handle="" data-panel-resize-handle-enabled="true" data-panel-resize-handle-id=":R5l6:" data-resize-handle-state="inactive"></div><div class="h-full" id=":R7l6:" style="flex-basis:0;flex-grow:50.000;flex-shrink:1;overflow:hidden" data-panel-group-id=":Rl6:" data-panel="" data-panel-id=":R7l6:" data-panel-size="50.0"><div class="h-full overflow-auto bg-white relative"><div class="p-2 h-full"><div class="flex items-center justify-center h-full text-gray-500">Execute a query to see results</div></div></div></div></div></div></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/[...slug]","query":{},"buildId":"stable-build-id","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>

0 commit comments

Comments
 (0)