API models
Database Models for the ETL Process.
This module defines the database models using SQLAlchemy for employees, customers, and products.
Modules:
Name | Description |
---|---|
- sqlalchemy |
For ORM and database schema definition. |
- pydantic |
For data validation (not used in these models). |
CustomerDB
Bases: Base
Represents a Customer in the database.
Attributes:
customer_id (int):
The unique identifier for the customer (auto-incremented).customer_name (str):
The name of the customer.address (str):
The address of the customer.city (str):
The city where the customer resides.zip_code (str):
The customer's postal code.
Source code in myapp/api/Database/models.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
EmployeeDB
Bases: Base
Represents an Employee in the database.
Attributes:
employee_id (int):
The unique identifier for the employee (auto-incremented).first_name (str):
The first name of the employee.last_name (str):
The last name of the employee.email (str):
The unique email address of the employee.salary (int):
The employee's salary.
Source code in myapp/api/Database/models.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
ProductDB
Bases: Base
Represents a Product in the database.
Attributes:
product_id (int):
The unique identifier for the product (auto-incremented).product_name (str):
The name of the product.price (float):
The price of the product.description (str):
A short description of the product.category (str):
The category the product belongs to.
Source code in myapp/api/Database/models.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
|