Git Product home page Git Product logo

laravel-mysqlite's People

Contributors

daverogers avatar dependabot-preview[bot] avatar glennforrest avatar sou1aced avatar spam-n-eggs avatar swilla avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

laravel-mysqlite's Issues

Error received when trying to execute FORMAT method

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

Possible Bug in mod() function

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.

Support LEFT(), RIGHT()

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 ๐Ÿ™‚

Fix StyleCI Badge

The badge should be

[![StyleCI](https://github.styleci.io/repos/167069269/shield?branch=master)](https://github.styleci.io/repos/167069269)

Add Additional Functions

Please add support for the following functions:

  • date_format
  • LPAD
  • mod
  • minute
  • format
  • CONVERT_TZ
  • TIMEDIFF
  • UNIX_TIMESTAMP
  • weekday
  • inet_ntoa

Add support for the following modifiers:

  • INTERVAL

%j format string is off by one day

%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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.