sqlite 的字段长度有什么用?

创建一个表,一个字段长度为 1

CREATE TABLE "main"."aa" (
"t"  TEXT(1)
)
;

插入一个长度大于 1 的数据, 为什么会插入成功呢?
那么这个字段长度有什么用呢?

INSERT INTO "main"."aa" ("t") VALUES ('adadasdasdasdasdasdasdasdasdasdasdasda')
阅读 4.9k
1 个回答

没啥用,当成注释文档吧

Note that numeric arguments in parentheses that following the type name (ex: "VARCHAR(255)") are ignored by SQLite - SQLite does not impose any length restrictions (other than the large global SQLITE_MAX_LENGTH limit) on the length of strings, BLOBs or numeric values.

https://sqlite.org/datatype3....

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题