Pipelinen parannuksia building blockeilla
This commit is contained in:
39
zipit/rest_api_check/prompts/2_data_models.py.md
Normal file
39
zipit/rest_api_check/prompts/2_data_models.py.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# 2 — Data Engineer (data) — models.py
|
||||
|
||||
**Malli:** `template`
|
||||
|
||||
## System Prompt
|
||||
|
||||
```
|
||||
(template pipeline — ei LLM-promptia)
|
||||
```
|
||||
|
||||
## Syöte
|
||||
|
||||
```
|
||||
Generated from spec: ["User"]
|
||||
```
|
||||
|
||||
## Tulos
|
||||
|
||||
```
|
||||
from sqlalchemy import create_engine, Column, Integer, String
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
|
||||
DATABASE_URL = "sqlite:///./app.db"
|
||||
engine = create_engine(DATABASE_URL, connect_args={"check_same_thread": False})
|
||||
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
||||
Base = declarative_base()
|
||||
|
||||
class User(Base):
|
||||
__tablename__ = "users"
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
UserID = Column(Integer, nullable=False)
|
||||
Username = Column(String(255), nullable=False)
|
||||
Email = Column(String(255), nullable=False)
|
||||
PasswordHash = Column(String(255), nullable=False)
|
||||
|
||||
Base.metadata.create_all(bind=engine)
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user