-
Notifications
You must be signed in to change notification settings - Fork 100
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
lastInsertId() #7
Comments
I have the commit over here harikt@3d63841 , but I need to rebase it , else there is an index.md which I have changed to add some documentation earlier which will not work in the new way :P . |
So, the problem with overriding from an AbstractDriver is this: if you have |
May be I am missing something to understand from you . But I wonder if we have kept I did a test with
output is
So may be you missed to see my point . As the abstract class signature is Did you looked the commit over |
The problem with that signature is that it makes it easy for developers to think "Oh, I can get the last insert ID from any table I want." It looks wrong when applied to MySQL. Do you get what I mean there? |
Yes understood . |
I was looking into the method
lastInsertId
,Postgres have a different way and I am not sure MSSQL has something different too for I don't remember or used it recently .
I feel the method
public function lastInsertId($table = '' , $col = '' )
can be moved toAbstractDriver.php
, so we don't repeat the same method inMysql.php
https://github.com/auraphp/Aura.Sql/blob/master/src/Aura/Sql/Driver/Mysql.php#L162 andSqlite.php
https://github.com/auraphp/Aura.Sql/blob/master/src/Aura/Sql/Driver/Sqlite.php#L228 .And we can override it from
Pgsql.php
https://github.com/auraphp/Aura.Sql/blob/master/src/Aura/Sql/Driver/Pgsql.php#L234 in the same fashion. Do you think its a good way ?The text was updated successfully, but these errors were encountered: