Comments (5)
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 .
from aura.sql.
So, the problem with overriding from an AbstractDriver is this: if you have lastInsertId($table, $col)
that means you have to provide a table and column name, even if the driver doesn't need them. In MySQL and SQLite they will be ignored, but in Postgres it's important. If we just make AbstractDriver lastInsertId()
and then make just the pgsql driver lastInsertId($table, $col)
then you get a strictness error; the subclass signature needs to match the abstract signature. The easiest solution to make sure each driver works the way the underlying database expects it to, is to have lastInsertId()
be specific to each driver.
from aura.sql.
May be I am missing something to understand from you .
But I wonder if we have kept lastInsertId($table = null , $col = null )
will have the same trouble ?
I did a test with
<?php
abstract class AbstractClass
{
public function display($k = '' , $l = '' )
{
echo "Hello World" . PHP_EOL;
}
}
class Hello extends AbstractClass
{
}
class World extends AbstractClass
{
public function display($k , $l)
{
echo "From World" . $k . $l . PHP_EOL;
}
}
$world = new World();
$world->display( "Yes you are right" , " You are wrong");
$hello = new Hello();
$hello->display();
output is
hari@local-lx1:/var/www/test$ php AbstractClass.php
From WorldYes you are right You are wrong
Hello World
So may be you missed to see my point . As the abstract class signature is
already having a value , but set default as null or '' , it will not be a
trouble I guess .
Did you looked the commit over
harikt@3d63841?
from aura.sql.
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?
from aura.sql.
Yes understood .
from aura.sql.
Related Issues (20)
- Bug with pgsql query HOT 5
- DB Reconnection HOT 5
- Auto adding Ticks HOT 8
- Decode json? (to arrays) HOT 1
- Bug in Queryparser for SQLite HOT 3
- Question HOT 1
- Using 2.x and 3.x in parallel HOT 10
- What is the future of this project? HOT 15
- Create GIthub Actions to automatically build and test this package
- PHP 8.1 Compatibility HOT 8
- Type hint incomplete HOT 7
- Scrutinizer Error HOT 1
- Version that doesn't throw deprecation warnings in 8.1 but works in 8.0? HOT 19
- Works with all versions of PHP from 5.6 to 8.1
- Release note HOT 7
- Abandon 4.x ? HOT 2
- Consider tagging / releasing 3.0.1 please ? HOT 2
- How to debug "Column count doesn't match value count"? HOT 1
- Time for 5.0.2/5.1 HOT 4
- Does Aura.Sql suffer of the problem of useless order by on some ORM prefetches ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aura.sql.