Skip to content

Create database helper functions #35

@amberjones

Description

@amberjones

We need several functions to interact with our database, including but not limited to the following:

Add a user Preferences Table. 1 to 1

BOOKS

  • Insert a book to the books table
  • Retrieve a book from the Book Table
    Look up ISBN and return info as an object

USERS_FOLLOWERS
A look up USERS_BLOCKED needs to happen before insert

  • Query for all the followers of a user (send back the usernames and IDs).
    Send back an array of objects. We will need their ID to show their "to-read" list upon clicking on their
    username client side
  • Query for all users following a user (send back the usernames and IDs)

USERS_BLOCKED

  • Insert User_ID and BLOCKED_ID
  • ? Delete - un-block user and remove that data entry

USERS_PREFERENCE

  • Insert default preferences upon user creation - reference User_ID
  • Patch preference - take in User_ID
  • Query for user preference. send back an object.

USERS_BOOKS

  • Query for books based on boolean
  • Insert book - to happen exactly after a yes or no choice is made.
  • Patch - takes in User_ID and ISBN and changes Boolean

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions