create_user
Creates a new user record in the database by hashing the provided password and committing the user object to the session.
def create_user(
session: Session,
user_create: UserCreate
) - > User
Creates a new user record in the database by hashing the provided password and persisting the user model.
Parameters
| Name | Type | Description |
|---|---|---|
| session | Session | The active SQLAlchemy database session used to perform the transaction. |
| user_create | UserCreate | A Pydantic model containing the initial user details and plain-text password to be hashed. |
Returns
| Type | Description |
|---|---|
User | The newly created User database object, including the generated ID and refreshed state. |