Closed proofit404 closed 9 years ago
Will you teach me some use-case?
Sure.
We write some event logs in our database. Fox example traceback in background worker. I have few SQL scripts which make some analytic on this data. I often need open some of this file, correct some conditions, save file, insert file content into db query editor. I repeat this sequence few times until I got satisfactory query result.
We have SQL files with database scheme. When I correct any of this file most of times I need execute only one paragraph from this file. Every time I need to execute paragraph, I manually copy it to query editor file.
I think we can add query editor minor mode which will mimic default SQL send commands. But instead of product interactive will bind this buffer to the db viewer or open connection buffer. This behavior is similar to slime when you send only part of the file to the inferior lisp process.
Maybe there is a reason to replace query editor major mode with minor
mode at all. If we press c
or C
in db viewer we can simply open
new SQL buffer bind to that db viewer. In this case we doesn't need
query editor history at all because this will handled by Emacs default
undo or undo-tree systems.
If you doesn't interesting in this solution I can implement this as external minor-mode.
Hi @proofit404 Thank you for your report for use-cases and I'm sorry for my late response.
I recognize these use-cases but I'm not sure what solution is the best. I'm just using edbi's query buffer, but I heard some people want to send a SQL fragment from the string literal in code buffers. Your minor mode idea is great. It would reduce the moving cost between edbi's query buffer and other buffers. If you could implement it, it would be welcome!
In case of send a SQL fragment from the string literal in code buffers
this can be implemented with second minor mode (something like edbi-code-mode
). I think we need to simplify api also. Make it looks like cl-dbi for example.
I'd like to contribute following:
edbi-api.el
, edbi-dbview.el
). This will allows us to write ert test more easy.Cask
edbi-dialog-ds
one of it implementation. This will simplify connection helpers writing. My edbi-django
and edbi-database-url
for example.ac-edbi
to use it. Merge my company-edbi
in the same way.If you think this changes can make sense to the project I can implement each of it part by part. I can start after new year holidays.
That's great! I also think that we could make a smart DB API for emacs lisp. Well, I think this is big project. I would help you as much as possible.
I'm sorry for my slow response because of my full-time job and other projects.
I totally agree with you. I have full-time job and bunch of projects on github. Its very difficult to work 12 hours per day. But I use edbi every day at my full-time job. I want to improve it. I'll try my best to implement features above.
First commit can take long time for me because I'll need to learn much background. Perl, epc, ctable for example. I'll create PR with first changes nearly twentieth of January.
Hello one more time. I think about best order to implement mentioned features. Most of it will depend on api design. I think that better way to implement each part separately and then plan api on all those needs. After api impementation we can merge all project all together. So I close this issue for now.
Hi @proofit404 I think that is better too.
Thank you.
It is really handy use
find-file
andsave-buffer
functionally with query editor buffers. Currently I useinsert-file
and manually copy-paste edited content back to the opened file buffer.