Skip to content

feat: allow opening files as temporary notes#149

Open
rudiejd wants to merge 1 commit into
kndndrj:masterfrom
rudiejd:feat/allow-opening-files
Open

feat: allow opening files as temporary notes#149
rudiejd wants to merge 1 commit into
kndndrj:masterfrom
rudiejd:feat/allow-opening-files

Conversation

@rudiejd
Copy link
Copy Markdown

@rudiejd rudiejd commented Oct 3, 2024

Problem: I work in a repository that contains version-controlled SQL migrations. In order to edit and test these .sql files in nvim-dbee, I have to copy and paste between an nvim-dbee note and a secondary window for the buffer in the .sql file.

Solution: Allow opening files as "temporary notes". These files won't re-appear when neovim is closed and re-opened. I could also make that happen, but I suspect it would involve creating some sort of symlink in the global note namespace, and I wasn't sure whether that was desired.

Closes #132

@rudiejd
Copy link
Copy Markdown
Author

rudiejd commented Oct 22, 2024

@kndndrj could you please take a look when you get a chance 🙏 ? I've been using this fork locally, but it definitely isn't perfect. I'd like to come up with a good way for reading files in dbee, since most of my SQL workflow involves editing .sql migration files

@johnazule
Copy link
Copy Markdown

Just come looking for this, most of the sql I write for my new job is altering migrations or stored procedures

@phdah
Copy link
Copy Markdown
Contributor

phdah commented Aug 12, 2025

Hey @rudiejd
Is this a duplicate, although different solution, as this #206?

Please have a look at that fork and see if it's a suitable solution for your issue. I share the need to run "normal" SQL files.

Comment on lines +308 to +310
-- a bit shitty
self.notes["global"] = self.notes["global"] or {}
self.notes["global"][file] = s
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

as you seem to have concluded, putting it under the global notes doesn't really feel great. maybe this is a good place to add a third context for "project" or something like this. that name indicates that its connected to the current repo in some way. that makes more sense if dbee could scan for compatible file types such as all files with the .sql extension, but still works for opening a single file i think :)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open UI over a file instead of a note

4 participants