fosslife / devtools-x

Collection of offline first developer utilities available as non-electron desktop application. all in one place, cross-platform, 10MB app!
https://devtools.fosslife.com/
MIT License
1k stars 49 forks source link

[Feature request] Code snippets storage #107

Open ThijsZijdel opened 2 weeks ago

ThijsZijdel commented 2 weeks ago

Context:

As a developer, I often find myself reusing code snippets/ commands across various projects and environments. Having an efficient and organized way to store and retrieve these snippets within devtools-x would greatly enhance productivity and ensure consistency.

Screenshot 2024-08-28 at 22 14 49

Proposed scope:

Questions: @Sparkenstein What is your preferred way of storing files/snippets? Also, are there any additional features you'd like to see in the snippet storage system?

Edit: Perhaps wrap the db file storage used on the "JSON Tools" module? await db.get<any>("snippets/group/file");

Additional note/ idea: Would love to make this system reusable for eg. AI prompts, currently using a combination of notes, snippetsLab en notion.

Sparkenstein commented 2 weeks ago

This was in TODO from a long time, glad that you picked it up.

For storage, Ideally we should use something like SQLite, it's doable with rust, If you want I can set up a basic SQLite storage to build on top of. Finding/searching with SQLite will be cheaper than storing text in json. If you want to take a stab at it, that's fine by me.

(I don't mind existing tauri-plugin-store, but it was meant for storing small data like settings or config, and it doesn't provide any way to group/search/find etc, if store grows it will be costly, plus storing string inside JSON will need managing escape sequences etc. It's better to avoid it instead)

ThijsZijdel commented 2 weeks ago

@Sparkenstein could u take a look at the db setup within main.rs having trouble getting the migrations to spin up 🤷🏼

Sparkenstein commented 1 week ago

Sorry for the delay, weekdays are busy always. will take a look around Friday.

Sparkenstein commented 1 day ago

Sorry for the delay x2, migrations are running fine I checked by adding one more up migration, it creates db and modifies it correctly. the database.ts file is wrong, can you point out any specific issue you are facing?

Sparkenstein commented 1 day ago

image

in terms of setup everything looks good to me otherwise