Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
d327556
fix(process-directory): add option to change working directory for su…
franklinfollis Nov 26, 2025
9ba7766
test(process-directory): custom working directory tests for ProcessRu…
franklinfollis Nov 26, 2025
a7028da
fix(process-directory): update api pins
franklinfollis Nov 27, 2025
a57dfdc
initial skeleton for db studio command
franklinfollis Oct 17, 2025
38ce3f7
feat(database-ui): have `elide db studio` be a simple wrapper around …
franklinfollis Oct 21, 2025
8d35ca8
feat(database-ui): have db studio init a react ssr template for studi…
franklinfollis Oct 25, 2025
3b693db
feat(database-ui): discover db files on disk and select between them
franklinfollis Oct 26, 2025
a3cb0fd
feat(database-ui): static react app calling on database json api
franklinfollis Oct 28, 2025
60af3e2
feat(database-ui): consolidate api and ui for db studio into one folder
franklinfollis Oct 29, 2025
b28ebf5
feat(database-ui): add shadcn and tailwind to studio frontend
franklinfollis Oct 29, 2025
3e07ad1
feat(database-ui): standardize json api paths
franklinfollis Oct 29, 2025
87d705b
feat(database-ui): denote columns that are primary keys in tables
franklinfollis Oct 31, 2025
7ab6aaa
fix(database-ui): add primaryKeys to TableData type
franklinfollis Oct 31, 2025
90357e0
fix(database-ui): move built db studio code under .dev
franklinfollis Nov 4, 2025
59bbf9c
fix(database-ui): use new elide http server
franklinfollis Nov 10, 2025
bd8e27c
feat(database-ui): cleanup server.ts
franklinfollis Nov 10, 2025
12692cb
fix(database-ui): use byte length for content length header
franklinfollis Nov 10, 2025
5115d59
feat(database-ui): provide directory as well as db file path for data…
franklinfollis Nov 10, 2025
d9bf65d
feat(database-ui): use code mirror for query editor
franklinfollis Nov 11, 2025
1be1d67
feat(database-ui): move db-studio src out of samples
franklinfollis Nov 11, 2025
9902a2a
feat(database-ui): setup elide.pkl manifest for api
franklinfollis Nov 12, 2025
d7a458c
feat(database-ui): spread server routes and handlers out to separate …
franklinfollis Nov 12, 2025
f088e25
feat(database-ui): add tsconfig to resolve elide:sqlite types
franklinfollis Nov 12, 2025
8623e10
chore(database-ui): cleanup responses and router code
franklinfollis Nov 12, 2025
0c3e488
feat(database-ui): format null values in table
franklinfollis Nov 17, 2025
c7057fe
feat(database-ui): escape table names with spaces in them
franklinfollis Nov 17, 2025
5a4803e
feat(database-ui): use tanstack table for viewing query results
franklinfollis Nov 17, 2025
b37b5d9
feat(database-ui): show views from databases as well
franklinfollis Nov 17, 2025
65952c0
feat(database-ui): refactor api response to include query metadata
franklinfollis Nov 17, 2025
fe7a614
feat(database-ui): update query hooks to use new format
franklinfollis Nov 17, 2025
9219a4c
feat(database-ui): show detailed column info on hover
franklinfollis Nov 17, 2025
0fa0de5
feat(database-ui): add support for views
franklinfollis Nov 17, 2025
94f0e77
chore(database-ui): clean up context passed in routes
franklinfollis Nov 18, 2025
3eb4b8a
feat(database-ui): use limit and offset as query params for pagination
franklinfollis Nov 18, 2025
6ec31d1
fix(database-ui): fix up loading state for rows when changing offset
franklinfollis Nov 18, 2025
7c4e89b
fix(database-ui): highlight selected table in sidebar
franklinfollis Nov 18, 2025
2f607cf
feat(database-ui): sticky toolbar and column headers
franklinfollis Nov 18, 2025
143ddef
chore(database-ui): prettierrc
franklinfollis Nov 18, 2025
a2ed91b
fix(database-ui): show key info first on column description
franklinfollis Nov 18, 2025
a598e66
feat(database-ui): add props for hiding tools in data table
franklinfollis Nov 18, 2025
d56cb87
feat(database-ui): send sort column and direction as url parameter
franklinfollis Nov 18, 2025
a6f152b
feat(database-ui): Move table name to toolbar
franklinfollis Nov 18, 2025
840c23b
feat(database-ui): add filtering for data table
franklinfollis Nov 18, 2025
da376d7
feat(database-ui): show active where and column filters
franklinfollis Nov 18, 2025
2600d73
feat(database-ui): add refresh handler for table data
franklinfollis Nov 18, 2025
44e0a54
refactor(database-ui): separate components out of data table
franklinfollis Nov 18, 2025
e2f4988
feat(database-ui): move contents of navbar to sidebar
franklinfollis Nov 19, 2025
581edb9
fix(database-ui): remove memo on DataTableGrid
franklinfollis Nov 19, 2025
9bb6d24
feat(database-ui): create provider for DataTable
franklinfollis Nov 19, 2025
db44993
fix(database-ui): various lint fix ups
franklinfollis Nov 24, 2025
2ee0b53
feat(database-ui): add resizable panels
franklinfollis Nov 24, 2025
e76b9a4
feat(database-ui): standardize theme for ui
franklinfollis Nov 24, 2025
3441723
feat(database-ui): simplify theme
franklinfollis Nov 24, 2025
cd48284
fix(database-ui): fix stale state in columns dropdown
franklinfollis Nov 24, 2025
ebb4ea0
feat(database-ui): functionality for deleting rows
franklinfollis Nov 25, 2025
cfc779f
feat(database-ui): use zod for parsing responses
franklinfollis Nov 25, 2025
803a2fd
feat(database-ui): call sub tasks within db studio command
franklinfollis Nov 26, 2025
bf7a6c9
fix(database-ui): run elide build and install before running api server
franklinfollis Nov 28, 2025
b431294
fix(database-ui): exclude .dev in prepareDbStudio task
franklinfollis Nov 28, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.dev/dependencies
.dev/coverage
.dev/artifacts
.dev/db-studio
*/.dev/artifacts
*/.dev/coverage
*/.dev/dependencies
Expand Down
8 changes: 5 additions & 3 deletions packages/builder/api/builder.api
Original file line number Diff line number Diff line change
Expand Up @@ -2704,14 +2704,16 @@ public final class elide/tooling/runner/ProcessRunner {
}

public final class elide/tooling/runner/ProcessRunner$ProcessOptions : java/lang/Record {
public fun <init> (Lelide/tooling/runner/ProcessRunner$ProcessShell;)V
public fun <init> (Lelide/tooling/runner/ProcessRunner$ProcessShell;Ljava/nio/file/Path;)V
public final fun component1 ()Lelide/tooling/runner/ProcessRunner$ProcessShell;
public final fun copy (Lelide/tooling/runner/ProcessRunner$ProcessShell;)Lelide/tooling/runner/ProcessRunner$ProcessOptions;
public static synthetic fun copy$default (Lelide/tooling/runner/ProcessRunner$ProcessOptions;Lelide/tooling/runner/ProcessRunner$ProcessShell;ILjava/lang/Object;)Lelide/tooling/runner/ProcessRunner$ProcessOptions;
public final fun component2 ()Ljava/nio/file/Path;
public final fun copy (Lelide/tooling/runner/ProcessRunner$ProcessShell;Ljava/nio/file/Path;)Lelide/tooling/runner/ProcessRunner$ProcessOptions;
public static synthetic fun copy$default (Lelide/tooling/runner/ProcessRunner$ProcessOptions;Lelide/tooling/runner/ProcessRunner$ProcessShell;Ljava/nio/file/Path;ILjava/lang/Object;)Lelide/tooling/runner/ProcessRunner$ProcessOptions;
public fun equals (Ljava/lang/Object;)Z
public fun hashCode ()I
public final fun shell ()Lelide/tooling/runner/ProcessRunner$ProcessShell;
public fun toString ()Ljava/lang/String;
public final fun workingDirectory ()Ljava/nio/file/Path;
}

public abstract interface class elide/tooling/runner/ProcessRunner$ProcessShell {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public object ProcessRunner {
*/
@JvmRecord public data class ProcessOptions(
public val shell: ProcessShell,
public val workingDirectory: Path,
)

/**
Expand Down Expand Up @@ -128,6 +129,9 @@ public object ProcessRunner {
}
}
val procBuilder = ProcessBuilder(resolvedArgs).apply {
// handle working directory
directory(task.options.workingDirectory.toFile())

// handle task environment
when (task.env) {
// inject host environment
Expand Down Expand Up @@ -185,7 +189,10 @@ public object ProcessRunner {
val mutEnv = env.toMutable()
var executablePath: Path = exec
var effectiveStreams: StdStreams = streams ?: StdStreams.Defaults
var effectiveOptions: ProcessOptions = options ?: ProcessOptions(ProcessShell.None)
var effectiveOptions: ProcessOptions = options ?: ProcessOptions(
shell = ProcessShell.None,
workingDirectory = Path.of(System.getProperty("user.dir")),
)

return object : ProcessTaskBuilder {
override var executable: Path = executablePath
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/*
* Copyright (c) 2024-2025 Elide Technologies, Inc.
*
* Licensed under the MIT license (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* https://opensource.org/license/mit/
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under the License.
*/
package elide.tooling.runner

import java.nio.file.Path
import kotlin.test.*
import elide.tooling.runner.ProcessRunner.ProcessOptions
import elide.tooling.runner.ProcessRunner.ProcessShell

class ProcessRunnerTest {
@Test fun `ProcessOptions should allow specifying a custom working directory`() {
val customDir = Path.of("/tmp")
val options = ProcessOptions(
shell = ProcessShell.None,
workingDirectory = customDir,
)

assertEquals(customDir, options.workingDirectory)
}

@Test fun `ProcessRunner build should accept a custom working directory`() {
val customDir = Path.of("/tmp")
val exec = Path.of("/bin/ls")

val builder = ProcessRunner.build(exec) {
options = ProcessOptions(
shell = ProcessShell.None,
workingDirectory = customDir,
)
}

assertEquals(customDir, builder.options.workingDirectory)
assertEquals(exec, builder.executable)
}

@Test fun `ProcessRunner build should allow changing the working directory after building`() {
val initialDir = Path.of("/tmp")
val newDir = Path.of("/var")
val exec = Path.of("/bin/echo")

val builder = ProcessRunner.build(exec) {
options = ProcessOptions(
shell = ProcessShell.None,
workingDirectory = initialDir,
)
}

assertEquals(initialDir, builder.options.workingDirectory)

// Change the working directory
builder.options = ProcessOptions(
shell = ProcessShell.None,
workingDirectory = newDir,
)

assertEquals(newDir, builder.options.workingDirectory)
}

@Test fun `ProcessRunner buildFrom should use current working directory by default`() {
val exec = Path.of("/bin/echo")
val args = elide.tooling.Arguments.empty()
val env = elide.tooling.Environment.empty()

val builder = ProcessRunner.buildFrom(exec, args, env)

assertNotNull(builder.options.workingDirectory)
assertEquals(Path.of(System.getProperty("user.dir")), builder.options.workingDirectory)
}

@Test fun `ProcessRunner buildFrom should accept custom working directory`() {
val exec = Path.of("/bin/echo")
val args = elide.tooling.Arguments.empty()
val env = elide.tooling.Environment.empty()
val customDir = Path.of("/tmp")
val customOptions = ProcessOptions(
shell = ProcessShell.None,
workingDirectory = customDir,
)

val builder = ProcessRunner.buildFrom(exec, args, env, options = customOptions)

assertEquals(customDir, builder.options.workingDirectory)
}
}
22 changes: 21 additions & 1 deletion packages/cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2414,7 +2414,7 @@ tasks {
val allSamples = layout.projectDirectory.dir("src/projects")
.asFile
.listFiles()
.filter { it.isDirectory() }
.filter { it.isDirectory() && it.name != "db-studio" }
.map { it.toPath() to it.name }

val builtSamples = layout.buildDirectory.dir("packed-samples")
Expand All @@ -2436,10 +2436,30 @@ tasks {
dependsOn(allSamplePackTasks)
}

val prepareDbStudioResources by registering(Copy::class) {
group = "build"
description = "Prepare Database Studio resources for embedding in CLI"

// Copy API files
from(layout.projectDirectory.dir("src/db-studio/api")) {
into("api")
exclude("config.ts") // Generated at runtime with injected config
exclude(".dev/**") // Exclude development-only dependencies directory
}

// Copy built UI (dist/ folder only, not source or node_modules)
from(layout.projectDirectory.dir("src/db-studio/ui/dist")) {
into("ui")
}

into(layout.buildDirectory.dir("resources/main/META-INF/elide/db-studio"))
}

processResources {
dependsOn(
":packages:graalvm:buildRustNativesForHostDebug",
prepKotlinResources,
prepareDbStudioResources,
packSamples,
allSamplePackTasks,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "db-studio-api",
"version": "1.0.0",
"description": "Database Studio API Server",
"main": "index.ts",
"scripts": {},
"dependencies": {
"zod": "4"
},
"devDependencies": {
"@elide-dev/types": "1.0.0-beta10"
}
}
Binary file added packages/cli/src/db-studio/api/.dev/elide.lock.bin
Binary file not shown.
22 changes: 22 additions & 0 deletions packages/cli/src/db-studio/api/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import type { DiscoveredDatabase } from "./database.ts";

/**
* Database Studio Configuration
*
* This is a sample configuration file. In production, this would be
* generated by DbStudioCommand.kt based on discovered databases.
*/

const config = {
port: 4984,
databases: [
{
path: "./sample.db",
name: "sample.db",
size: 0,
lastModified: Date.now(),
}
] as DiscoveredDatabase[],
};

export default config;
Loading
Loading