dominion-solutions / laravel-mysqlite Goto Github PK
View Code? Open in Web Editor NEWA Laravel Service Provider that injects select MySQL functions into SQLite
License: MIT License
A Laravel Service Provider that injects select MySQL functions into SQLite
License: MIT License
This is an incredibly complex function. https://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html#function_if. While it may not be able to be ported, the case...when substitution may work. It will require some tweaks to the substitution methods that are used for variables that don't exist.
Add PHP 7.3 to Travis-CI build.
Add a matrix to allow failures on the PHP-Nightly build for now. Coveralls.io does not play nicely with PHP 8 yet.
Possible Suspect Call:
SELECT FORMAT((3600 * 1.7 / 281), 1)
Stack Trace:
1) Tests\Unit\Reports\ReportsComponentTest::testBtHighchartDataWithDefaultOptions
Error: Class 'NumberFormatter' not found
/var/www/html/vendor/spam-n-eggs/laravel-mysqlite/src/Mhorninger/MySQLite/MySQL/StringExtended.php:29
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:330
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:657
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:624
/var/www/html/vendor/spam-n-eggs/laravel-mysqlite/src/Mhorninger/SQLite/MySQLiteConnection.php:41
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:333
/var/www/html/app/Traits/ReportsComponent.php:788
/var/www/html/tests/Unit/Reports/ReportsComponentTest.php:81
I noticed an issue with SQLite which I assume is a bug in one of the adapter functions.
The bug is somewhere in this SQL fragment:
CONCAT(
DATE_FORMAT(CONVERT_TZ(calculation_dt, 'GMT', int_tz), '%Y-%m-%d %H:'),
COALESCE(
LPAD(
MINUTE(calculation_dt)-MOD(MINUTE(calculation_dt), 15),
2,0
),
'00'
)
)
That sql fragment when used as a select against a dataset where "calculation_dt" is a datetime, should return data that looks like this:
2020-02-08 20:00
2020-02-08 20:15
2020-02-08 20:30
2020-02-08 20:45
2020-02-08 21:00
But instead of returning 15 minute chunks, it is returning only hourly ones:
2020-02-08 20:00
2020-02-08 21:00
My best guess as to the cause is a bug in the mod() implementation which causes it to return 0 regardless of what arguments are passed in. But I didn't really get deep into debugging it to pinpoint the specifics.
PHP does not handle this in the date format. Emulate the way this format string works in MySQL.
This format string does not exist in PHP. Emulate the way MySQL handles it.
I wasn't able to use PDO::sqliteCreateFunction()
for LEFT/RIGHT because these are SQL keywords, so it would be great to use the methodRewrite
functionality in this package to wrap these keywords in backticks and then implement the function extensions in StringExtended
Incoming MR ๐
This formatter does not exist, and does not exist in php as well. Port the functionality.
When Coveralls.io catches up and can play nicely with PHP 8.0, disable the allow failures for the php-nightly environment.
Requesting support for the MySQL YEARWEEK function
https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_yearweek
There's definitely a problem in there, because no one can find this package in Packagist. A little bit of SEO will go a long way to helping get this package picked up mainstream.
The badge should be
[![StyleCI](https://github.styleci.io/repos/167069269/shield?branch=master)](https://github.styleci.io/repos/167069269)
Currently there are no tests around the Service Provider class. Add some testing to make sure it works in laravel.
Please add support for the following functions:
Add support for the following modifiers:
%j is off by 1 day due to the difference in the way PHP and SQLite process this format string. Create a special handler for this to make it emulate it correctly.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.