-
Notifications
You must be signed in to change notification settings - Fork 189
Discussion - How to store Insomnium using the FS #24
Comments
hey Austin, thanks for using Insomnium and bringing this to the table Yeah, using a FileSystem-based storage is in Insomnium's roadmap to milestone 1.
I've been looking into Nedb recently and stumbled upon seald's fork of it, which they've been maintaining since 2021 and is pretty dope. They are basically making it faster and also rewriting the API into a subset of MongoDB's.
My plan for Insomnium now is to gradually transition to use seald's NeDb: having a memory-based DB is still quite useful (e.g. that makes our requests/parameters queryable, which in turn makes integrating something like Flowise into Insomnium much easier, so we can create complex interactions of requests & variable references). Also it generally makes reading/writing faster vs directly to file system. With that in mind, the file-system-based storage can come in the form of having an option for users to open an existing folder as workspace (a bit like the way bruno does it - but keep it optional). And when users do that, Insomnium will start another thread to performance a 1sec-debounce-save everytime a change has been made in NeDB, and create/update a file that will open up two possiblities:
to directly perform a query that is stored inside |
(I've editied the title to be about Yesterday I found a problem with Insomnia's NeDB setup that caused a bug when I was debugging Url segment params. But the problem was gone in production. After clearing the user-data in dev the bug disappeared; super weird. I'm really looking forward to see how good @seald/NeDb is (hopefully it will not be necessary to completely revamp the in-memory db system. And having file-system support will give it much more stability - and then the db system would play the role of complementary) |
Hey guys, really loving the idea of a pure FS based storage, especially as it would allow sync/diff using git and so on of course. |
@EricLanduyt aw good idea; that's definitely very useful - and something that LLM can be really good at (Local LLM support will be out in the next release! Can start giving it the raw request Insomnium JSON + API result + spec description, and test to see if it can make an OpenAPI spec and write test-cases) |
Okay, my three cents. I muay be out of touch?
Why not just use this for sync? Yes, it is primitive, no way to setup a custom git only GitHub and GitLab but the inner workings of the thing are there, the entire UI and git operations. I guess a generic Git option will come from them very soon or could be implemented quickly.
Thank you for the great work! |
@TCB13 I am not the perfect person to answer this, but to my understanding there are no plans on ever merging in changes with Insomnia. |
Okay... but that means... A LOT of work to implement new features and/or deal with bug fixes. Merging things back would probably make things easier. However I'm not sure about this because Kong said one of the reasons for this move was to have only one storage backend... maybe they're moving everything to the cloud? |
Just a suggestion how to manage such sync: use a separate Kong/insomnia branch and use a "patched branch" which will contain all the necessary changes to make offline-only functionality possible.
Most sensible in my opinion is option (2) - minimum effort for all new features and bugfixes. |
This is what I was thinking as well, but I'm not sure it could be done. Kong said (Kong/insomnia#6577 (comment)) one of the reasons for this move was to have only one storage backend... this would mean there will be no way to "only remove online features" as their online storage is baked deep into the thing. |
That is sad indeed, there might be a way to replace online calls service but it means more work. RIP Insomnia 🥺 |
@TCB13 thanks for the pointer regarding git sync; I just checked the source & noticed it was implemented with isomorphic-git underneath, so it's pretty dope. I will re-roll back this local-based git-sync in the next release (preivously I wasn't aware that this feature existed) |
and regarding these two points:
yes. And I honestly don't think many of Insomnia's new features are going to be valuable to Insomnium. I'm not a big fan of Kong's product direction, especially since that day when it automatically updated my app to 8.0, and then all my data at work just disappeared and it really freaked me out. In short, I have no trust in their post-8.0 product direction (in terms of UI, UX, database, etc). I just don't believe they care enough about their users who don't use their cloud services. (Of course, if I come cross fixes Kong made for front-end bugs, I will try bring them over to Insomnium ::) Similiarly, for every new fix/thing I implemented in Insomnium, I don't mind Kong taking them to Insomnia. I think that's the kind of silent agreement that comes with forking.)
The routing and data-structures as implemented in Insomnia post-8.0 are substantially different from v2023.5.8, which is the Insomnia's version that Insomnium is based on. From what I've observed, Kong wanted Insomnia to be like Notion but for APIs. They are using Notion and other cloud-centric apps to justify their product direction. This implies that in the app's architecture they wouldn't mind trading off UI/UX speed for cloud-sync, real-time collab, etc. Makes perfect sense too considering at its core Kong is a cloud company (and they are likely making their cloud/enterprise users happy. Good for them I guess.) My direction for Insomnium is simple: keep it 100% local & forever FOSS, and keep the UI/UX fast. And then add in optional local LLMs integration (e.g. with code llama, etc) so Insomnium becomes both a API and LLM client where users can use LLM to automate test generation for their API calls, or to genereate front-end code (eg React, htmx components), etc, as well as using Insomnium to fine-tune local LLMs - because I think that's the future. (I started working with GPT2 and GPT3 three years ago. And I think we're finally entering the era of LLMs.) I'm pretty sure very soon all API clients will be integrated with LLMs one way or another. And maybe Insomnium will become the number-one API+LLM client ::) so yeah, we will have local FS storage |
The only bad thing about their git sync is that it doesn't support generic git "servers" over SSH like any other thing.
Well I was just tying to reduce your workload. I have no experience with their 8.x interface and I'm not aware of the roadmap so you're probably better than I could ever be at this decision. For what's worth I really like the 2023.5.8 UI and feature set, it does everything I need and more. :) Thank you for the fork. |
thanks; they were great feedbacks btw
aw i see; looks like the best isomorphic-git can do is https isomorphic-git/isomorphic-git#1267 |
Well that's fair git solutions usually support HTTP, even Gitolite (what I use in multiple cases) seems to have a way to make it HTTP: https://gitolite.com/gitolite/contrib/ssh-and-http.html |
i might be a rare case, but my company does not allow access to GIT over HTTP. in the past i relyied on an insomnia git plugin to overcome this, but it would be great if it would work over SSH for the stock git integration. |
Hi all, |
I've been a long time Insomnia user (coming on 5 years), and I've hated that it's a nightmare to import/export data and use your own syncing features. So I would love to spark a discussion on how we can get off NeDb and use the FileSystem instead.
I am wondering if it makes sense to use a file for each request, and a folder will be reflected as such in the FS. I have been using Obsidian for my note taking, and they make it so easy to write notes, and then also to edit those notes in a different tool like Neovim for example. Having the ability to edit an API call by modifying the file directly would be incredible.
Thoughts? I haven't spent any time looking at Nedb and how it's currently stored so I might be off base with this idea to start with, but once an idea is settled in how to store everything offline I am happy to contribute the code that will make this possible.
The text was updated successfully, but these errors were encountered: