Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# and Sqlite field length

Tags:

c#

sqlite

I have made a table in SQLite and choosed varchar(30) for one Field but it seems as i actually can save much longer strings, is this normal? Can anyone explain this to me?

like image 453
user1509662 Avatar asked May 29 '26 15:05

user1509662


1 Answers

Yes, it's normal, and explained in the documentation:

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.

(Note that before seeing this question, I had no idea about this. It's always worth checking the documentation first.)

like image 61
Jon Skeet Avatar answered May 31 '26 05:05

Jon Skeet



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!