开发者

How to change size of column in ROOM android?

开发者 https://www.devze.com 2022-12-07 19:28 出处:网络
I am new in android and got fascinated with Room library. I tried most thing mention开发者_如何转开发ed in the documentation but couldn\'t implement database size. For example when we make a table in

I am new in android and got fascinated with Room library. I tried most thing mention开发者_如何转开发ed in the documentation but couldn't implement database size. For example when we make a table in SQL we can,

CREATE TABLE Persons (
    PersonID int,
    LastName varchar(255),
    FirstName varchar(255),
    Address varchar(255),
    City varchar(255)
);

here we can define my column length but i can't find same option in ROOM.


Android database fundamentally is use SQLite include ROOM.

SQLite Datatypes

NULL. The value is a NULL value.

INTEGER. The value is a signed integer, stored in 0, 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.

REAL. The value is a floating point value, stored as an 8-byte IEEE floating point number.

TEXT. The value is a text string, stored using the database encoding (UTF-8, UTF-16BE or UTF-16LE).

BLOB. The value is a blob of data, stored exactly as it was input.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消