Skip to content

Implement CRUD Endpoints for User and Book Tables#1

Open
datirsayali wants to merge 3 commits intomainfrom
sayali
Open

Implement CRUD Endpoints for User and Book Tables#1
datirsayali wants to merge 3 commits intomainfrom
sayali

Conversation

@datirsayali
Copy link

This pull request introduces CRUD (Create, Read, Update, Delete) endpoints for user and book.

User Table:
Create User : Endpoint to add a new user.
Read Users : Endpoint to fetch list all users.
Update User : Endpoint to update user details by id.
Delete User : Endpoint to remove a user by id.

Book Table:
Create Book: Endpoint to add a new book.
Read Books/book : Endpoint to fetch a book by id and list all books.
Update Book: Endpoint to update book details by id.
Delete Book: Endpoint to remove a book by id.

from app.connections import SqlConnection
class SubApp1Service:
db_config = {
'host': 'localhost',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This credentials should come from config and not in code.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I will make changes


def get_books(self):
try:
query = "select * from books"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All queries will be done in the coordinator only logic in service file.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@Datirsayali12
Copy link

I added the database query code in coordinator.py file and push changes with new commit

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.

3 participants