Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major record overhaul (Database update) #1

Merged
merged 47 commits into from
Apr 28, 2022
Merged

Major record overhaul (Database update) #1

merged 47 commits into from
Apr 28, 2022

Conversation

siblount
Copy link
Owner

This update no longer relies on the OS file system structure to handle and maintain product records. Instead, it relies on the SQLite database to maintain records and utilizes its abstractions for searching, sorting, and filtering.

As of this update, there are several issues and the database is still not complete. The sole purpose of this update is to convert from relying on the file structure to database. The database is now somewhat consistent enough to add records. There are still several issues that need to be addressed.

Some highlights:

  • LibraryIO is deprecated and will be deleted soon.
  • Product Record View is now partially implemented.
  • Database Viewer (read-only) has been implemented (it's hidden, click on the bottom toolstrips "Loading items...")
  • Library Item has been optimized.
  • App now only allows one instance to run.
  • Updated project to use latest Visual Studio.

siblount added 30 commits April 7, 2022 09:23
Newest VS Studio update added C# .NET naming rules. I added some rules for style consistency.
Created DPCache that implements dictionary which is used for caching stuff at a set limit.
Used to handle tasks. Manually used for DPDatabase.
StackOverflow code in preparations for installing REGEXP function for the SQLite Database.
- Implemented search code to convert from user search query to SQL query.
- Tasks will be handled on a different thread and called in sequential order.
- Updated functions to be more async friendly.
- Updated database layout; Added tags table, changed Product Record ID type to String from Int.
- Added transactions when attempting to insert values into database.
- Created QueueAction delegates; delegates which all take in the CancellationToken
- Added & Updated AddToQueue methods
- Fixed continuation tasks not stopping even while the task was cancelled; tasks will chained with continuewith while the token is cancelled will not execute.
Revamped to be on par with the recent DPTaskManager update.
- Added database and task state properties & variables for cross-thread communication.
- Internal functions (should) properly add functions to the queue or forcefully if necessary.
 - Appliciable private functions wait for search task to complete before continuing.
- Functions have style - Q  = Queryable Entry Point, S = Specific for Search functions
- Search results are saved to results variable and alerted through events.
- Added events
- Added an event to begin searching through the database.
- Updated Database Initialize call.
- Removed database tests at Library_Load
- Got rid of unused import.
Newest VS Studio update added C# .NET naming rules. I added some rules for style consistency.
Created DPCache that implements dictionary which is used for caching stuff at a set limit.
Used to handle tasks. Manually used for DPDatabase.
StackOverflow code in preparations for installing REGEXP function for the SQLite Database.
- Implemented search code to convert from user search query to SQL query.
- Tasks will be handled on a different thread and called in sequential order.
- Updated functions to be more async friendly.
- Updated database layout; Added tags table, changed Product Record ID type to String from Int.
- Added transactions when attempting to insert values into database.
- Created QueueAction delegates; delegates which all take in the CancellationToken
- Added & Updated AddToQueue methods
- Fixed continuation tasks not stopping even while the task was cancelled; tasks will chained with continuewith while the token is cancelled will not execute.
Revamped to be on par with the recent DPTaskManager update.
- Added database and task state properties & variables for cross-thread communication.
- Internal functions (should) properly add functions to the queue or forcefully if necessary.
 - Appliciable private functions wait for search task to complete before continuing.
- Functions have style - Q  = Queryable Entry Point, S = Specific for Search functions
- Search results are saved to results variable and alerted through events.
- Added events
- Added an event to begin searching through the database.
- Updated Database Initialize call.
- Removed database tests at Library_Load
- Got rid of unused import.
siblount added 17 commits April 10, 2022 09:55
Created a read only database view to see all the entries in the database.
Database is now *partially( functional, it still has come kinks that need to be addressed. Such as, handling sqlite errors when the main database operations (insert, delete) are trying to do work while search has priority.

- DPDatabase is now public.
- Some variable name changes.
- Searching now uses another read only connection.
- Correctly closed transactions (close transactions after committing).
- SQLite parameters now use the parameters abstraction instead of naive version.
- Updated search functions.
- Prepared SQL Regex Search
- Changed events to now share via parameter rather than updating it's "global" variable.

And more small changes but significant changes.
- DPSearchRecord & DPExtractionRecord now matches the database columns.

- DPSearchRecord will be removed later.
LibraryIO has been deprecated and will be removed since we are no longer using the file system as our way of handling records.

- LibraryIO has been stripped of functions and some appropriate functions have been moved (and renamed) to DPArchive.
- LibraryItem has been updated; it no longer holds the folders label and dropdown image. It now has a button that opens up the record.
- LibraryItem is used for searching as well.
- LibraryPanel has been adjusted for performance and database reasons.
- DPSortMethod enum has been added in prep for sort functionality.
- Added note for DPNetwork to handle when imgNode is null

Needs to stop throwing exceptions.
@siblount siblount self-assigned this Apr 28, 2022
@siblount siblount merged commit 734eefe into main Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant