Specifying size of INTEGER type

Discussion of open issues, suggestions and bugs regarding LiteDAC (SQLite Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
instrumentally
Posts: 13
Joined: Thu 14 Aug 2014 16:05

Specifying size of INTEGER type

Post by instrumentally » Tue 26 Apr 2016 20:41

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)?

MaximG
Devart Team
Posts: 1025
Joined: Mon 06 Jul 2015 11:34

Re: Specifying size of INTEGER type

Post by MaximG » Wed 27 Apr 2016 06:39

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.

instrumentally
Posts: 13
Joined: Thu 14 Aug 2014 16:05

Re: Specifying size of INTEGER type

Post by instrumentally » Wed 27 Apr 2016 14:13

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.

MaximG
Devart Team
Posts: 1025
Joined: Mon 06 Jul 2015 11:34

Re: Specifying size of INTEGER type

Post by MaximG » Thu 28 Apr 2016 09:22

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.

Post Reply