MCPcopy Create free account
hub / github.com/erans/pgsqlite / User

Class User

benchmarks/test_sqlalchemy.py:26–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25# Define test models
26class User(Base):
27 __tablename__ = 'users'
28
29 id = Column(Integer, primary_key=True)
30 username = Column(String(50), unique=True, nullable=False)
31 email = Column(String(100), unique=True, nullable=False)
32 full_name = Column(String(100))
33 age = Column(Integer)
34 balance = Column(DECIMAL(10, 2), default=Decimal('0.00'))
35 is_active = Column(Boolean, default=True)
36 created_at = Column(DateTime, default=func.now())
37 birth_date = Column(Date)
38 bio = Column(Text)
39 metadata_json = Column(JSON)
40
41 # Relationships
42 posts = relationship("Post", back_populates="author", cascade="all, delete-orphan")
43
44 # Indexes
45 __table_args__ = (
46 Index('idx_username_email', 'username', 'email'),
47 UniqueConstraint('username', 'email', name='unique_user_constraint'),
48 )
49
50class Post(Base):
51 __tablename__ = 'posts'

Callers 8

test_basic_crudMethod · 0.70
test_relationshipsMethod · 0.70
test_complex_queriesMethod · 0.70
test_joinsMethod · 0.70
test_transactionsMethod · 0.70
test_bulk_operationsMethod · 0.70
test_subqueriesMethod · 0.70

Calls

no outgoing calls

Tested by 8

test_basic_crudMethod · 0.56
test_relationshipsMethod · 0.56
test_complex_queriesMethod · 0.56
test_joinsMethod · 0.56
test_transactionsMethod · 0.56
test_bulk_operationsMethod · 0.56
test_subqueriesMethod · 0.56