Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

OrmCAST TEXT type? -label:question #85

Closed
camexapps opened this issue Sep 10, 2014 · 5 comments
Closed

OrmCAST TEXT type? -label:question #85

camexapps opened this issue Sep 10, 2014 · 5 comments
Assignees
Milestone

Comments

@camexapps
Copy link

Hi there (awseome module by the way) just wondering if there is a cast type that is set for TEXT, MEDIUMTEXT etc?

@WebEP
Copy link
Collaborator

WebEP commented Sep 10, 2014

Hi,

No, as you can see here, all the types we currently are providing : https://github.com/besstiolle/orm-ms/blob/master/src/Orm/lib/class.OrmCAST.php.

Do you need these types to be added?

@camexapps
Copy link
Author

Yes, please. That would be great if you wouldn't mind... also TinyInt too

@besstiolle
Copy link
Owner

should it be more logic to let "integer" as the default value and proposing tinyint / bigint / ... according to the size of the "integer" field ?

I would avoid implementing too much new type of field. (eg : more code, duplicate tests, ...)

@camexapps
Copy link
Author

Thats a great idea

@besstiolle
Copy link
Owner

After some work on this subject, here my response :

Due to limitation of ADODB http://phplens.com/lens/adodb/docs-datadict.htm

STRING :

  • C: Varchar, capped to 255 characters.
  • X: Larger varchar, capped to 4000 characters (to be compatible with Oracle). (it's our BUFFER)

INTEGER :

  • I: Integer (mapped to I4)
  • I1: 1-byte integer
  • I2: 2-byte integer
  • I4: 4-byte integer
  • I8: 8-byte integer

So you won't be able to map your field on MEDIUMTEXT but we will be able to manage TINYINT, SMALLINT, INT, BIGINT. The MySqL Type MEDIUMINT is not implemented due to the ADODB limitation

See more doc on it : https://github.com/besstiolle/orm-ms/wiki/Cast (it's not already implemented on GIT)

@besstiolle besstiolle added this to the 0.3.2 milestone Oct 13, 2014
@besstiolle besstiolle self-assigned this Oct 13, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants