Skip to content

Conversation

@franklinfollis
Copy link
Collaborator

@franklinfollis franklinfollis commented Oct 17, 2025

Draft Powered by Pull Request Badge

Summary

This PR adds the command db studio, which launches a web-based database management UI that runs entirely on the Elide runtime. It provides a modern interface for viewing and editing databases with support for CRUD operations, schema management, and SQL queries. For now, it only works with SQLite, via Elide's SQLite bindings.

Usage

# Automatic discovery - finds all [.db|.db3|.sqlite|.sqlite3] files in current and immediate directories
elide db studio

# Specific directory
elide db studio path/to/my/databases/

# Specific database
elide db studio path/to/database.db

# Opens browser to http://localhost:8080 with UI

What it does:

  • Extracts all necessary files under .dev/db-studio/ on first run.
  • Launches two servers:
    • API server (port 4984): TypeScript REST API using elide:sqlite
    • UI server (port 8080): React frontend served as static files

Architecture

  • Backend: TypeScript REST API with custom HTTP routing, Zod validation, and SQLite integration via elide:sqlite
  • Frontend: React 19 app built with Vite, shadcn/ui, TailwindCSS 4, and TanStack Query for data management
  • Configuration: Ports and database paths configured via elide.pkl manifests or via CLI args

Directory structure:

.dev/db-studio/
├── api/          # TypeScript API
└── ui/           # Statically built React app

Features

Drizzle Studio was the main inspiration behind many of the operations, including:

  • Query editor/SQL Console to run directly against the database
  • Simple filtering of rows and columns, and sorting when viewing tables
  • Adding, deleting, and editing data directly in tables
  • Creating, dropping, and truncating tables

Future Plans

  • Create a db file through the UI (at the moment db files need to already exist)
  • Data export (CSV/JSON)
  • PostgreSQL/MySQL support

@franklinfollis franklinfollis added this to the Release R18: Beta milestone Oct 17, 2025
@franklinfollis franklinfollis added feature Large PRs or issues with full-blown features 🚧 WIP Works-in-progress. Blocks merge module:cli CLI module issues and features labels Oct 17, 2025
@codecov
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

❌ Patch coverage is 2.84360% with 205 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...in/kotlin/elide/tool/cli/cmd/db/DbStudioCommand.kt 2.84% 205 Missing ⚠️

📢 Thoughts on this report? Let us know!

@socket-security
Copy link

socket-security bot commented Oct 28, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​react-router-dom@​7.9.41001006598100
Addednpm/​@​radix-ui/​react-separator@​1.1.81001006795100
Addednpm/​class-variance-authority@​0.7.11001006880100
Addednpm/​@​radix-ui/​react-slot@​1.2.31001006995100
Addednpm/​@​elide-dev/​types@​1.0.0-beta10761007089100
Addednpm/​@​radix-ui/​react-switch@​1.2.6991007095100
Addednpm/​@​radix-ui/​react-tabs@​1.1.13991007097100
Addednpm/​@​radix-ui/​react-hover-card@​1.1.15991007195100
Addednpm/​@​radix-ui/​react-checkbox@​1.3.3991007195100
Addednpm/​@​radix-ui/​react-dropdown-menu@​2.1.16991007197100
Addednpm/​@​radix-ui/​react-alert-dialog@​1.1.15991007195100
Addednpm/​@​radix-ui/​react-accordion@​1.2.12991007197100
Addednpm/​@​radix-ui/​react-dialog@​1.1.15991007195100
Addednpm/​@​radix-ui/​react-tooltip@​1.2.8991007295100
Addednpm/​@​tanstack/​react-table@​8.21.31001007385100
Addednpm/​typescript-eslint@​8.46.21001007498100
Addednpm/​@​tanstack/​eslint-plugin-query@​5.91.21001007491100
Addednpm/​@​types/​react-dom@​19.2.21001007589100
Addednpm/​@​types/​react@​19.2.21001007994100
Addednpm/​@​codemirror/​state@​6.5.2991007989100
Addednpm/​clsx@​2.1.11001009480100
Addednpm/​@​types/​node@​24.9.11001008195100
Addednpm/​vite@​7.1.12931008299100
Addednpm/​@​codemirror/​theme-one-dark@​6.1.31001008382100
Addednpm/​@​codemirror/​commands@​6.10.01001008386100
Addednpm/​@​codemirror/​lang-sql@​6.10.09910010084100
Addednpm/​tailwindcss@​4.1.161001008498100
Addednpm/​react@​19.2.01001008497100
Addednpm/​@​codemirror/​view@​6.38.6971008597100
Addednpm/​globals@​16.4.01001008589100
Addednpm/​tailwind-merge@​3.3.11001008693100
Addednpm/​@​heroicons/​react@​2.2.01001009286100
Addednpm/​autoprefixer@​10.4.211001009287100
See 16 more rows in the dashboard

View full report

@franklinfollis franklinfollis self-assigned this Oct 29, 2025
@franklinfollis franklinfollis linked an issue Nov 4, 2025 that may be closed by this pull request
@franklinfollis franklinfollis force-pushed the feat/database-ui branch 2 times, most recently from cee455f to 71c2099 Compare November 13, 2025 08:15
@franklinfollis franklinfollis force-pushed the feat/database-ui branch 2 times, most recently from cf16c7a to 803a2fd Compare November 28, 2025 05:06
@franklinfollis franklinfollis removed the 🚧 WIP Works-in-progress. Blocks merge label Dec 16, 2025
@franklinfollis franklinfollis force-pushed the feat/database-ui branch 2 times, most recently from c94579c to 99fa010 Compare December 20, 2025 06:41
@socket-security
Copy link

socket-security bot commented Dec 20, 2025

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm vite is 91.0% likely obfuscated

Confidence: 0.91

Location: Package overview

From: packages/cli/src/db-studio/ui/package.jsonnpm/[email protected]

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@franklinfollis franklinfollis marked this pull request as ready for review December 26, 2025 18:01
Copy link
Member

@sgammon sgammon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initial comments, otherwise i'll try it and see if we can get this into 1.0.0-beta11 🥳

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

absolute symlink? or what's up with this

@@ -0,0 +1,97 @@
/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

files will need copyright header; IDEA will apply it for you automatically, can help configure it in discord

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should dist assets be committed to source control?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Large PRs or issues with full-blown features module:cli CLI module issues and features

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Database UI

3 participants