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

Using SQLite for DB #24

Merged
merged 14 commits into from
Jun 15, 2024
Merged

Using SQLite for DB #24

merged 14 commits into from
Jun 15, 2024

Conversation

fullerzz
Copy link
Owner

@fullerzz fullerzz commented Jun 15, 2024

To Do

  • Fix tests

@fullerzz fullerzz self-assigned this Jun 15, 2024
main.go Outdated Show resolved Hide resolved
@fullerzz fullerzz marked this pull request as draft June 15, 2024 00:17
@fullerzz
Copy link
Owner Author

Will fix tests in different MR.

@fullerzz fullerzz marked this pull request as ready for review June 15, 2024 22:12
@fullerzz fullerzz merged commit d5064d4 into 21-use-s3-as-storage-backend Jun 15, 2024
3 of 4 checks passed
@fullerzz fullerzz deleted the s3/sqlite branch June 15, 2024 22:12
fullerzz added a commit that referenced this pull request Jun 15, 2024
* wip: search files by tag

* wip: sqlite for db instead of dynamo

* writes to db on file upload are working

* added db.go with functions to add item to table and list files in table

* getFileMetadata successfully queries sqlite table when file exists. TODO: handle error

* returns 404 if error indicates file wasn't found - else 500

* moved additional table functionality to db.go

* removed more functions in aws.go - TODO: move QueryTags functionality to sqlite table

* moved all db functionality from dynamo to sqlite

* removed dynamo table from iac

* todo: mock s3 and any aws calls in tests

* removed commented-out line of code

* added tfvars to support dev and prod envs

* removed config. will set the values in scalr ui for now
fullerzz added a commit that referenced this pull request Jun 15, 2024
* initial terraform code to create iam + s3 resources

* WIP: updating saveFile to store uploaded file in s3

* WIP: updating saveFile to store uploaded file in s3; added s3.go

* updated error handling + loading bucket name from env var

* working on writing uploaded file metadata to new dynamo table

* added scripts

* writes to table successfully on file upload

* updated funcs in aws.go to use FileUpload struct instead of FileMetadata

* removed funcs that are now out of scope

* created struct to hold basic s3 info and now creating aws clients on startup

* attached upload file function to new s3 struct

* now using bucket key as range key for dynamo table

* changed bucketKey -> objectKey. file upload and retrieval is somewhat functional now

* removed unused structs

* 1.22 -> 1.22.4

* using http.D
etectContentType when returning downloaded file from s3

* implemented GET /files

* Using SQLite for DB (#24)

* wip: search files by tag

* wip: sqlite for db instead of dynamo

* writes to db on file upload are working

* added db.go with functions to add item to table and list files in table

* getFileMetadata successfully queries sqlite table when file exists. TODO: handle error

* returns 404 if error indicates file wasn't found - else 500

* moved additional table functionality to db.go

* removed more functions in aws.go - TODO: move QueryTags functionality to sqlite table

* moved all db functionality from dynamo to sqlite

* removed dynamo table from iac

* todo: mock s3 and any aws calls in tests

* removed commented-out line of code

* added tfvars to support dev and prod envs

* removed config. will set the values in scalr ui for now

* updated resource names to include env
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