aboutsummaryrefslogtreecommitdiffstats
path: root/atuin-client/src/database.rs (follow)
Commit message (Collapse)AuthorAge
* feat: change fulltext to do multi substring match (#1660)依云2024-02-19
|
* fix: set durability for sqlite to recommended settings (#1667)Joe Ardent2024-02-04
| | | | | Also do an optimize on connection close. Fixes lag on history insertion.
* fix(tui): dedupe was removing history (#1610)Ellie Huxtable2024-01-22
| | | | | | | | | | Related: https://forum.atuin.sh/t/search-ignoring-commands/74/5?u=ellie When a user ran a duplicated command, but in another session, it was removed by filters. This is because the subquery that was once used did not have the same filters applied as the main query. Instead of messing with subqueries, `group by` instead. This aligns with the search() function
* fix: add acquire timeout to sqlite database connection (#1590)Ellie Huxtable2024-01-19
| | | | | | | | | | | | | | | | * fix: add acquire timeout to sqlite database connection This should fix #1503 I wasn't able to trigger enough IO pressure for the SQL connection to be a problem. This adds `local_timeout` to the client config. This is a float, and represents the number of seconds (units in line with the other timeouts, though those are ints). Users may well want to reduce this if they regularly have issues, but by default I think 2s is fine and avoids a non-responsive system in bad situations. * tests
* fix: Use existing db querying for history list (#1589)Peter Holloway2024-01-19
| | | | | When printing the history list with either the session or cwd filter enabled, use to same query method as without either to ensure that the other options (hide deleted entries etc) are respected.
* feat: add history rebuild (#1575)Ellie Huxtable2024-01-16
| | | | | | | | | | | | | | | | | | | | | | | * feat: add history rebuild This adds a function that will 1. List all history from the store 2. Segment by create/delete 3. Insert all creates into the database 4. Delete all deleted This replaces the old history sync. Presently it's incomplete. There is no incremental rebuild, it can only do the entire thing at once. This is ran by `atuin store rebuild history` * fix tests * add incremental sync * add auto sync
* feat: Add interactive command inspector (#1296)Ellie Huxtable2024-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Begin work on command inspector This is a separate pane in the interactive mode that allows for exploration and inspecting of specific commands. I've restructured things a bit. It made logical sense that things were nested under commands, however the whole point of `atuin` is to provide commands. Breaking things out like this enables a bit less crazy nesting as we add more functionality to things like interactive search. I'd like to add a few more interactive things and it was starting to feel very cluttered * Some vague tab things * functioning inspector with stats * add interactive delete to inspector * things * clippy * borders * sus * revert restructure for another pr * Revert "sus" This reverts commit d4bae8cf614d93b728621f7985cf4e387b6dc113.
* refactor: String -> HistoryId (#1512)Ellie Huxtable2024-01-06
|
* fix: initial list of history in workspace mode (#1356)Ellie Huxtable2023-10-29
| | | | The initial list didn't correctly show all history while in workspace mode, while it worked totally as expected while searching. Fix this.
* Fix deleted history count (#1328)Ellie Huxtable2023-10-25
|
* clear history id (#1263)Conrad Ludgate2023-10-08
| | | | | * clear history id * fix nu
* Fix/1207 deleted entries shown in interactive search (#1272)Dieter Eickstaedt2023-10-04
|
* handle missing entries (fixes #1236) (#1253)Conrad Ludgate2023-09-26
| | | | | * fix #1236 * lints
* replace chrono with time (#806)Conrad Ludgate2023-09-11
| | | | | | | | | * replace chrono with time * Fix test chrono usage --------- Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
* Update dependencies (#1181)Conrad Ludgate2023-08-18
|
* Add workspace mode, enable if in git repo (#1053)Ellie Huxtable2023-07-14
| | | | | | | | | * Add workspace mode, enable if in git repo * Fix tests * Should now be good * Page filter modes correctly if in workspace
* Add new sync (#1093)Ellie Huxtable2023-07-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add record migration * Add database functions for inserting history No real tests yet :( I would like to avoid running postgres lol * Add index handler, use UUIDs not strings * Fix a bunch of tests, remove Option<Uuid> * Add tests, all passing * Working upload sync * Record downloading works * Sync download works * Don't waste requests * Use a page size for uploads, make it variable later * Aaaaaand they're encrypted now too * Add cek * Allow reading tail across hosts * Revert "Allow reading tail across hosts" Not like that This reverts commit 7b0c72e7e050c358172f9b53cbd21b9e44cf4931. * Handle multiple shards properly * format * Format and make clippy happy * use some fancy types (#1098) * use some fancy types * fmt * Goodbye horrible tuple * Update atuin-server-postgres/migrations/20230623070418_records.sql Co-authored-by: Conrad Ludgate <conradludgate@gmail.com> * fmt * Sort tests too because time sucks * fix features --------- Co-authored-by: Conrad Ludgate <conradludgate@gmail.com>
* Builder interface for History objects (#933)Vlad Stepanov2023-06-15
| | | | | | | | | | | | | | | | | | | | | | * [feature] store env variables in History records WIP: remove `HistoryWithoutDelete`, add some docstrings, tests * Create History objects through builders. Assure in compile-time that all required fields are set for the given construction scenario * (from #882) split Cmd::run into subfns * Update `History` doc * remove rmp-serde from history * update warning --------- Co-authored-by: Conrad Ludgate <conrad.ludgate@truelayer.com>
* Key values (#1038)Ellie Huxtable2023-06-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * wip * Start testing * Store host IDs, not hostnames Why? Hostnames can change a lot, and therefore host filtering can be funky. Really, all we want is a unique ID per machine + do not care what it might be. * Mostly just write a fuckload of tests * Add a v0 kv store I can push to * Appending works * Add next() and iterate, test the pointer chain * Fix sig * Make clippy happy and thaw the ICE * Fix tests' * Fix tests * typed builder and cleaner db trait --------- Co-authored-by: Conrad Ludgate <conrad.ludgate@truelayer.com>
* Fix `--delete-it-all` and `--delete` commands (#913)J. Emiliano Deustua2023-06-13
| | | | | | | | | | | | | | | | | | | | * Add `delete_at` is null condition during search Since entries are searched everytime a delete process ends, the --delete-it-all command will enter an infinite loop if searching the whole history. * Remove command blanking Command blanking may violate the `unique(timestamp, cwd, command)` condition. * Overwrite command with random string when deleting * Add rand dependency to client crate --------- Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
* add support to override hostname and username via env var (#1041)Peter Brunner2023-06-12
|
* Add `--reverse` to `atuin search` (#862)Tom Cammann2023-04-11
| | | | | | | | | Add `-r/--reverse` flag to `atuin search` to allow searching by oldest results first. Example to find the oldest `cargo` command: ``` atuin search --limit 1 --reverse cargo ```
* Add `--offset` flag to `atuin search` (#825)Tom Cammann2023-03-29
| | | | | | | | | | | | This flag allows the user to continue searching at an offset. This is useful for building tools that use atuin to search for previous commands and return only one result. ``` atuin search --limit 1 atuin search --limit 1 --offset 1 atuin search --limit 1 --offset 2 ```
* client filtering done in query (#629)jean-santos2023-03-27
|
* chore: use fork of skim (#803)Conrad Ludgate2023-03-26
| | | | | | | | | * use fuzzy-matcher instead of skim switch to a search-engine abstraction * fmt * fix deprecated warnings
* Delete all instances of a command (#797)Ellie Huxtable2023-03-24
| | | | | | | | | | | | | | | | | | * Delete all instances of a command Our search command will de-dupe results by default. But... This isn't great for deleting! You don't want to run it over-and-over-and-over until all commands are deleted. Loop the query, and keep on deleting what it returns until they are all gone. * Optimize delete upload It was running a request for every element, on every sync lol Only push a delete if needed Future: push all deletes in one request
* Fix skim search (#795)Ellie Huxtable2023-03-21
|
* Add history deletion (#791)Ellie Huxtable2023-03-20
| | | | | | | | | | | | | * Drop events. I'd still like to do them, but differently * Start adding delete api stuff * Set mailmap * Delete delete delete * Fix tests * Make clippy happy
* skim-demo (#695)Conrad Ludgate2023-03-19
| | | | | | | | | | | | | | | * skim-demo * skim some more * Weight first word match higher (#712) * some improvements * make skim opt-in --------- Co-authored-by: Frank Hamand <frankhamand@gmail.com>
* Prefer PWD environment variable over cwd if available to better support ↵Patrick Decat2023-03-14
| | | | symbolic links (#783)
* Fix before/after combined with limit (#770)Ellie Huxtable2023-03-08
| | | | | | | | | | | | | | * Fix before/after combined with limit Mixing filters done in Rust with filters done in SQL is _no bueno_. Been meaning to do this for a while anyways. Search params are getting a bit fat but oh well! * Make an excuse for a big function sig * Do options map_or not if * Fix tests
* Try to make clippy happy 🥺 (#686)Ellie Huxtable2023-02-06
| | | | | | | * Try to make clippy happy 🥺 * Fmt * I missed one (can't run clippy locally on airport wifi...)
* Improve error message when $AUTIN_SESSION is not set. (#654)Jamie Quigley2022-12-27
| | | Closes #653
* Switch to using ATUIN_LOG instead of RUST_LOG (#642)Ellie Huxtable2022-12-16
| | | | | | | * Switch to using ATUIN_LOG instead of RUST_LOG * Stop clippy complaining * I should know better - clippy is never happy :(
* Add local event log storage (#390)Ellie Huxtable2022-11-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add event data structures This adds the data structures required to start syncing events, rather than syncing history directly. Adjust event Fix Add event data structure to client * Add server event table sql * Add client event table migration Adjust migration * Insert into event table from client * Add event merge function Right now this just ensures we have the right amount of events given the history we have BUT it will also be used to merge CREATE/DELETE events, resulting in history being deleted :) * Make CI happy * Adjust * we don't limit history length any more * Update atuin-client/src/database.rs Co-authored-by: Conrad Ludgate <conradludgate@gmail.com> * fix usage * Fix typo * New Rust, new clippy stuff Co-authored-by: Conrad Ludgate <conradludgate@gmail.com>
* better cursor search (#473)Conrad Ludgate2022-09-11
| | | | | | | | | | | | | | | * improve cursor code * proper unicode support * refactor and test * fmt * clippy * move methods to state * refactor search modules
* Importer V3 (#395)Conrad Ludgate2022-05-09
| | | | | | | | | * start of importer refactor * fish * resh * zsh
* ignore JetBrains IDEs, tidy-up imports (#348)Jakub Panek2022-04-28
| | | | | | | * ignore JB IDEs * tidy-up imports * add rustfmt config
* fix db range query (#351)Conrad Ludgate2022-04-26
|
* sql builder (#333)Conrad Ludgate2022-04-23
| | | | | | | * start * clean up * refactor globs
* Fix empty queries with filters (#332)Ellie Huxtable2022-04-22
|
* History filter (#329)Ellie Huxtable2022-04-22
| | | | | | | | | | | | | | * Add history filters, and hotkey toggle Switch between different search modes to narrow down the history you want - global search for all history, host for all history from your current machine, session for the current shell session, and directory for the current directory The default can be configured via `filter_mode` * Update docs * Add context
* A few minor tweaks (#314)Conrad Ludgate2022-04-21
| | | | | | | | | * use bail macro replace client database errors remove dead code * fix test
* provide better error messages (#300)Conrad Ludgate2022-04-13
|
* Improve fuzzy search (#279)Patrick2022-03-18
| | | | | | | | | | | | | | | | | | | | | * Add SearchMode fzf. Add a new search mode "fzf" that tries to mimic the search syntax of https://github.com/junegunn/fzf#search-syntax This search mode splits the query into terms where each term is matched individually. Terms can have operators like prefix, suffix, exact match only and can be inverted. Additionally, smart-case matching is performed: if a term contains a non-lowercase letter the match will be case-sensitive. * PR feedback. - Use SearchMode::Fuzzy instead of SearchMode::Fzf - update docs - re-order tests so previous fuzzy tests come first, add more tests for each operator * PR comments: remove named arguments, match expression * PR comments: macro -> async func
* Fix `history list --cwd` errors (#278)Lucas Burns2022-03-13
|
* use sqlite grouping rather than subquery (#181)Mark Wotton2021-12-19
|
* Reordered fuzzy search (#179)Mark Wotton2021-09-09
| | | | | | | | * add test demonstrating problem * add a reordered fuzzy-search mode that presents shorter matches first, rather than using strict chronological ordering. * fix warnings, refactor interface to minspan slightly
* Add fuzzy text search mode (#142)Frank Hamand2021-06-01
|
* Support fulltext search of commands (#75)Yuvi Panda2021-05-09
|