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

SQLite alternative? #23

Open
soullivaneuh opened this issue Jun 23, 2017 · 3 comments
Open

SQLite alternative? #23

soullivaneuh opened this issue Jun 23, 2017 · 3 comments

Comments

@soullivaneuh
Copy link

SQLite is frequently used instead of MySQL for unit testing.

But some functions differ.

Would you be interested by Pull Requests for SQLite alternatives?

This is a quite easy implement, for example with YEAR:

public function getSql(SqlWalker $sqlWalker)
{
    if ($sqlWalker->getConnection()->getDriver() instanceof AbstractSQLiteDriver) {
        return "DATE('%Y', {$this->dateExpression->dispatch($sqlWalker)})";
    }

    return 'YEAR('.$this->dateExpression->dispatch($sqlWalker).')';
}

What do you think?

@luxifer
Copy link
Owner

luxifer commented Jun 23, 2017

Yes!!!! If the result of the different function are equal, it's OK for me

@soullivaneuh
Copy link
Author

@luxifer I think the tests should be rethink in this case, to test the result of a query on real databases, right?

@luxifer
Copy link
Owner

luxifer commented Jun 23, 2017

I don't think it's useful to test that as it will introduce a lot of overhead in the test suite. As long as the MySQL and SQlite doc specify the same value for the return, it's OK for me

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

No branches or pull requests

2 participants