from typing import Optional, List
import sqlalchemy
from sqlmodel import SQLModel, Field, Relationship
from datetime import date, datetime


# #############################################################################
# Links
class ListingFacilityLink(SQLModel, table=True):
    listing_id: int = Field(
        foreign_key="listings.id", primary_key=True
    )
    facility_id: int = Field(
        foreign_key="facilities.id", primary_key=True
    )


# #############################################################################


class SongBase(SQLModel):
    id: Optional[int]
    name: str
    artist: str
    year: Optional[int] = None


class Song(SongBase, table=True):
    id: int = 