gpt4 book ai didi

mysql - 用 Squeryl 存储长字符串

转载 作者:行者123 更新时间:2023-11-29 00:48:15 26 4
gpt4 key购买 nike

我想使用 VARCHAR(255) 或 TEXT MySQL 数据类型来存储科学文章的名称。Squeryl 创建 VARCHAR(128) 字段来存储字符串。如何配置它以使用更大的字段?

最佳答案

来自 http://squeryl.org/schema-definition.html

object Library extends Schema {
...
...
on(borrowals)(b => declare(
b.numberOfPhonecallsForNonReturn defaultsTo(0),
b.borrowerAccountId is(indexed),
columns(b.scheduledToReturnOn, b.borrowerAccountId) are(indexed)
))

on(authors)(s => declare(
s.email is(unique,indexed("idxEmailAddresses")), //indexes can be named explicitely
s.firstName is(indexed),
**s.lastName is(indexed, dbType("varchar(255)")),** // the default column type can be overriden
columns(s.firstName, s.lastName) are(indexed)
))
}

关于mysql - 用 Squeryl 存储长字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9606207/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com