Commit graph

22 commits

Author SHA1 Message Date
soup
0391629862
chore(license): update copyright year in headers (#1929)
* chore: update copyright year in license headers

* Revert "chore: update copyright year in license headers"

This reverts commit 3e58129c431b9a491089ce36b908f9bb6ba38ed3.

* chore: update copyright year in license headers

* fix: sort go imports

* fix: add missing license headers
2025-01-06 22:23:19 +01:00
ze0s
96f61a90e5
fix(database): SQLite try reindexing on integrity check error (#1877)
* fix(database): SQLite try reindexing on consistency error

* fix(database): SQLite return err if no bad indexes found
2024-12-14 15:58:18 +01:00
Kyle Sanderson
f292d2709b
fix(database): backup on windows bad filename (#1841)
* fix(migrations): use safe characters during backup

* remove _ because of splits

* Update sqlite.go

* flip
2024-11-25 10:59:40 +01:00
martylukyy
74eea79215
feat(database): SQLite database backups (#1756)
* feat(database): SQLite database backups

* feat(database): do not produce SQL injections

* feat(database): retain all backups if 0 or less
refactor(database): specify database driver in func names

* refactor(database): return early on cleanup

* refactor(database): do not call cleanup func if max backups set to 0

* refactor(database): backup retention behavior

* feat(database): improve logging

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
2024-11-12 19:14:45 +01:00
martylukyy
2cdd3264b8
fix(database): migrations log correct upgrade var version (#1441)
* fix(database): correct upgrade var

* fix(database): substitute len(var) with i+1
2024-02-28 18:04:45 +01:00
ze0s
45b522abf8
chore: update license header year (#1332)
* chore: update license header year

* chore: update license header year tsx files

* chore: update license header
2024-01-01 16:21:02 +01:00
KaiserBh
666bdf68cd
feat(database): setup integration tests (#1118)
* refactor: this should be Debug() just like the rest.

* feat: catch error when updating client table.

Before if we provided the wrong ID it will just say it's successful when it shouldn't.

* chore: handle the errors.

* fix: defer tx.Rollback().

When I try handling the error we always hit the error no matter what even though there wasn't any error, This is due that defer block being executed unconditionally so even after we commit it successfully it will just give error. So add checking then commit it if all good.

* feat: added testing env.

This way we can use in memory sqlite.

* chore: Delete log should be debug as well.

* feat: enable foreign keys for testing for sqlite.

I recommend enabling all together. Not sure why it's commented but for now will keep it the same and only enable for testing.

* chore: catch error, if deleting a record fails.

* chore: catch error, if deleting a record fails.

* chore: catch error, when failed to enable toggle.

* chore: catch error, if updating failed.

* chore(filter): catch error, if deleting failed.

* chore(filter): catch error, if row is not modified for ToggleEnabled.

* chore(feed): Should be debug level to match with others.

* chore(feed): catch error when nothing is updated.

* chore: update docker-compose.yml add test_db for postgres.

* chore(ci): update include postgres db service before running tests.

* feat(database): Added database testing.

* feat(database): Added api integration testing.

* feat(database): Added action integration testing.

* feat(database): Added download_client integration testing.

* feat(database): Added filter integration testing.

* test(database): initial tests model (WIP)

* chore(feed): handle error when nothing is deleted.

* tests(feed): added delete testing.

* chore(feed): handle error when nothing is updated.

* chore(feed): handle error when nothing is updated.

* chore(feed): handle error when nothing is updated.

* feat(database): Added feed integration testing.

* fix(feed_cache): This should be time.Time not time.Duration.

* chore(feed_cache): handle error when deleting fails.

* feat(database): Added feed_cache integration testing.

* chore: add EOL

* feat: added indexer_test.go

* feat: added mock irc data

* fix: the column is not pass anymore it's password.

* chore: added assertion.

* fix: This is password column not pass test is failing because of it.

* feat: added tests cases for irc.

* feat: added test cases for release.

* feat: added test cases for notifications.

* feat: added Delete to the User DB that way it can be used for testing.

* feat: added user database tests.

* refactor: Make setupLogger and setupDatabase private also renamed them.

Changed the visibility of `setupLogger` to private based on feedback. Also renamed the function to `setupLoggerForTest` and `setupDatabaseForTest` to make its purpose more descriptive.

* fix(database): tests postgres ssl mode disable

* refactor(database): setup and teardown

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
2023-11-18 20:04:30 +01:00
Kyle Sanderson
8c89481d88
feat(sqlite): implement query planner (#1174)
* feat(sqlite): implement query planner

* implement Close on SQLite
2023-11-01 18:07:16 +01:00
ze0s
9793764905
feat(feeds): improve caching (#1191)
* feat(feeds): improve caching

* fix(feeds): put cache if not empty

* fix(feeds): reassign loop var

* fix(feeds): enable busy_timeout again

* fix(feeds): enable busy_timeout again
2023-10-21 17:03:52 +02:00
ze0s
604c7896bd
chore: add LICENSE GPLv2-or-later (#897)
* chore: add LICENSE

* chore: add LICENSE to README
2023-05-01 16:21:59 +02:00
Kyle Sanderson
603828be9d
feat(sqlite): commit WAL on startup (#684)
* fix(sqlite): increase page_size to 65536

* fix(db): implement WAL commit on startup

* revert page_size
2023-03-19 21:21:02 +01:00
Kyle Sanderson
3b516c8bcc
enhancement(database): improve log messages (#695)
* fix(migrations): reduce anxiety anxiety

* sqlite
2023-02-11 22:32:22 +01:00
ze0s
9508cbb46c
feat(actions): qbit add options content layout and skip hash check (#393)
* feat(actions): qbit content layout and skip hash check

* feat(actions): qbit options
2022-08-02 18:06:45 +02:00
Ludvig Lundgren
0e88117702
feat(logging); improve messages and errors (#336)
* feat(logger): add module context

* feat(logger): change errors package

* feat(logger): update tests
2022-07-05 13:31:44 +02:00
Ludvig Lundgren
91b094f4f4
feat(confg): reload on save and refactor logging (#275)
* feat(confg): reload on save

* refactor(logging): rework
2022-05-20 09:27:01 +02:00
Ludvig Lundgren
d3aabffcfa
fix(database): sqlite disable foreign key check (#229) 2022-04-10 19:00:15 +02:00
Ludvig Lundgren
3185832708
feat: add postgres support (#215)
* feat: add postgres support and refactor

* feat: improve releases find

* fix: autobrrctl create user
2022-04-02 19:24:23 +02:00
Ludvig Lundgren
cc0c071cce feat: wip postgres support 2022-03-27 03:12:00 +02:00
Ludvig Lundgren
3c323004c0
refactor: change back to modernc sqlite db driver (#120)
* refactor: change to modernc sqlite db driver

* chore: update deps
2022-03-19 17:41:42 +01:00
Ludvig Lundgren
00bc8298ac
feat(filters): add music filters (#91)
* feat(filters): add music filters

* feat: improve parsing and filtering

* feat: add red api support
2022-01-19 18:50:04 +01:00
Ludvig Lundgren
2daeedbdc7
Feature: Support multi user per irc network (#78)
* feat: delete irc network in transaction

* feat: use compound key for irc handlers

* chore: update deps

* refactor: start network

* refactor: init irc handler

* indexers: update network name
2022-01-13 21:26:23 +01:00
Ludvig Lundgren
f466657ed4
Fix: Performance issues and sqlite locking (#74)
* fix: performance issues and sqlite locking

* fix: dashboard release stats was reversed

* refactor: open and migrate db

* chore: cleanup
2022-01-11 19:35:27 +01:00