class User(sav.Model):
    __tablename__ = "validate_size"
    id = sav.Column(sa.INTEGER, primary_key=True, autoincrement=True)
    c1 = sav.Column(sa.INTEGER)
    c2 = sav.Column(sa.INTEGER, size=(None, 3))
    c3 = sav.Column(sa.INTEGER, size=(1, None))
    c4 = sav.Column(sa.INTEGER, size=(1, 3))
예제 #2
0
class User(sav.Model):
    __tablename__ = "validate_legnth"
    id = sav.Column(sa.INTEGER, primary_key=True, autoincrement=True)
    c1 = sav.Column(sa.VARCHAR(5))
    c2 = sav.Column(sa.VARCHAR(5), length=(None, 3))
    c3 = sav.Column(sa.VARCHAR(5), length=(1, None))
    c4 = sav.Column(sa.VARCHAR(5), length=(1, 3))
예제 #3
0
class User(sav.Model):
    __tablename__ = "validate_not_null"
    id = sav.Column(sa.INTEGER, primary_key=True, autoincrement=True)
    c1 = sav.Column(sa.INTEGER, nullable=False)
    c2 = sav.Column(sa.INTEGER, nullable=False, default=5)
    c3 = sav.Column(sa.VARCHAR(5), nullable=False, server_default="foo")
    c4 = sav.Column(sa.VARCHAR(5))
class User(sav.Model):
    __tablename__ = "validate_email"
    id = sav.Column(sa.INTEGER, primary_key=True, autoincrement=True)
    c1 = sav.Column(sa.VARCHAR(20), format="email")
예제 #5
0
class User(sav.Model):
    __tablename__ = "validate_enum"
    id = sav.Column(sa.INTEGER, primary_key=True, autoincrement=True)
    c1 = sav.Column(sa.Enum("foo", "bar"))
class User(sav.Model):
    __tablename__ = "validate_regexp"
    id = sav.Column(sa.INTEGER, primary_key=True, autoincrement=True)
    c1 = sav.Column(sa.VARCHAR(10), regexp=re.compile(r"^test"))
예제 #7
0
class User(sav.Model):
    __tablename__ = "test_validate_type"
    integer = sav.Column(sa.INTEGER, primary_key=True, autoincrement=True)
    boolean = sav.Column(sa.Boolean)
    date = sav.Column(sa.Date)
    datetime = sav.Column(sa.DateTime)
    enum = sav.Column(sa.Enum("foo", "bar"))
    float = sav.Column(sa.Float)
    interval = sav.Column(sa.Interval)
    string = sav.Column(sa.String)
    text = sav.Column(sa.Text)
    time = sav.Column(sa.Time)
    timestamp = sav.Column(sa.TIMESTAMP)
예제 #8
0
class User2(sav.Model):
    __tablename__ = "validate_not_null2"
    id = sav.Column(sa.INTEGER, primary_key=True)
예제 #9
0
class User(sav.Model):
    __tablename__ = "convert_model_to_dict"
    id = sav.Column(sa.INTEGER, primary_key=True, autoincrement=True)
    c1 = sav.Column(sa.INTEGER)
예제 #10
0
class User(sav.Model):
    __tablename__ = "validates"
    id = sav.Column(sa.INTEGER, primary_key=True, autoincrement=True)
    c1 = sav.Column(sa.INTEGER, size=(None, 5))