-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added smallint support in Phalcon\Db #12523
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Studentsov Could you please cover new feature by unit tests?
@@ -142,6 +142,11 @@ class Column implements ColumnInterface | |||
const TYPE_TIMESTAMP = 17; | |||
|
|||
/** | |||
* Small integer abstract type | |||
*/ | |||
const TYPE_SMALLINTEGER = 18; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about just TYPE_SMALLINT
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have a type TYPE_BIGINTEGER. It would be very strange (though quite in the spirit of PHP 😆) to use the name TYPE_SMALLINT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree
Can you add here tinyint support too? |
As far is I known, the one-byte integer type isn't provided by the SQL
standard. For example, it isn't in PostgreSQL.
|
Oh okay, so it could be at least added to mysql. Not sure about Column class. |
a848621
to
4d3c73f
Compare
@Studentsov Could you be so kind as to rebase this for the Apologies for letting this linger for this long |
Addressed in #13562 |
This patch adds the capability to use the data type smallint, which is part of the SQL standard and is well supported by major DBMS. This data type uses 2 bytes instead of 4 bytes for type int, which will save memory if you don't need large numeric values.