Skip to content
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

[NFR] Support mysql BLOB field types #10502

Closed
mattvb91 opened this issue Jun 11, 2015 · 3 comments
Closed

[NFR] Support mysql BLOB field types #10502

mattvb91 opened this issue Jun 11, 2015 · 3 comments

Comments

@mattvb91
Copy link
Contributor

Hi everyone

I would like to see the BLOB data types supported for mysql. I have installed zephir and made the following changes (I have added tinyblob, blob, mediumblob, longblob too. For this example just using the blob field)

\Phalcon\Db\Column.zep Line 105

    /**
     * Blob abstract data type
     */
    const TYPE_BLOB = 11;

\Phalcon\Db\Adapter\Pdo\Mysql.zep Line 194

        /**
        * Blob
        */
        if(memstr(columnType, "blob")) {
              let definition["type"] = Column::TYPE_BLOB;
              break;
        }

\Phalcon\Db\Dialect\Mysql.zep Line 134

                case Column::TYPE_BLOB:
                   if empty columnSql {
                       let columnSql .= "BLOB";
                   }
            break;

Where would be the best place to define mysql specific column types instead of \Phalcon\Db\Column.zep?

@andresgutierrez
Copy link
Contributor

Phalcon needs to know what type is a column so the ORM can use the proper data type in PDO::bindValue (http://php.net/manual/en/pdostatement.bindvalue.php). Could you please submit a PR with these changes?

@mattvb91
Copy link
Contributor Author

Thanks for the reply Andre, I will submit a PR this evening.

Am I assuming correctly then that \Phalcon\Db\Column.zep is the correct place to define these new types? As from looking at the code each sql dialect will default it to its own type if it doesn't support it anyway.

@andresgutierrez
Copy link
Contributor

@mattpavelle Yes, it's the right place. I think it will be simply not available to other platforms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants