{"id":16753062,"url":"https://github.com/fdncred/rsq","last_synced_at":"2025-07-12T22:33:28.249Z","repository":{"id":37193717,"uuid":"398858702","full_name":"fdncred/rsq","owner":"fdncred","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-15T17:26:31.000Z","size":363,"stargazers_count":3,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-06T22:07:17.362Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fdncred.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-22T17:26:22.000Z","updated_at":"2023-02-15T17:31:51.000Z","dependencies_parsed_at":"2024-11-22T04:33:55.247Z","dependency_job_id":null,"html_url":"https://github.com/fdncred/rsq","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fdncred/rsq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdncred%2Frsq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdncred%2Frsq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdncred%2Frsq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdncred%2Frsq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fdncred","download_url":"https://codeload.github.com/fdncred/rsq/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdncred%2Frsq/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265066118,"owners_count":23706062,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T02:49:03.820Z","updated_at":"2025-07-12T22:33:28.241Z","avatar_url":"https://github.com/fdncred.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rusqlite demo\n\nJust a quick demo to show off the history_item struct and database trait files.\n\n## How to run / commands that are supported.\n\nThe Hiztery enum (ya, i know it's a dumb name - LOL), looks somewhat like this.\n\n```rust\nenum HizteryCmd {\n    Insert {},\n    Update {},\n    Delete {},\n    Select {},\n    Import {},\n    Search {},\n    Count {},\n    Last {},\n    First {},\n    Load {},\n    Range {},\n    Before {},\n    All {},\n}\n```\n\nMost of the functionaly is built around a `HistoryItem`. This is what HistoryItem looks like.\n\n```rust\npub struct HistoryItem {\n    /// Primary Key, Unique Id\n    pub history_id: Option\u003ci64\u003e,\n    /// Entire command line\n    pub command_line: String,\n    /// Command part of the command line\n    pub command: String,\n    /// Parameters part of the command line\n    pub command_params: Option\u003cString\u003e,\n    /// Current working directory\n    pub cwd: String,\n    /// How long it took to run the command\n    pub duration: i64,\n    /// The exit status / return status of the command\n    pub exit_status: i64,\n    /// The pid of the running process\n    pub session_id: i64,\n    /// When the command was run\n    pub timestamp: chrono::DateTime\u003cUtc\u003e,\n    /// How many times was this command ran\n    pub run_count: i64,\n}\n```\n\n## Description\n\n| enum   | description                                                                                        | params                   | example                                                        |\n| ------ | -------------------------------------------------------------------------------------------------- | ------------------------ | -------------------------------------------------------------- |\n| Insert | traditional insert statement                                                                       | --text,--rows_to_insert  | cargo run -- insert --text \"happy birthday\" --rows_to_insert 5 |\n| Update | update a row by id                                                                                 | --id                     | cargo run -- update -i 1                                       |\n| Delete | delete a row by id                                                                                 | --id                     | cargo run -- delete -i 3                                       |\n| Select | select with max number of unique rows                                                              | --max, --unique          | cargo run -- select -m 5 -u                                    |\n| Import | import nushell history file into the db                                                            | --file                   | cargo run -- import --file c:\\path\\to\\nushell\\history.txt      |\n| Search | search db with searchmode prefix, fulltext, or fuzzy with a row limit and query is the search item | --mode, --limit, --query | cargo run -- search -m \"p\" -q \"code\"                           |\n| Count  | returns the count of rows in the db                                                                | N/A                      | cargo run -- count                                             |\n| Last   | returns the first row                                                                              | N/A                      | cargo run -- first                                             |\n| First  | returns the last row                                                                               | N/A                      | cargo run -- last                                              |\n| Load   | returns the historyitem at db row index, like when you hit up arrow                                | --id                     | cargo run -- load -i 2800                                      |\n| Range  | return historyitems from/to date range                                                             | --from, --to             | cargo run -- range -f \"2021-07-21\" -t \"2021-07-25\"             |\n| Before | return historyitems from datetime with count limit                                                 | --from, --count          | cargo run -- before -f \"2021-07-21\" -c 25                      |\n| All    | just return everything                                                                             | N/A                      | cargo run -- all                                               |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffdncred%2Frsq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffdncred%2Frsq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffdncred%2Frsq/lists"}