shellwise 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shellwise",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Smart command history with inline auto-suggest and fuzzy search for your terminal",
5
5
  "type": "module",
6
6
  "bin": {
package/src/db/queries.ts CHANGED
@@ -151,7 +151,12 @@ export function pruneOlderThan(days: number): number {
151
151
  const db = getDb();
152
152
  const cutoff = Date.now() - days * 24 * 3600_000;
153
153
 
154
- const result = db.run("DELETE FROM commands WHERE created_at < ?", [cutoff]);
154
+ const result = db.run(
155
+ `DELETE FROM commands WHERE command_hash IN (
156
+ SELECT command_hash FROM command_stats WHERE last_used_at < ?
157
+ )`,
158
+ [cutoff]
159
+ );
155
160
 
156
161
  // Cleanup orphaned stats
157
162
  db.run(