Page 1 of 1

Specifying size of INTEGER type

Posted: Tue 26 Apr 2016 20:41
by instrumentally
I am trying to keep a SQLite table as small as possible. My tables will only contain 1 byte integers. However, it is unclear when I create a new table using the LiteDAC Delphi components what exactly is getting created with regards to the new INTEGER field when I use the following to create a new table:

CREATE TABLE test (SmallNumber INTEGER)

Will the resulting SmallNumber field be 1, 2, 4...8 bytes in size?

How do I ensure that such a table can be as small as possible as I insert 1 byte integers into the table (with regards to disk space)?

Re: Specifying size of INTEGER type

Posted: Wed 27 Apr 2016 06:39
by MaximG
This question doesn't concern to LiteDAC functionality. Please refer to SQLite documentation: https://www.sqlite.org/datatype3.html If you have any further questions concerning our components, please contact us.

Re: Specifying size of INTEGER type

Posted: Wed 27 Apr 2016 14:13
by instrumentally
MaximG,

Your URL reference does not address my question. As an employee of devart, your response is sad. If the user can't control the byte size of the INTEGER type, then it would have taken you 30 seconds to have said as much. If the user has the ability to control the byte size when creating a table, your response would have likewise taken 30 seconds with a short CREATE TABLE example.

Instead, you brush me off and tell me to go read a URL which does not answer my question at all.

I'll remember this when it comes time to recommend to my peers a database solution for Delphi.

I'll try stackoverflow instead, where people who don't get paid will show more interest in helping than a paid employee of devart towards a paying customer.

Re: Specifying size of INTEGER type

Posted: Thu 28 Apr 2016 09:22
by MaximG
According to SQLite documentation, that we referred to, the size of an Integer field on disk in SQLite depends not on the type declaration, but on the value size. Therefore, using LiteDAC , a user can't control the size of an Integer field on disk, since this behavior is implemented by the SQLite engine, not by LiteDAC. Please contact us concerning LiteDAC usage.