aboutsummaryrefslogtreecommitdiffstats
path: root/atuin-client/src/database.rs (unfollow)
Commit message (Collapse)Author
2024-04-18chore: move crates into crates/ dir (#1958)Ellie Huxtable
I'd like to tidy up the root a little, and it's nice to have all the rust crates in one place
2024-04-11feat(gui): add base structure (#1935)Ellie Huxtable
* initial * ui things * cargo * update, add history refresh button * history page a bit better, add initial dotfiles page * re-org layout * bye squigglies * add dotfiles ui, show aliases * add default shell detection * put stats in a little drawer, alias import changes * use new table for aliases, add alias deleting * support adding aliases * close drawer when added, no alias autocomplete * clippy, format * attempt to ensure gdk is installed ok * sudo * no linux things on mac ffs * I forgot we build for windows too... end of day * remove tauri backend from workspace
2024-03-15fix(search): case insensitive hostname filtering (#1883)Ellie Huxtable
2024-03-05fix(build): make atuin compile on non-win/mac/linux platforms (#1825)Rain
Hi! I've been trying to get atuin set up on the illumos machine I built for work @oxidecomputer, and I ran into a few issues which are fixed here: 1. The `clipboard` feature was only supported on Windows, Mac and Linux. I've added a platform gate for that. 2. The `atomic-write-file` crate needed an update to the version of `nix` -- that is included. 3. As part of this, I found a [security bug](https://rustsec.org/advisories/RUSTSEC-2024-0020.html) in the whoami crate. The bug has been fixed upstream and I've included it. whoami 1.5.0 deprecates the `hostname` function, which produced some fresh warnings. While fixing the warnings I also took the liberty of doing some code rearrangement, adding a few functions that wrap some common operations. I didn't really know where to put those functions, so I created a new `utils` module for it. If you have a better place to put them, I'm happy to change the PR. Feel free to make any changes to this PR if you like before landing it, or to ask for review. As a followup I'm also happy to set up a cross-compile build for atuin on illumos. It's a bit harder to run tests in CI for illumos at the moment, but I'm trying to get a project started up to make that happen in the future as well.
2024-03-01feat: support regex with r/.../ syntax (#1745)依云
* feat: support regex with r/.../ syntax * cargo fmt * feat(tests): add some tests for regex matching
2024-02-19feat: change fulltext to do multi substring match (#1660)依云
2024-02-04fix: set durability for sqlite to recommended settings (#1667)Joe Ardent
Also do an optimize on connection close. Fixes lag on history insertion.
2024-01-22fix(tui): dedupe was removing history (#1610)Ellie Huxtable
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
2024-01-19fix: add acquire timeout to sqlite database connection (#1590)Ellie Huxtable
* 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
2024-01-19fix: Use existing db querying for history list (#1589)Peter Holloway
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.
2024-01-16feat: add history rebuild (#1575)Ellie Huxtable
* 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
2024-01-12feat: Add interactive command inspector (#1296)Ellie Huxtable
* 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.
2024-01-06refactor: String -> HistoryId (#1512)Ellie Huxtable
2023-10-29fix: initial list of history in workspace mode (#1356)Ellie Huxtable
The initial list didn't correctly show all history while in workspace mode, while it worked totally as expected while searching. Fix this.
2023-10-25Fix deleted history count (#1328)Ellie Huxtable
2023-10-08clear history id (#1263)Conrad Ludgate
* clear history id * fix nu
2023-10-04Fix/1207 deleted entries shown in interactive search (#1272)Dieter Eickstaedt
2023-09-26handle missing entries (fixes #1236) (#1253)Conrad Ludgate
* fix #1236 * lints
2023-09-11replace chrono with time (#806)Conrad Ludgate
* replace chrono with time * Fix test chrono usage --------- Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
2023-08-18Update dependencies (#1181)Conrad Ludgate
2023-07-14Add workspace mode, enable if in git repo (#1053)Ellie Huxtable
* Add workspace mode, enable if in git repo * Fix tests * Should now be good * Page filter modes correctly if in workspace
2023-07-14Add new sync (#1093)Ellie Huxtable
* 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>
2023-06-15Builder interface for History objects (#933)Vlad Stepanov
* [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>
2023-06-14Key values (#1038)Ellie Huxtable
* 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>
2023-06-13Fix `--delete-it-all` and `--delete` commands (#913)J. Emiliano Deustua
* 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>
2023-06-12add support to override hostname and username via env var (#1041)Peter Brunner
2023-04-11Add `--reverse` to `atuin search` (#862)Tom Cammann
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 ```
2023-03-29Add `--offset` flag to `atuin search` (#825)Tom Cammann
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 ```
2023-03-27client filtering done in query (#629)jean-santos
2023-03-26chore: use fork of skim (#803)Conrad Ludgate
* use fuzzy-matcher instead of skim switch to a search-engine abstraction * fmt * fix deprecated warnings
2023-03-24Delete all instances of a command (#797)Ellie Huxtable
* 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
2023-03-21Fix skim search (#795)Ellie Huxtable
2023-03-20Add history deletion (#791)Ellie Huxtable
* 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
2023-03-19skim-demo (#695)Conrad Ludgate
* 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>
2023-03-14Prefer PWD environment variable over cwd if available to better support ↵Patrick Decat
symbolic links (#783)
2023-03-08Fix before/after combined with limit (#770)Ellie Huxtable
* 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
2023-02-06Try to make clippy happy 🥺 (#686)Ellie Huxtable
* Try to make clippy happy 🥺 * Fmt * I missed one (can't run clippy locally on airport wifi...)
2022-12-27Improve error message when $AUTIN_SESSION is not set. (#654)Jamie Quigley
Closes #653
2022-12-16Switch to using ATUIN_LOG instead of RUST_LOG (#642)Ellie Huxtable
* Switch to using ATUIN_LOG instead of RUST_LOG * Stop clippy complaining * I should know better - clippy is never happy :(
2022-11-04Add local event log storage (#390)Ellie Huxtable
* 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>
2022-09-11better cursor search (#473)Conrad Ludgate
* improve cursor code * proper unicode support * refactor and test * fmt * clippy * move methods to state * refactor search modules
2022-05-09Importer V3 (#395)Conrad Ludgate
* start of importer refactor * fish * resh * zsh
2022-04-28ignore JetBrains IDEs, tidy-up imports (#348)Jakub Panek
* ignore JB IDEs * tidy-up imports * add rustfmt config
2022-04-26fix db range query (#351)Conrad Ludgate
2022-04-23sql builder (#333)Conrad Ludgate
* start * clean up * refactor globs
2022-04-22Fix empty queries with filters (#332)Ellie Huxtable
2022-04-22History filter (#329)Ellie Huxtable
* 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
2022-04-21A few minor tweaks (#314)Conrad Ludgate
* use bail macro replace client database errors remove dead code * fix test
2022-04-13provide better error messages (#300)Conrad Ludgate
2022-03-18Improve fuzzy search (#279)Patrick
* 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