drizzle-team / drizzle-team/drizzle-orm

[FEATURE]: allow drizzle-kit studio to open a database directly, without a config file

Open
#6,230 0 comments 0 reactions 1 assignee Claimed by @RomanNabukhotnyi View on GitHub
drizzle/studio enhancement
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

- [x] I have verified this feature I'm about to request hasn't been suggested before.

### Describe the enhancement you want to request

`drizzle-kit studio` currently requires a `drizzle.config.ts` in the working directory. That's fine as a project default, but it blocks the "just point me at a file" case:

```
$ npx drizzle-kit studio ./opencode.db
Unrecognized options for command 'studio': ./opencode.db
```

Workaround today: create a throwaway directory, `npm init`, install `drizzle-kit` and `better-sqlite3`, write a config with an absolute path, and create an empty schema file to satisfy the validator. Six steps to read one SQLite file.

Proposal: accept a connection target as a positional argument or a `--url` flag, inferring the dialect from the URL scheme (a bare path or `file:` -> sqlite, `postgres://` -> postgres, `mysql://` -> mysql). When it's provided, skip config resolution entirely and introspect the live database for the schema, which Studio already does anyway.

```
npx drizzle-kit studio ./local.db
npx drizzle-kit studio --url postgres://user:pass@localhost:5432/db
```

Schema introspection already exists (`drizzle-kit pull`), so this is mostly plumbing rather than new capability. It would make Studio usable as a general database browser via `npx`, with no project setup.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.