-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/db adapters #3
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
base: master
Are you sure you want to change the base?
Conversation
|
|
||
| public function selectOneNull($tableName); | ||
|
|
||
| public function createTableIfNotExists($tableName); |
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.
It can be less general, f.e. createMigrationTable($tableName).
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.
I'm not sure, if I do new instance of this adapter, I will need know what I have to do
This return string which create table ONLY IF table not exists. This is very important
|
|
||
| public function createTableIfNotExists($tableName); | ||
|
|
||
| public function insertIntoTable($tableName); |
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.
insertIntoMigrationTable
|
|
||
| public function insertIntoTable($tableName); | ||
|
|
||
| public function selectNullFromId($tableName); |
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.
selectByIdFromMigrationTable
| $this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); | ||
| $this->supportsMultiStatements = in_array($this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME), [ | ||
| "mysql" | ||
| $this->adapter->getDbType() |
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.
This part checks if $this->pdo is capable to run multi statement. You can append another driver name to this array. Your change means that every adapter supports it.
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.
Maybe I don't undenstand you last sence. If adapter returns string which is not in array that means that multi select are not supporter, isn't it?
|
|
||
| namespace PetrKnap\Php\MigrationTool\DbAdapters; | ||
|
|
||
| /* |
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.
Remove this placeholder comment
|
I have an idea how to do this more systematic way. When do you need this change? I could do it this weekend. |
|
It will be satisfactory, Thank you very much. Btw. How idea you have? |
|
Try this https://github.com/petrknap/php-migrationtool/releases/tag/v3.0.0-alpha it uses DBAL and should works on every SQL database. |
|
Unfortunally, this version (3,0) has still problem on sql server |
|
It's covered by |
|
Try https://github.com/petrknap/php-migrationtool/releases/tag/v3.0.0-beta - it's quoted directly by DBAL now |
|
sorry for my delay, In your source is try-catch block on create table and TableExistsException is ignored, but there is not thrown TableExistException - this is DbalException - and this is answer to your previous question thanks for your time |
RawGit is shutting down, replace it with jsDelivr
Switch between sql dialects will be usefull
-> added interface which allow this and two basic implementation - mysql and mssql
especly I need used this tool with MsSql Server