Download the PHP package spam-n-eggs/laravel-mysqlite without Composer
On this page you can find all versions of the php package spam-n-eggs/laravel-mysqlite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download spam-n-eggs/laravel-mysqlite
More information about spam-n-eggs/laravel-mysqlite
Files in spam-n-eggs/laravel-mysqlite
Package laravel-mysqlite
Short Description MySQLite is a Laravel connector for SQLite that emulates MySQL functionality. The currently ported functionalities can be viewed in README.md on the github site.
License MIT
Informations about the package laravel-mysqlite
laravel-mysqlite
Laravel MySQLite is meant to be used in conjunction with Laravel. It is a database connection that adds select functions from MySQL to SQLite.
Usage
Adding the Composer Resource
- Execute
composer require spam-n-eggs/laravel-mysqlite
or alternativelycomposer require --dev spam-n-eggs/laravel-mysqlite
Registering as a Service Provider
In order to reduce clutter it is preferable to create a separate Service Provider
-
If there is a need to conditionally register the Service (i.e. you only use it in testing) create a new class in
app/Providers
that extendsMhorninger\SQLite\MySQLiteServiceProvider
- Add a line to
app/Providers/AppServiceProvider.php
within theregister()
method:
Ported Functionality
Constants
- UTC_TIMESTAMP
Operators
- DIV
Methods
Aggregate
- bit_or (int ...)
Date and Time
- convert_tz(date, fromTimezone, toTimezone)
- [date_add(date, INTERVAL
)]() - Ported Interval Specifiers
- SECOND
- MINUTE
- HOUR
- DAY
- WEEK
- MONTH
- YEAR
- Differences
- All DATE_ADD calls bring back the entire date time as opposed to just the short date.
- date_format(date, format)
- Un-ported Format Strings:
%U
,%V
,%X
- Other Limitations:
%j
is off by 1 day.
- Un-ported Format Strings:
- hour(time)
- minute(time)
- now()
- timestampdiff(timeUnit, startTimeStamp, endTimeStamp)
- time_to_sec(timeExpression)
- timediff(timeExpression1, timeExpression2)
- to_days(date)
- unix_timestamp(date = null)
- utc_timestamp()
- weekday(date)
Flow
- if(condition, onTrue, onFalse)
Numeric
- mod(number, divisor)
- Limitations - Support for Standard
MOD(N,M)
andN % M
notation only.N MOD M
is not supported.
- Limitations - Support for Standard
- rand()
- sqrt(value)
String
- concat(string ...)
- concat_ws(separator, string ...)
- format(number, decimals, locale = 'en_US')
- lpad(string, length, pad)
- rpad(string, length, pad)
- left(string, length)
- right(string, length)
Miscellaneous
- inet_ntoa(ipAddress)
Vectorface-Specific
Comparison
- least(mixed ...)
Custom Functionality
While this package aims to cover common functionality, there are times when you need support for a function quickly or a custom function that is unique to your application. This is easy to do with two methods from the boot()
method of your service provider class:
addRewriteRule()
will replace a string in your query using regex, should Sqlite have a native function that could be used as a 1:1 replacement.addFunction()
uses PDOsqliteCreateFunction()
to register a custom function with PHP in the event that Sqlite doesn't have a drop-in replacement or if logic is more complicated. Read More.
Contributing
Want to file a bug, contribute some code, improve documentation, or request a feature? Awesome Sauce! Read up on our guidelines for Code of Conduct.
Questions
Have a question? Log an issue with the Question tag. We'll get back to you in a timely fashion.
Credits
This library uses other Open Source components. You can find the source code of their open source projects along with license information below. We acknowledge and are grateful to these developers for their contributions to open source community.
Project: Database https://github.com/illuminate/database Copyright (c) Taylor Otwell License (MIT) https://github.com/laravel/framework/blob/5.7/LICENSE.md
Project: MySQLite https://github.com/Vectorface/MySQLite Copyright (c) 2014 Vectorface, Inc. License: (MIT) https://github.com/Vectorface/MySQLite/blob/master/LICENSE
All versions of laravel-mysqlite with dependencies
illuminate/database Version ^7.0 || ^8.0
php Version >=7.3.0